diff --git a/.bingo/.gitignore b/.bingo/.gitignore new file mode 100755 index 00000000..4f2055b6 --- /dev/null +++ b/.bingo/.gitignore @@ -0,0 +1,12 @@ + +# Ignore everything +* + +# But not these files: +!.gitignore +!*.mod +!README.md +!Variables.mk +!variables.env + +*tmp.mod diff --git a/.bingo/README.md b/.bingo/README.md new file mode 100755 index 00000000..7a5c2d4f --- /dev/null +++ b/.bingo/README.md @@ -0,0 +1,14 @@ +# Project Development Dependencies. + +This is directory which stores Go modules with pinned buildable package that is used within this repository, managed by https://github.com/bwplotka/bingo. + +* Run `bingo get` to install all tools having each own module file in this directory. +* Run `bingo get ` to install that have own module file in this directory. +* For Makefile: Make sure to put `include .bingo/Variables.mk` in your Makefile, then use $() variable where is the .bingo/.mod. +* For shell: Run `source .bingo/variables.env` to source all environment variable for each tool. +* For go: Import `.bingo/variables.go` to for variable names. +* See https://github.com/bwplotka/bingo or -h on how to add, remove or change binaries dependencies. + +## Requirements + +* Go 1.14+ diff --git a/.bingo/Variables.mk b/.bingo/Variables.mk new file mode 100644 index 00000000..410a7acd --- /dev/null +++ b/.bingo/Variables.mk @@ -0,0 +1,54 @@ +# Auto generated binary variables helper managed by https://github.com/bwplotka/bingo v0.2.3. DO NOT EDIT. +# All tools are designed to be build inside $GOBIN. +GOPATH ?= $(shell go env GOPATH) +GOBIN ?= $(firstword $(subst :, ,${GOPATH}))/bin +GO ?= $(shell which go) + +# Bellow generated variables ensure that every time a tool under each variable is invoked, the correct version +# will be used; reinstalling only if needed. +# For example for buf variable: +# +# In your main Makefile (for non array binaries): +# +#include .bingo/Variables.mk # Assuming -dir was set to .bingo . +# +#command: $(BUF) +# @echo "Running buf" +# @$(BUF) +# +BUF := $(GOBIN)/buf-v0.20.5 +$(BUF): .bingo/buf.mod + @# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies. + @echo "(re)installing $(GOBIN)/buf-v0.20.5" + @cd .bingo && $(GO) build -mod=mod -modfile=buf.mod -o=$(GOBIN)/buf-v0.20.5 "github.com/bufbuild/buf/cmd/buf" + +GOMPLATE := $(GOBIN)/gomplate-v3.8.0 +$(GOMPLATE): .bingo/gomplate.mod + @# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies. + @echo "(re)installing $(GOBIN)/gomplate-v3.8.0" + @cd .bingo && $(GO) build -mod=mod -modfile=gomplate.mod -o=$(GOBIN)/gomplate-v3.8.0 "github.com/hairyhenderson/gomplate/v3/cmd/gomplate" + +GOVVV := $(GOBIN)/govvv-v0.3.0 +$(GOVVV): .bingo/govvv.mod + @# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies. + @echo "(re)installing $(GOBIN)/govvv-v0.3.0" + @cd .bingo && $(GO) build -mod=mod -modfile=govvv.mod -o=$(GOBIN)/govvv-v0.3.0 "github.com/ahmetb/govvv" + +GOX := $(GOBIN)/gox-v1.0.1 +$(GOX): .bingo/gox.mod + @# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies. + @echo "(re)installing $(GOBIN)/gox-v1.0.1" + @cd .bingo && $(GO) build -mod=mod -modfile=gox.mod -o=$(GOBIN)/gox-v1.0.1 "github.com/mitchellh/gox" + +PROTOC_GEN_BUF_CHECK_BREAKING := $(GOBIN)/protoc-gen-buf-check-breaking-v0.20.5 +$(PROTOC_GEN_BUF_CHECK_BREAKING): .bingo/protoc-gen-buf-check-breaking.mod + @# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies. + @echo "(re)installing $(GOBIN)/protoc-gen-buf-check-breaking-v0.20.5" + @cd .bingo && $(GO) build -mod=mod -modfile=protoc-gen-buf-check-breaking.mod -o=$(GOBIN)/protoc-gen-buf-check-breaking-v0.20.5 "github.com/bufbuild/buf/cmd/protoc-gen-buf-check-breaking" + +PROTOC_GEN_BUF_CHECK_LINT := $(GOBIN)/protoc-gen-buf-check-lint-v0.20.5 +$(PROTOC_GEN_BUF_CHECK_LINT): .bingo/protoc-gen-buf-check-lint.mod + @# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies. + @echo "(re)installing $(GOBIN)/protoc-gen-buf-check-lint-v0.20.5" + @cd .bingo && $(GO) build -mod=mod -modfile=protoc-gen-buf-check-lint.mod -o=$(GOBIN)/protoc-gen-buf-check-lint-v0.20.5 "github.com/bufbuild/buf/cmd/protoc-gen-buf-check-lint" + diff --git a/.bingo/buf.mod b/.bingo/buf.mod new file mode 100644 index 00000000..7e2a9f8a --- /dev/null +++ b/.bingo/buf.mod @@ -0,0 +1,5 @@ +module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT + +go 1.14 + +require github.com/bufbuild/buf v0.20.5 // cmd/buf diff --git a/.bingo/go.mod b/.bingo/go.mod new file mode 100755 index 00000000..79cf7054 --- /dev/null +++ b/.bingo/go.mod @@ -0,0 +1,3 @@ +module _ // Fake go.mod auto-created by 'bingo' for go -moddir compatibility with non-Go projects. Commit this file, together with other .mod files. + +go 1.14 diff --git a/.bingo/gomplate.mod b/.bingo/gomplate.mod new file mode 100644 index 00000000..c458a0a0 --- /dev/null +++ b/.bingo/gomplate.mod @@ -0,0 +1,5 @@ +module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT + +go 1.14 + +require github.com/hairyhenderson/gomplate/v3 v3.8.0 // cmd/gomplate diff --git a/.bingo/govvv.mod b/.bingo/govvv.mod new file mode 100644 index 00000000..b5112d97 --- /dev/null +++ b/.bingo/govvv.mod @@ -0,0 +1,5 @@ +module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT + +go 1.14 + +require github.com/ahmetb/govvv v0.3.0 diff --git a/.bingo/gox.mod b/.bingo/gox.mod new file mode 100644 index 00000000..2afa42a9 --- /dev/null +++ b/.bingo/gox.mod @@ -0,0 +1,5 @@ +module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT + +go 1.14 + +require github.com/mitchellh/gox v1.0.1 diff --git a/.bingo/protoc-gen-buf-check-breaking.mod b/.bingo/protoc-gen-buf-check-breaking.mod new file mode 100644 index 00000000..9fe534cd --- /dev/null +++ b/.bingo/protoc-gen-buf-check-breaking.mod @@ -0,0 +1,5 @@ +module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT + +go 1.14 + +require github.com/bufbuild/buf v0.20.5 // cmd/protoc-gen-buf-check-breaking diff --git a/.bingo/protoc-gen-buf-check-lint.mod b/.bingo/protoc-gen-buf-check-lint.mod new file mode 100644 index 00000000..238d059a --- /dev/null +++ b/.bingo/protoc-gen-buf-check-lint.mod @@ -0,0 +1,5 @@ +module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT + +go 1.14 + +require github.com/bufbuild/buf v0.20.5 // cmd/protoc-gen-buf-check-lint diff --git a/.bingo/variables.env b/.bingo/variables.env new file mode 100644 index 00000000..fd94c07b --- /dev/null +++ b/.bingo/variables.env @@ -0,0 +1,22 @@ +# Auto generated binary variables helper managed by https://github.com/bwplotka/bingo v0.2.3. DO NOT EDIT. +# All tools are designed to be build inside $GOBIN. +# Those variables will work only until 'bingo get' was invoked, or if tools were installed via Makefile's Variables.mk. +local gobin=$(go env GOBIN) + +if [ -z "$gobin" ]; then + gobin="$(go env GOPATH)/bin" +fi + + +BUF="${gobin}/buf-v0.20.5" + +GOMPLATE="${gobin}/gomplate-v3.8.0" + +GOVVV="${gobin}/govvv-v0.3.0" + +GOX="${gobin}/gox-v1.0.1" + +PROTOC_GEN_BUF_CHECK_BREAKING="${gobin}/protoc-gen-buf-check-breaking-v0.20.5" + +PROTOC_GEN_BUF_CHECK_LINT="${gobin}/protoc-gen-buf-check-lint-v0.20.5" + diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index 0d449778..00000000 --- a/.dockerignore +++ /dev/null @@ -1,6 +0,0 @@ -Dockerfile - -.github -dist -.threads* -.env diff --git a/.github/weekly-digest.yml b/.github/weekly-digest.yml deleted file mode 100644 index 51401db8..00000000 --- a/.github/weekly-digest.yml +++ /dev/null @@ -1,6 +0,0 @@ -publishDay: fri -canPublishIssues: true -canPublishPullRequests: true -canPublishContributors: true -canPublishStargazers: true -canPublishCommits: true diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..6decb547 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,35 @@ +name: Build +on: + push: + branches: + - master + pull_request: + branches: + - master +jobs: + buf: + name: Buf + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v1 + with: + ref: master + - name: checkout-master + run: git checkout master + - name: checkout + uses: actions/checkout@v1 + - name: make local + run: make buf-local + threadsd: + name: Threads Daemon + runs-on: ubuntu-latest + steps: + - name: setup + uses: actions/setup-go@v1 + with: + go-version: 1.16 + - name: checkout + uses: actions/checkout@v1 + - name: build + run: make build-threadsd diff --git a/.github/workflows/publish-grpc-libs.yml b/.github/workflows/publish-grpc-libs.yml deleted file mode 100644 index 51ddedf1..00000000 --- a/.github/workflows/publish-grpc-libs.yml +++ /dev/null @@ -1,90 +0,0 @@ -name: Publish gRPC Libs -on: - release: - types: [published] -jobs: - - publish_grpc_libs: - name: Publish gRPC Libs - runs-on: ubuntu-latest - container: - image: google/dart:latest - steps: - - name: Check out code - uses: actions/checkout@v1 - - name: Get latest tag - id: latesttag - uses: "WyriHaximus/github-action-get-previous-tag@master" - env: - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - - name: Install build tools - run: | - apt-get update && apt-get install -y build-essential - - name: Set up Go - uses: actions/setup-go@v1 - with: - go-version: 1.15 - - name: Setup env - env: - ACTIONS_ALLOW_UNSECURE_COMMANDS: true - run: | - echo "::set-env name=GOPATH::$(go env GOPATH)" - echo "::add-path::$(go env GOPATH)/bin" - - name: Set up Node - uses: actions/setup-node@v1 - with: - node-version: '12.x' - registry-url: 'https://registry.npmjs.org' - - name: Install protoc - uses: arduino/setup-protoc@master - with: - version: '3.11.2' - - name: Install Go protoc plugins - run: | - export GO111MODULE=off - go get github.com/golang/protobuf/protoc-gen-go - - name: Get JS dependencies - run: | - cd api/pb/javascript && npm install - cd ../../../net/api/pb/javascript && npm install - npm install -g json - npm install -g yaml-cli - - name: Get Dart dependencies - run: | - cd api/pb/dart - pub get - pub global activate protoc_plugin - - name: Protoc generate API - run: | - cd api/pb - make clean && make - - name: Protoc generate Service - run: | - cd net/api/pb - make clean && make - - name: Publish JS API - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} - run: | - cd api/pb/javascript - json -I -f package.json -e 'this.version=("${{ steps.latesttag.outputs.tag }}").replace("v", "")' - npm publish --access=public - - name: Publish JS Service - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} - run: | - cd net/api/pb/javascript - json -I -f package.json -e 'this.version=("${{ steps.latesttag.outputs.tag }}").replace("v", "")' - npm publish --access=public - - name: Publish Dart API - env: - PUB_CREDENTIALS: ${{ secrets.PUB_CREDENTIALS }} - run: | - sed -e "s/api\/pb\/dart\/lib//g" -i.replace .gitignore - cd api/pb/dart - yaml json read ../javascript/package.json > package.yml - yaml set pubspec.yaml version $(yaml get package.yml version) > tmp.yml - mv tmp.yml pubspec.yaml - rm package.yml - echo "$PUB_CREDENTIALS" > ~/.pub-cache/credentials.json - pub publish -f diff --git a/.github/workflows/publish-js-libs.yml b/.github/workflows/publish-js-libs.yml new file mode 100644 index 00000000..30ac0ad2 --- /dev/null +++ b/.github/workflows/publish-js-libs.yml @@ -0,0 +1,36 @@ +name: Publish JS Libs +on: + release: + types: [published] +jobs: + publish-js-libs: + name: Publish JS libs + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v1 + - name: Install build tools + run: | + sudo apt-get update + sudo apt-get install -y build-essential + - name: Set up Go + uses: actions/setup-go@v1 + with: + go-version: 1.16 + - name: Setup env + env: + ACTIONS_ALLOW_UNSECURE_COMMANDS: true + run: | + echo "::set-env name=GOPATH::$(go env GOPATH)" + echo "::add-path::$(go env GOPATH)/bin" + - name: Set up Node + uses: actions/setup-node@v1 + with: + node-version: "14.x" + registry-url: "https://registry.npmjs.org" + - name: Generate JS libs + run: | + make js-protos + - name: Publish JS libs + run: | + ./scripts/publish_js_protos.bash -v ${{ github.event.release.tag_name }} -t ${{ secrets.NPM_AUTH_TOKEN }} -p ${{ github.event.release.prerelease }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c17f5c22..ed66fed7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,7 +10,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v1 with: - go-version: 1.15 + go-version: 1.16 - name: Check out code uses: actions/checkout@v1 - name: Cache dependencies @@ -26,40 +26,12 @@ jobs: run: | export PATH=${PATH}:`go env GOPATH`/bin go get -v -t -d ./... - - name: Install gox + - name: Build release artifacts run: | - export PATH=${PATH}:`go env GOPATH`/bin - go get github.com/mitchellh/gox - - name: Compile - run: | - export PATH=${PATH}:`go env GOPATH`/bin - gox -osarch="linux/amd64 linux/386 linux/arm darwin/amd64 windows/amd64" -output="threadsd-{{.OS}}-{{.Arch}}" ./threadsd - - name: Collect artifacts - run: | - VERSION=${GITHUB_REF##*/} - OUT=release - mkdir -p ${OUT} - rm threadsd/main.go - cp LICENSE threadsd/ - cp dist/README.md threadsd/ - cp dist/install threadsd/ - declare -a arr=("darwin-amd64" "windows-amd64.exe" "linux-amd64" "linux-386" "linux-arm") - for i in "${arr[@]}" - do - OSARCH=${i%.*} - EXT=$([[ "$i" = *.* ]] && echo ".${i##*.}" || echo '') - cp threadsd-${i} threadsd/threadsd${EXT} - if [ "${EXT}" == ".exe" ]; then - zip -r threadsd_${VERSION}_${OSARCH}.zip threadsd - mv threadsd_${VERSION}_${OSARCH}.zip ${OUT}/ - else - tar -czvf threadsd_${VERSION}_${OSARCH}.tar.gz threadsd - mv threadsd_${VERSION}_${OSARCH}.tar.gz ${OUT}/ - fi - done - echo $(ls ./release) - - name: Upload assets to release + BIN_VERSION=${{ github.event.release.tag_name }} make build-releases + echo $(ls ./build/dist/) + - name: Upload multiple assets to release uses: AButler/upload-release-assets@v2.0 with: - files: 'release/threadsd_*' + files: "build/dist/*" repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 962f47ea..76f09579 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: Tests +name: Test on: push: branches: @@ -15,7 +15,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v1 with: - go-version: 1.15 + go-version: 1.16 - name: Check out code uses: actions/checkout@v1 - name: Cache dependencies @@ -33,14 +33,14 @@ jobs: - name: Test run: SKIP_FOLDERSYNC=true go test -race ./... - test-foldersync: - name: Foldersync Test + test-sync: + name: Sync Test runs-on: ubuntu-latest steps: - name: Set up Go uses: actions/setup-go@v1 with: - go-version: 1.15 + go-version: 1.16 - name: Check out code uses: actions/checkout@v1 - name: Cache dependencies @@ -56,4 +56,4 @@ jobs: run: | go get -v -t -d ./... - name: Test - run: go test ./integrationtests/foldersync/ + run: go test -race ./integrationtests/foldersync/ diff --git a/.gitignore b/.gitignore index 3e23452a..ea125579 100644 --- a/.gitignore +++ b/.gitignore @@ -14,25 +14,17 @@ # Dependency directories (remove the comment below to include it) vendor/ -# JS PB files -*.js -*.d.ts +# JS +node_modules/ -# Dart PB Files -api/pb/dart/.dart_tool -api/pb/dart/.packages -api/pb/dart/lib - -# vscode config folder -.vscode/ +# IDEs .idea/ +.vscode/ -**/node_modules -tags - -# Misc -**.DS_Store - -# Other -.threads*/ +# Project .env +buildtools/protoc +buildtools/protoc-gen-go +build/ +**/javascript/api +**/javascript/net diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index ab44d00e..00000000 --- a/Dockerfile +++ /dev/null @@ -1,74 +0,0 @@ -FROM golang:1.15.5-buster -MAINTAINER Textile - -# This is (in large part) copied (with love) from -# https://hub.docker.com/r/ipfs/go-ipfs/dockerfile - -# Get source -ENV SRC_DIR /go-threads - -# Download packages first so they can be cached. -COPY go.mod go.sum $SRC_DIR/ -RUN cd $SRC_DIR \ - && go mod download - -COPY . $SRC_DIR - -# Install the daemon -RUN cd $SRC_DIR \ - && go install github.com/textileio/go-threads/threadsd - -# Get su-exec, a very minimal tool for dropping privileges, -# and tini, a very minimal init daemon for containers -ENV SUEXEC_VERSION v0.2 -ENV TINI_VERSION v0.16.1 -RUN set -x \ - && cd /tmp \ - && git clone https://github.com/ncopa/su-exec.git \ - && cd su-exec \ - && git checkout -q $SUEXEC_VERSION \ - && make \ - && cd /tmp \ - && wget -q -O tini https://github.com/krallin/tini/releases/download/$TINI_VERSION/tini \ - && chmod +x tini - -# Get the TLS CA certificates, they're not provided by busybox. -RUN apt-get update && apt-get install -y ca-certificates - -# Now comes the actual target image, which aims to be as small as possible. -FROM busybox:1.31.0-glibc -LABEL maintainer="Textile " - -# Get the threads binary, entrypoint script, and TLS CAs from the build container. -ENV SRC_DIR /go-threads -COPY --from=0 /go/bin/threadsd /usr/local/bin/threadsd -COPY --from=0 /tmp/su-exec/su-exec /sbin/su-exec -COPY --from=0 /tmp/tini /sbin/tini -COPY --from=0 /etc/ssl/certs /etc/ssl/certs - -# This shared lib (part of glibc) doesn't seem to be included with busybox. -COPY --from=0 /lib/x86_64-linux-gnu/libdl.so.2 /lib/libdl.so.2 - -# hostAddr; should be exposed to the public -EXPOSE 4006 -# apiAddr; should *not* be exposed to the public unless intercepted by an auth system, e.g., textile -EXPOSE 6006 -# apiProxyAddr; should *not* be exposed to the public unless intercepted by an auth system, e.g., textile -EXPOSE 6007 - -# Create the repo directory and switch to a non-privileged user. -ENV THREADS_PATH /data/threads -RUN mkdir -p $THREADS_PATH \ - && adduser -D -h $THREADS_PATH -u 1000 -G users textile \ - && chown -R textile:users $THREADS_PATH - -# Switch to a non-privileged user -USER textile - -# Expose the repo as a volume. -# Important this happens after the USER directive so permission are correct. -VOLUME $THREADS_PATH - -ENTRYPOINT ["/sbin/tini", "--", "threadsd"] - -CMD ["--repo=/data/threads"] diff --git a/LICENSE b/LICENSE index 2daaf30e..73853f11 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2018-2020 Textile +Copyright (c) 2018-2021 textile.io Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/Makefile b/Makefile index b8af3863..9913e021 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,107 @@ -threaddb-up: - docker-compose -f docker-compose-dev.yml up --build +include .bingo/Variables.mk -threaddb-stop: - docker-compose -f docker-compose-dev.yml stop +.DEFAULT_GOAL=build -threaddb-clean: - docker-compose -f docker-compose-dev.yml down -v --remove-orphans +BIN_BUILD_FLAGS?=CGO_ENABLED=0 +BIN_VERSION?="git" +GOVVV_FLAGS=$(shell $(GOVVV) -flags -version $(BIN_VERSION) -pkg $(shell go list ./buildinfo)) + +build: $(GOVVV) + $(BIN_BUILD_FLAGS) go build -ldflags="${GOVVV_FLAGS}" ./... +.PHONY: build + +build-threadsd: $(GOVVV) + $(BIN_BUILD_FLAGS) go build -ldflags="${GOVVV_FLAGS}" ./cmd/threadsd +.PHONY: build-threadsd + +install: $(GOVVV) + $(BIN_BUILD_FLAGS) go install -ldflags="${GOVVV_FLAGS}" ./... +.PHONY: install + +install-threadsd: $(GOVVV) + $(BIN_BUILD_FLAGS) go install -ldflags="${GOVVV_FLAGS}" ./cmd/threadsd +.PHONY: install-threadsd + +define gen_release_files + $(GOX) -osarch=$(3) -output="build/$(2)/$(2)_${BIN_VERSION}_{{.OS}}-{{.Arch}}/$(2)" -ldflags="${GOVVV_FLAGS}" $(1) + mkdir -p build/dist; \ + cd build/$(2); \ + for release in *; do \ + cp ../../LICENSE ../../README.md $${release}/; \ + if [ $${release} != *"windows"* ]; then \ + BIN_FILE=$(2) $(GOMPLATE) -f ../../dist/install.tmpl -o "$${release}/install"; \ + tar -czvf ../dist/$${release}.tar.gz $${release}; \ + else \ + zip -r ../dist/$${release}.zip $${release}; \ + fi; \ + done +endef + +build-threadsd-release: $(GOX) $(GOVVV) $(GOMPLATE) + $(call gen_release_files,./cmd/threadsd,threadsd,"linux/amd64 linux/386 linux/arm darwin/amd64 windows/amd64") +.PHONY: build-threadsd-release + +build-releases: build-threadsd-release +.PHONY: build-releases + +threads-up: + docker-compose -f cmd/threadsd/docker-compose-dev.yml up --build + +threads-stop: + docker-compose -f cmd/threadsd/docker-compose-dev.yml stop + +threads-clean: + docker-compose -f cmd/threadsd/docker-compose-dev.yml down -v --remove-orphans test: - go test -race -timeout 45m ./... -.PHONY: test \ No newline at end of file + go test -race -timeout 30m ./... +.PHONY: test + +clean-protos: + find . -type f ! -path './net/pb/*' -name '*.pb.go' -delete + find . -type f ! -path './net/pb/*' -name '*pb_test.go' -delete +.PHONY: clean-protos + +clean-js-protos: + find . -type f -name '*pb.js' ! -path "*/node_modules/*" -delete + find . -type f -name '*pb.d.ts' ! -path "*/node_modules/*" -delete + find . -type f -name '*pb_service.js' ! -path "*/node_modules/*" -delete + find . -type f -name '*pb_service.d.ts' ! -path "*/node_modules/*" -delete +.PHONY: clean-js-protos + +install-protoc: + cd buildtools && ./install_protoc.bash + +PROTOCGENGO=$(shell pwd)/buildtools/protoc-gen-go +protos: install-protoc clean-protos + PATH=$(PROTOCGENGO):$(PATH) ./scripts/protoc_gen_plugin.bash \ + --proto_path=. \ + --plugin_name=go \ + --plugin_out=. \ + --plugin_opt=plugins=grpc,paths=source_relative +.PHONY: protos + +js-protos: install-protoc clean-js-protos + ./scripts/gen_js_protos.bash + +# local is what we run when testing locally. +# This does breaking change detection against our local git repository. +.PHONY: buf-local +buf-local: $(BUF) + $(BUF) check lint + # $(BUF) check breaking --against-input '.git#branch=master' + +# https is what we run when testing in most CI providers. +# This does breaking change detection against our remote HTTPS git repository. +.PHONY: buf-https +buf-https: $(BUF) + $(BUF) check lint + # $(BUF) check breaking --against-input "$(HTTPS_GIT)#branch=master" + +# ssh is what we run when testing in CI providers that provide ssh public key authentication. +# This does breaking change detection against our remote HTTPS ssh repository. +# This is especially useful for private repositories. +.PHONY: buf-ssh +buf-ssh: $(BUF) + $(BUF) check lint + # $(BUF) check breaking --against-input "$(SSH_GIT)#branch=master" diff --git a/README.md b/README.md index 117e59ae..1dc7df62 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [![Chat on Slack](https://img.shields.io/badge/slack-slack.textile.io-informational.svg?style=popout-square)](https://slack.textile.io) [![GitHub license](https://img.shields.io/github/license/textileio/go-threads.svg?style=popout-square)](./LICENSE) [![Go Report Card](https://goreportcard.com/badge/github.com/textileio/go-threads?style=flat-square)](https://goreportcard.com/report/github.com/textileio/go-threads?style=flat-square) -[![GitHub action](https://github.com/textileio/go-threads/workflows/Tests/badge.svg?style=popout-square)](https://github.com/textileio/go-threads/actions) +[![GitHub action](https://github.com/textileio/go-threads/workflows/Test/badge.svg?style=popout-square)](https://github.com/textileio/go-threads/actions) [![standard-readme compliant](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg?style=popout-square)](https://github.com/RichardLitt/standard-readme) > Server-less p2p database built on libp2p @@ -13,7 +13,6 @@ Join us on our [public Slack channel](https://slack.textile.io/) for news, discu ## Table of Contents -* [Table of Contents](#table-of-contents) * [Security](#security) * [Background](#background) * [Install](#install) @@ -94,17 +93,16 @@ import "github.com/textileio/go-threads/api/client" ## Getting Started -You can think of the [DB client](github.com/textileio/go-threads/api/client) as a gRPC client wrapper around the internal `db` package API, and the [Network client](github.com/textileio/go-threads/net/api/client) as a gRPC client wrapper around the internal `net` package API. This section will only focus on getting started with the gRPC clients, but Golang apps may choose to interact directly with `db` and/or `net`. +You can think of the [DB client](http://github.com/textileio/go-threads/blob/master/api/client) as a gRPC client wrapper around the internal `db` package API, and the [Network client](https://github.com/textileio/go-threads/blob/master/net/api/client) as a gRPC client wrapper around the internal `net` package API. This section will only focus on getting started with the gRPC clients, but Golang apps may choose to interact directly with `db` and/or `net`. ### Running ThreadDB -The `threadsd` daemon can be run as a server or alongside desktop apps or command-line tools. The easiest way to run `threadsd` is by using the provided Docker Compose files. If you're new to Docker and/or Docker Compose, get started [here](https://docs.docker.com/compose/gettingstarted/). Once you are setup, you should have `docker-compose` in your `PATH`. +The `threadsd` daemon can be run as a server or alongside desktop apps or command-line tools. The easiest way to run `threadsd` is by using the provided Docker Compose files. If you're new to Docker and/or Docker Compose, get started [here](https://docs.docker.com/compose/gettingstarted/). You should have `docker-compose` in your `PATH`. Create an `.env` file and add the following values: ``` -REPO_PATH=~/myrepo -THRDS_DEBUG=true +THREADS_DEBUG=true ``` Copy [this compose file](https://github.com/textileio/go-threads/blob/master/docker-compose.yml) and run it with the following command. @@ -565,7 +563,7 @@ err := net.PullThread(context.Background(), info.ID) #### Listening for new records -We can listen for new thread records across all or a subset of known threads. +We can listen for new thread records across all, or a subset of known threads. ``` ctx, cancel := context.WithCancel(context.Background()) diff --git a/api/client/client.go b/api/client/client.go index 8cf03aec..6e34229c 100644 --- a/api/client/client.go +++ b/api/client/client.go @@ -5,12 +5,12 @@ import ( "encoding/json" "errors" "fmt" - "io" "reflect" "github.com/alecthomas/jsonschema" ma "github.com/multiformats/go-multiaddr" pb "github.com/textileio/go-threads/api/pb" + "github.com/textileio/go-threads/core/did" "github.com/textileio/go-threads/core/thread" "github.com/textileio/go-threads/db" "google.golang.org/grpc" @@ -67,7 +67,7 @@ type ListenEvent struct { // Client provides the client api. type Client struct { - c pb.APIClient + c pb.APIServiceClient conn *grpc.ClientConn } @@ -81,7 +81,7 @@ func NewClient(target string, opts ...grpc.DialOption) (*Client, error) { return nil, err } return &Client{ - c: pb.NewAPIClient(conn), + c: pb.NewAPIServiceClient(conn), conn: conn, }, nil } @@ -91,68 +91,6 @@ func (c *Client) Close() error { return c.conn.Close() } -// GetToken gets a db token for use with the rest of the API. -func (c *Client) GetToken(ctx context.Context, identity thread.Identity) (tok thread.Token, err error) { - stream, err := c.c.GetToken(ctx) - if err != nil { - return - } - defer func() { - if e := stream.CloseSend(); e != nil && err == nil { - err = e - } - }() - if err = stream.Send(&pb.GetTokenRequest{ - Payload: &pb.GetTokenRequest_Key{ - Key: identity.GetPublic().String(), - }, - }); err == io.EOF { - var noOp interface{} - return tok, stream.RecvMsg(noOp) - } else if err != nil { - return - } - - rep, err := stream.Recv() - if err != nil { - return - } - var challenge []byte - switch payload := rep.Payload.(type) { - case *pb.GetTokenReply_Challenge: - challenge = payload.Challenge - default: - return tok, fmt.Errorf("challenge was not received") - } - - sig, err := identity.Sign(ctx, challenge) - if err != nil { - return - } - if err = stream.Send(&pb.GetTokenRequest{ - Payload: &pb.GetTokenRequest_Signature{ - Signature: sig, - }, - }); err == io.EOF { - var noOp interface{} - return tok, stream.RecvMsg(noOp) - } else if err != nil { - return - } - - rep, err = stream.Recv() - if err != nil { - return - } - switch payload := rep.Payload.(type) { - case *pb.GetTokenReply_Token: - tok = thread.Token(payload.Token) - default: - return tok, fmt.Errorf("token was not received") - } - return tok, nil -} - // NewDB creates a new DB with ID. func (c *Client) NewDB(ctx context.Context, dbID thread.ID, opts ...db.NewManagedOption) error { args := &db.NewManagedOptions{} @@ -175,7 +113,7 @@ func (c *Client) NewDB(ctx context.Context, dbID thread.ID, opts ...db.NewManage return err } } - ctx = thread.NewTokenContext(ctx, args.Token) + ctx = did.NewTokenContext(ctx, args.Token) _, err := c.c.NewDB(ctx, &pb.NewDBRequest{ DbID: dbID.Bytes(), Key: args.Key.Bytes(), @@ -208,7 +146,7 @@ func (c *Client) NewDBFromAddr(ctx context.Context, dbAddr ma.Multiaddr, dbKey t return err } } - ctx = thread.NewTokenContext(ctx, args.Token) + ctx = did.NewTokenContext(ctx, args.Token) _, err := c.c.NewDBFromAddr(ctx, &pb.NewDBFromAddrRequest{ Addr: dbAddr.Bytes(), Key: dbKey.Bytes(), @@ -247,7 +185,7 @@ func (c *Client) ListDBs(ctx context.Context, opts ...db.ManagedOption) (map[thr for _, opt := range opts { opt(args) } - ctx = thread.NewTokenContext(ctx, args.Token) + ctx = did.NewTokenContext(ctx, args.Token) res, err := c.c.ListDBs(ctx, &pb.ListDBsRequest{}) if err != nil { return nil, err @@ -274,7 +212,7 @@ func (c *Client) GetDBInfo(ctx context.Context, dbID thread.ID, opts ...db.Manag for _, opt := range opts { opt(args) } - ctx = thread.NewTokenContext(ctx, args.Token) + ctx = did.NewTokenContext(ctx, args.Token) res, err := c.c.GetDBInfo(ctx, &pb.GetDBInfoRequest{ DbID: dbID.Bytes(), }) @@ -306,7 +244,7 @@ func (c *Client) DeleteDB(ctx context.Context, dbID thread.ID, opts ...db.Manage for _, opt := range opts { opt(args) } - ctx = thread.NewTokenContext(ctx, args.Token) + ctx = did.NewTokenContext(ctx, args.Token) _, err := c.c.DeleteDB(ctx, &pb.DeleteDBRequest{ DbID: dbID.Bytes(), }) @@ -323,6 +261,7 @@ func (c *Client) NewCollection(ctx context.Context, dbID thread.ID, config db.Co if err != nil { return err } + ctx = did.NewTokenContext(ctx, args.Token) _, err = c.c.NewCollection(ctx, &pb.NewCollectionRequest{ DbID: dbID.Bytes(), Config: cc, @@ -340,6 +279,7 @@ func (c *Client) UpdateCollection(ctx context.Context, dbID thread.ID, config db if err != nil { return err } + ctx = did.NewTokenContext(ctx, args.Token) _, err = c.c.UpdateCollection(ctx, &pb.UpdateCollectionRequest{ DbID: dbID.Bytes(), Config: cc, @@ -353,6 +293,7 @@ func (c *Client) DeleteCollection(ctx context.Context, dbID thread.ID, name stri for _, opt := range opts { opt(args) } + ctx = did.NewTokenContext(ctx, args.Token) _, err := c.c.DeleteCollection(ctx, &pb.DeleteCollectionRequest{ DbID: dbID.Bytes(), Name: name, @@ -366,6 +307,7 @@ func (c *Client) GetCollectionInfo(ctx context.Context, dbID thread.ID, name str for _, opt := range opts { opt(args) } + ctx = did.NewTokenContext(ctx, args.Token) resp, err := c.c.GetCollectionInfo(ctx, &pb.GetCollectionInfoRequest{ DbID: dbID.Bytes(), Name: name, @@ -405,6 +347,7 @@ func (c *Client) GetCollectionIndexes(ctx context.Context, dbID thread.ID, name for _, opt := range opts { opt(args) } + ctx = did.NewTokenContext(ctx, args.Token) resp, err := c.c.GetCollectionIndexes(ctx, &pb.GetCollectionIndexesRequest{ DbID: dbID.Bytes(), Name: name, @@ -421,6 +364,7 @@ func (c *Client) ListCollections(ctx context.Context, dbID thread.ID, opts ...db for _, opt := range opts { opt(args) } + ctx = did.NewTokenContext(ctx, args.Token) resp, err := c.c.ListCollections(ctx, &pb.ListCollectionsRequest{ DbID: dbID.Bytes(), }) @@ -455,7 +399,7 @@ func (c *Client) Create(ctx context.Context, dbID thread.ID, collectionName stri if err != nil { return nil, err } - ctx = thread.NewTokenContext(ctx, args.Token) + ctx = did.NewTokenContext(ctx, args.Token) resp, err := c.c.Create(ctx, &pb.CreateRequest{ DbID: dbID.Bytes(), CollectionName: collectionName, @@ -477,7 +421,7 @@ func (c *Client) Verify(ctx context.Context, dbID thread.ID, collectionName stri if err != nil { return err } - ctx = thread.NewTokenContext(ctx, args.Token) + ctx = did.NewTokenContext(ctx, args.Token) _, err = c.c.Verify(ctx, &pb.VerifyRequest{ DbID: dbID.Bytes(), CollectionName: collectionName, @@ -496,7 +440,7 @@ func (c *Client) Save(ctx context.Context, dbID thread.ID, collectionName string if err != nil { return err } - ctx = thread.NewTokenContext(ctx, args.Token) + ctx = did.NewTokenContext(ctx, args.Token) _, err = c.c.Save(ctx, &pb.SaveRequest{ DbID: dbID.Bytes(), CollectionName: collectionName, @@ -511,7 +455,7 @@ func (c *Client) Delete(ctx context.Context, dbID thread.ID, collectionName stri for _, opt := range opts { opt(args) } - ctx = thread.NewTokenContext(ctx, args.Token) + ctx = did.NewTokenContext(ctx, args.Token) _, err := c.c.Delete(ctx, &pb.DeleteRequest{ DbID: dbID.Bytes(), CollectionName: collectionName, @@ -526,7 +470,7 @@ func (c *Client) Has(ctx context.Context, dbID thread.ID, collectionName string, for _, opt := range opts { opt(args) } - ctx = thread.NewTokenContext(ctx, args.Token) + ctx = did.NewTokenContext(ctx, args.Token) resp, err := c.c.Has(ctx, &pb.HasRequest{ DbID: dbID.Bytes(), CollectionName: collectionName, @@ -548,7 +492,7 @@ func (c *Client) Find(ctx context.Context, dbID thread.ID, collectionName string if err != nil { return nil, err } - ctx = thread.NewTokenContext(ctx, args.Token) + ctx = did.NewTokenContext(ctx, args.Token) resp, err := c.c.Find(ctx, &pb.FindRequest{ DbID: dbID.Bytes(), CollectionName: collectionName, @@ -566,7 +510,7 @@ func (c *Client) FindByID(ctx context.Context, dbID thread.ID, collectionName, i for _, opt := range opts { opt(args) } - ctx = thread.NewTokenContext(ctx, args.Token) + ctx = did.NewTokenContext(ctx, args.Token) resp, err := c.c.FindByID(ctx, &pb.FindByIDRequest{ DbID: dbID.Bytes(), CollectionName: collectionName, @@ -584,7 +528,7 @@ func (c *Client) ReadTransaction(ctx context.Context, dbID thread.ID, collection for _, opt := range opts { opt(args) } - ctx = thread.NewTokenContext(ctx, args.Token) + ctx = did.NewTokenContext(ctx, args.Token) client, err := c.c.ReadTransaction(ctx) if err != nil { return nil, err @@ -602,7 +546,7 @@ func (c *Client) WriteTransaction(ctx context.Context, dbID thread.ID, collectio for _, opt := range opts { opt(args) } - ctx = thread.NewTokenContext(ctx, args.Token) + ctx = did.NewTokenContext(ctx, args.Token) client, err := c.c.WriteTransaction(ctx) if err != nil { return nil, err @@ -642,7 +586,7 @@ func (c *Client) Listen(ctx context.Context, dbID thread.ID, listenOptions []Lis Action: action, } } - ctx = thread.NewTokenContext(ctx, args.Token) + ctx = did.NewTokenContext(ctx, args.Token) stream, err := c.c.Listen(ctx, &pb.ListenRequest{ DbID: dbID.Bytes(), Filters: filters, diff --git a/api/client/client_test.go b/api/client/client_test.go index 671229c8..1105fadd 100644 --- a/api/client/client_test.go +++ b/api/client/client_test.go @@ -3,7 +3,6 @@ package client_test import ( "bytes" "context" - crand "crypto/rand" "encoding/json" "errors" "fmt" @@ -16,7 +15,6 @@ import ( "testing" "time" - "github.com/libp2p/go-libp2p-core/crypto" ma "github.com/multiformats/go-multiaddr" "github.com/phayes/freeport" mongods "github.com/textileio/go-ds-mongo" @@ -27,6 +25,7 @@ import ( "github.com/textileio/go-threads/common" "github.com/textileio/go-threads/core/thread" "github.com/textileio/go-threads/db" + dutil "github.com/textileio/go-threads/db/util" "github.com/textileio/go-threads/util" "google.golang.org/grpc" ) @@ -38,24 +37,6 @@ func TestMain(m *testing.M) { os.Exit(exitVal) } -func TestClient_GetToken(t *testing.T) { - t.Parallel() - client, done := setup(t) - defer done() - - identity := createIdentity(t) - - t.Run("test get token", func(t *testing.T) { - tok, err := client.GetToken(context.Background(), identity) - if err != nil { - t.Fatalf("failed to get token: %v", err) - } - if tok == "" { - t.Fatal("emtpy token") - } - }) -} - func TestClient_NewDB(t *testing.T) { t.Parallel() client, done := setup(t) @@ -64,7 +45,7 @@ func TestClient_NewDB(t *testing.T) { t.Run("test new db with missing read key", func(t *testing.T) { if err := client.NewDB( context.Background(), - thread.NewIDV1(thread.Raw, 32), + thread.NewRandomIDV1(), db.WithNewManagedKey(thread.NewRandomServiceKey()), ); err == nil || !strings.Contains(err.Error(), db.ErrThreadReadKeyRequired.Error()) { t.Fatal("new db without read key should fail") @@ -72,7 +53,7 @@ func TestClient_NewDB(t *testing.T) { }) t.Run("test new db", func(t *testing.T) { - if err := client.NewDB(context.Background(), thread.NewIDV1(thread.Raw, 32)); err != nil { + if err := client.NewDB(context.Background(), thread.NewRandomIDV1()); err != nil { t.Fatalf("failed to create new db: %v", err) } }) @@ -85,7 +66,7 @@ func TestClient_NewDBFromAddr(t *testing.T) { client2, done2 := setup(t) defer done2() - id := thread.NewIDV1(thread.Raw, 32) + id := thread.NewRandomIDV1() err := client1.NewDB(context.Background(), id) checkErr(t, err) info, err := client1.GetDBInfo(context.Background(), id) @@ -114,11 +95,11 @@ func TestClient_ListDBs(t *testing.T) { defer done() t.Run("test list dbs", func(t *testing.T) { - id1 := thread.NewIDV1(thread.Raw, 32) + id1 := thread.NewRandomIDV1() name1 := "db1" err := client.NewDB(context.Background(), id1, db.WithNewManagedName(name1)) checkErr(t, err) - id2 := thread.NewIDV1(thread.Raw, 32) + id2 := thread.NewRandomIDV1() name2 := "db2" err = client.NewDB(context.Background(), id2, db.WithNewManagedName(name2)) checkErr(t, err) @@ -145,7 +126,7 @@ func TestClient_GetDBInfo(t *testing.T) { defer done() t.Run("test get db info", func(t *testing.T) { - id := thread.NewIDV1(thread.Raw, 32) + id := thread.NewRandomIDV1() err := client.NewDB(context.Background(), id) checkErr(t, err) @@ -168,7 +149,7 @@ func TestClient_DeleteDB(t *testing.T) { defer done() t.Run("test delete db", func(t *testing.T) { - id := thread.NewIDV1(thread.Raw, 32) + id := thread.NewRandomIDV1() err := client.NewDB(context.Background(), id) checkErr(t, err) @@ -187,13 +168,13 @@ func TestClient_NewCollection(t *testing.T) { defer done() t.Run("test new collection", func(t *testing.T) { - id := thread.NewIDV1(thread.Raw, 32) + id := thread.NewRandomIDV1() err := client.NewDB(context.Background(), id) checkErr(t, err) err = client.NewCollection( context.Background(), id, - db.CollectionConfig{Name: collectionName, Schema: util.SchemaFromSchemaString(schema)}, + db.CollectionConfig{Name: collectionName, Schema: dutil.SchemaFromSchemaString(schema)}, ) if err != nil { t.Fatalf("failed to add new collection: %v", err) @@ -206,20 +187,20 @@ func TestClient_UpdateCollection(t *testing.T) { client, done := setup(t) defer done() - id := thread.NewIDV1(thread.Raw, 32) + id := thread.NewRandomIDV1() err := client.NewDB(context.Background(), id) checkErr(t, err) err = client.NewCollection( context.Background(), id, - db.CollectionConfig{Name: collectionName, Schema: util.SchemaFromSchemaString(schema)}, + db.CollectionConfig{Name: collectionName, Schema: dutil.SchemaFromSchemaString(schema)}, ) checkErr(t, err) t.Run("test update collection", func(t *testing.T) { err = client.UpdateCollection(context.Background(), id, db.CollectionConfig{ Name: collectionName, - Schema: util.SchemaFromSchemaString(schema2), + Schema: dutil.SchemaFromSchemaString(schema2), Indexes: []db.Index{{ Path: "age", Unique: false, @@ -239,13 +220,13 @@ func TestClient_DeleteCollection(t *testing.T) { defer done() t.Run("test delete collection", func(t *testing.T) { - id := thread.NewIDV1(thread.Raw, 32) + id := thread.NewRandomIDV1() err := client.NewDB(context.Background(), id) checkErr(t, err) err = client.NewCollection( context.Background(), id, - db.CollectionConfig{Name: collectionName, Schema: util.SchemaFromSchemaString(schema)}, + db.CollectionConfig{Name: collectionName, Schema: dutil.SchemaFromSchemaString(schema)}, ) checkErr(t, err) @@ -266,10 +247,10 @@ func TestClient_GetCollectionInfo(t *testing.T) { defer done() t.Run("test get collection info", func(t *testing.T) { - id := thread.NewIDV1(thread.Raw, 32) + id := thread.NewRandomIDV1() err := client.NewDB(context.Background(), id) checkErr(t, err) - jschema := util.SchemaFromSchemaString(schema) + jschema := dutil.SchemaFromSchemaString(schema) err = client.NewCollection(context.Background(), id, db.CollectionConfig{ Name: collectionName, Schema: jschema, @@ -303,12 +284,12 @@ func TestClient_GetCollectionIndexes(t *testing.T) { defer done() t.Run("test get collection indexes", func(t *testing.T) { - id := thread.NewIDV1(thread.Raw, 32) + id := thread.NewRandomIDV1() err := client.NewDB(context.Background(), id) checkErr(t, err) err = client.NewCollection(context.Background(), id, db.CollectionConfig{ Name: collectionName, - Schema: util.SchemaFromSchemaString(schema), + Schema: dutil.SchemaFromSchemaString(schema), Indexes: []db.Index{{ Path: "lastName", Unique: true, @@ -329,10 +310,10 @@ func TestClient_ListCollections(t *testing.T) { defer done() t.Run("test list collection info", func(t *testing.T) { - id := thread.NewIDV1(thread.Raw, 32) + id := thread.NewRandomIDV1() err := client.NewDB(context.Background(), id) checkErr(t, err) - jschema := util.SchemaFromSchemaString(schema) + jschema := dutil.SchemaFromSchemaString(schema) err = client.NewCollection(context.Background(), id, db.CollectionConfig{ Name: collectionName, Schema: jschema, @@ -365,13 +346,13 @@ func TestClient_Create(t *testing.T) { defer done() t.Run("test collection create", func(t *testing.T) { - id := thread.NewIDV1(thread.Raw, 32) + id := thread.NewRandomIDV1() err := client.NewDB(context.Background(), id) checkErr(t, err) err = client.NewCollection( context.Background(), id, - db.CollectionConfig{Name: collectionName, Schema: util.SchemaFromSchemaString(schema)}, + db.CollectionConfig{Name: collectionName, Schema: dutil.SchemaFromSchemaString(schema)}, ) checkErr(t, err) @@ -382,13 +363,13 @@ func TestClient_Create(t *testing.T) { }) t.Run("test collection create with missing id", func(t *testing.T) { - id := thread.NewIDV1(thread.Raw, 32) + id := thread.NewRandomIDV1() err := client.NewDB(context.Background(), id) checkErr(t, err) err = client.NewCollection( context.Background(), id, - db.CollectionConfig{Name: collectionName, Schema: util.SchemaFromSchemaString(schema)}, + db.CollectionConfig{Name: collectionName, Schema: dutil.SchemaFromSchemaString(schema)}, ) checkErr(t, err) @@ -412,12 +393,12 @@ func TestClient_Verify(t *testing.T) { defer done() t.Run("test collection verify", func(t *testing.T) { - id := thread.NewIDV1(thread.Raw, 32) + id := thread.NewRandomIDV1() err := client.NewDB(context.Background(), id) checkErr(t, err) err = client.NewCollection(context.Background(), id, db.CollectionConfig{ Name: collectionName, - Schema: util.SchemaFromSchemaString(schema), + Schema: dutil.SchemaFromSchemaString(schema), WriteValidator: ` var type = event.patch.type var patch = event.patch.json_patch @@ -459,13 +440,13 @@ func TestClient_Save(t *testing.T) { defer done() t.Run("test collection save", func(t *testing.T) { - id := thread.NewIDV1(thread.Raw, 32) + id := thread.NewRandomIDV1() err := client.NewDB(context.Background(), id) checkErr(t, err) err = client.NewCollection( context.Background(), id, - db.CollectionConfig{Name: collectionName, Schema: util.SchemaFromSchemaString(schema)}, + db.CollectionConfig{Name: collectionName, Schema: dutil.SchemaFromSchemaString(schema)}, ) checkErr(t, err) @@ -489,13 +470,13 @@ func TestClient_Delete(t *testing.T) { defer done() t.Run("test collection delete", func(t *testing.T) { - id := thread.NewIDV1(thread.Raw, 32) + id := thread.NewRandomIDV1() err := client.NewDB(context.Background(), id) checkErr(t, err) err = client.NewCollection( context.Background(), id, - db.CollectionConfig{Name: collectionName, Schema: util.SchemaFromSchemaString(schema)}, + db.CollectionConfig{Name: collectionName, Schema: dutil.SchemaFromSchemaString(schema)}, ) checkErr(t, err) @@ -519,13 +500,13 @@ func TestClient_Has(t *testing.T) { defer done() t.Run("test collection has", func(t *testing.T) { - id := thread.NewIDV1(thread.Raw, 32) + id := thread.NewRandomIDV1() err := client.NewDB(context.Background(), id) checkErr(t, err) err = client.NewCollection( context.Background(), id, - db.CollectionConfig{Name: collectionName, Schema: util.SchemaFromSchemaString(schema)}, + db.CollectionConfig{Name: collectionName, Schema: dutil.SchemaFromSchemaString(schema)}, ) checkErr(t, err) @@ -552,13 +533,13 @@ func TestClient_Find(t *testing.T) { defer done() t.Run("test collection find", func(t *testing.T) { - id := thread.NewIDV1(thread.Raw, 32) + id := thread.NewRandomIDV1() err := client.NewDB(context.Background(), id) checkErr(t, err) err = client.NewCollection( context.Background(), id, - db.CollectionConfig{Name: collectionName, Schema: util.SchemaFromSchemaString(schema)}, + db.CollectionConfig{Name: collectionName, Schema: dutil.SchemaFromSchemaString(schema)}, ) checkErr(t, err) @@ -590,12 +571,12 @@ func TestClient_FindWithIndex(t *testing.T) { client, done := setup(t) defer done() t.Run("test collection find", func(t *testing.T) { - id := thread.NewIDV1(thread.Raw, 32) + id := thread.NewRandomIDV1() err := client.NewDB(context.Background(), id) checkErr(t, err) err = client.NewCollection(context.Background(), id, db.CollectionConfig{ Name: collectionName, - Schema: util.SchemaFromSchemaString(schema), + Schema: dutil.SchemaFromSchemaString(schema), Indexes: []db.Index{{ Path: "lastName", Unique: true, @@ -632,13 +613,13 @@ func TestClient_FindByID(t *testing.T) { defer done() t.Run("test collection find by ID", func(t *testing.T) { - id := thread.NewIDV1(thread.Raw, 32) + id := thread.NewRandomIDV1() err := client.NewDB(context.Background(), id) checkErr(t, err) err = client.NewCollection( context.Background(), id, - db.CollectionConfig{Name: collectionName, Schema: util.SchemaFromSchemaString(schema)}, + db.CollectionConfig{Name: collectionName, Schema: dutil.SchemaFromSchemaString(schema)}, ) checkErr(t, err) @@ -666,13 +647,13 @@ func TestClient_ReadTransaction(t *testing.T) { defer done() t.Run("test read transaction", func(t *testing.T) { - id := thread.NewIDV1(thread.Raw, 32) + id := thread.NewRandomIDV1() err := client.NewDB(context.Background(), id) checkErr(t, err) err = client.NewCollection( context.Background(), id, - db.CollectionConfig{Name: collectionName, Schema: util.SchemaFromSchemaString(schema)}, + db.CollectionConfig{Name: collectionName, Schema: dutil.SchemaFromSchemaString(schema)}, ) checkErr(t, err) @@ -737,13 +718,13 @@ func TestClient_WriteTransaction(t *testing.T) { defer done() t.Run("test write transaction", func(t *testing.T) { - id := thread.NewIDV1(thread.Raw, 32) + id := thread.NewRandomIDV1() err := client.NewDB(context.Background(), id) checkErr(t, err) err = client.NewCollection( context.Background(), id, - db.CollectionConfig{Name: collectionName, Schema: util.SchemaFromSchemaString(schema)}, + db.CollectionConfig{Name: collectionName, Schema: dutil.SchemaFromSchemaString(schema)}, ) checkErr(t, err) @@ -827,13 +808,13 @@ func TestClient_WriteTransaction(t *testing.T) { }) t.Run("test discard write transaction", func(t *testing.T) { - id := thread.NewIDV1(thread.Raw, 32) + id := thread.NewRandomIDV1() err := client.NewDB(context.Background(), id) checkErr(t, err) err = client.NewCollection( context.Background(), id, - db.CollectionConfig{Name: collectionName, Schema: util.SchemaFromSchemaString(schema)}, + db.CollectionConfig{Name: collectionName, Schema: dutil.SchemaFromSchemaString(schema)}, ) checkErr(t, err) @@ -880,13 +861,13 @@ func TestClient_Listen(t *testing.T) { defer done() t.Run("test listen", func(t *testing.T) { - id := thread.NewIDV1(thread.Raw, 32) + id := thread.NewRandomIDV1() err := client.NewDB(context.Background(), id) checkErr(t, err) err = client.NewCollection( context.Background(), id, - db.CollectionConfig{Name: collectionName, Schema: util.SchemaFromSchemaString(schema)}, + db.CollectionConfig{Name: collectionName, Schema: dutil.SchemaFromSchemaString(schema)}, ) checkErr(t, err) @@ -996,7 +977,7 @@ func setup(t *testing.T) (*Client, func()) { func makeServer(t *testing.T) (ma.Multiaddr, func()) { time.Sleep(time.Second * time.Duration(rand.Intn(5))) n, err := common.DefaultNetwork( - common.WithNetMongoPersistence(test.MongoUri, util.MakeToken(12)), + common.WithNetMongoPersistence(test.MongoUri, util.MakeToken()), common.WithNetHostAddr(util.FreeLocalAddr()), common.WithNetPubSub(true), common.WithNetDebug(true), @@ -1008,7 +989,7 @@ func makeServer(t *testing.T) (ma.Multiaddr, func()) { store, err := mongods.New( ctx, test.MongoUri, - util.MakeToken(12), + util.MakeToken(), mongods.WithCollName("eventstore"), ) if err != nil { @@ -1035,7 +1016,7 @@ func makeServer(t *testing.T) (ma.Multiaddr, func()) { t.Fatal(err) } go func() { - pb.RegisterAPIServer(server, service) + pb.RegisterAPIServiceServer(server, service) if err := server.Serve(listener); err != nil && !errors.Is(err, grpc.ErrServerStopped) { log.Fatalf("serve error: %v", err) } @@ -1061,14 +1042,6 @@ func checkErr(t *testing.T, err error) { } } -func createIdentity(t *testing.T) thread.Identity { - sk, _, err := crypto.GenerateEd25519Key(crand.Reader) - if err != nil { - t.Fatal(err) - } - return thread.NewLibp2pIdentity(sk) -} - func createPerson() *Person { return &Person{ FirstName: "Adam", diff --git a/api/client/read.go b/api/client/read.go index 3183940f..ad205ae1 100644 --- a/api/client/read.go +++ b/api/client/read.go @@ -12,7 +12,7 @@ import ( // ReadTransaction encapsulates a read transaction. type ReadTransaction struct { - client pb.API_ReadTransactionClient + client pb.APIService_ReadTransactionClient dbID thread.ID collectionName string } diff --git a/api/client/write.go b/api/client/write.go index df914d8a..c404695b 100644 --- a/api/client/write.go +++ b/api/client/write.go @@ -12,7 +12,7 @@ import ( // WriteTransaction encapsulates a write transaction. type WriteTransaction struct { - client pb.API_WriteTransactionClient + client pb.APIService_WriteTransactionClient dbID thread.ID collectionName string } diff --git a/api/pb/Makefile b/api/pb/Makefile deleted file mode 100644 index c563ad23..00000000 --- a/api/pb/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -PB = $(wildcard *.proto) -GO = $(PB:.proto=.pb.go) -PROTOC_GEN_TS_PATH = "./javascript/node_modules/.bin/protoc-gen-ts" -PROTOC_GEN_DART_PATH = "${HOME}/.pub-cache/bin/protoc-gen-dart" - -all: $(GO) - -%.pb.go: %.proto - mkdir -p ./dart/lib && \ - protoc -I=. \ - --plugin="protoc-gen-ts=${PROTOC_GEN_TS_PATH}" --js_out="import_style=commonjs,binary:javascript/." --ts_out="service=grpc-web:javascript/." \ - --plugin="protoc-gen-dart=${PROTOC_GEN_DART_PATH}" --dart_out="grpc:dart/lib/." \ - --go_out=\ - plugins=grpc:\ - . $< - -clean: - rm -f *.pb.go - rm -f *pb_test.go - rm -f ./javascript/*.js - rm -f ./javascript/*.d.ts - rm -rf ./dart/lib - -.PHONY: clean \ No newline at end of file diff --git a/api/pb/dart/LICENSE b/api/pb/dart/LICENSE deleted file mode 100644 index 2daaf30e..00000000 --- a/api/pb/dart/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2018-2020 Textile - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/api/pb/dart/README.md b/api/pb/dart/README.md deleted file mode 100644 index acd89283..00000000 --- a/api/pb/dart/README.md +++ /dev/null @@ -1 +0,0 @@ -This is a support library used by the [Dart Threads Client](https://github.com/textileio/dart-threads-client/), available on pub.dev [here](https://pub.dev/packages/threads_client). \ No newline at end of file diff --git a/api/pb/dart/pubspec.lock b/api/pb/dart/pubspec.lock deleted file mode 100644 index e334120e..00000000 --- a/api/pb/dart/pubspec.lock +++ /dev/null @@ -1,215 +0,0 @@ -# Generated by pub -# See https://dart.dev/tools/pub/glossary#lockfile -packages: - args: - dependency: transitive - description: - name: args - url: "https://pub.dartlang.org" - source: hosted - version: "1.5.2" - async: - dependency: "direct main" - description: - name: async - url: "https://pub.dartlang.org" - source: hosted - version: "2.4.0" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.2" - collection: - dependency: transitive - description: - name: collection - url: "https://pub.dartlang.org" - source: hosted - version: "1.14.12" - convert: - dependency: transitive - description: - name: convert - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.1" - crypto: - dependency: transitive - description: - name: crypto - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.4" - fixnum: - dependency: transitive - description: - name: fixnum - url: "https://pub.dartlang.org" - source: hosted - version: "0.10.11" - googleapis_auth: - dependency: transitive - description: - name: googleapis_auth - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.11" - grpc: - dependency: "direct main" - description: - name: grpc - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.3" - http: - dependency: transitive - description: - name: http - url: "https://pub.dartlang.org" - source: hosted - version: "0.12.0+3" - http2: - dependency: transitive - description: - name: http2 - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.0" - http_parser: - dependency: transitive - description: - name: http_parser - url: "https://pub.dartlang.org" - source: hosted - version: "3.1.3" - matcher: - dependency: transitive - description: - name: matcher - url: "https://pub.dartlang.org" - source: hosted - version: "0.12.6" - meta: - dependency: transitive - description: - name: meta - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.8" - path: - dependency: transitive - description: - name: path - url: "https://pub.dartlang.org" - source: hosted - version: "1.6.4" - pedantic: - dependency: transitive - description: - name: pedantic - url: "https://pub.dartlang.org" - source: hosted - version: "1.9.0" - protobuf: - dependency: "direct main" - description: - name: protobuf - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.1" - pub_semver: - dependency: transitive - description: - name: pub_semver - url: "https://pub.dartlang.org" - source: hosted - version: "1.4.2" - pubspec: - dependency: transitive - description: - name: pubspec - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.2" - pubspec_version: - dependency: "direct dev" - description: - name: pubspec_version - url: "https://pub.dartlang.org" - source: hosted - version: "0.6.1+1" - quiver: - dependency: transitive - description: - name: quiver - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.2+1" - source_span: - dependency: transitive - description: - name: source_span - url: "https://pub.dartlang.org" - source: hosted - version: "1.5.5" - stack_trace: - dependency: transitive - description: - name: stack_trace - url: "https://pub.dartlang.org" - source: hosted - version: "1.9.3" - string_scanner: - dependency: transitive - description: - name: string_scanner - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.5" - stuff: - dependency: transitive - description: - name: stuff - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.0" - term_glyph: - dependency: transitive - description: - name: term_glyph - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.6" - uri: - dependency: transitive - description: - name: uri - url: "https://pub.dartlang.org" - source: hosted - version: "0.11.3+1" - utf: - dependency: transitive - description: - name: utf - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.0+5" - yaml: - dependency: transitive - description: - name: yaml - url: "https://pub.dartlang.org" - source: hosted - version: "2.2.0" -sdks: - dart: ">=2.4.0 <3.0.0" diff --git a/api/pb/dart/pubspec.yaml b/api/pb/dart/pubspec.yaml deleted file mode 100644 index 9bdbba90..00000000 --- a/api/pb/dart/pubspec.yaml +++ /dev/null @@ -1,14 +0,0 @@ -name: threads_client_grpc -version: 0.0.0 -description: A gRPC client for interacting with a remote ThreadDB service. -homepage: 'https://github.com/textileio/go-threads' -repository: 'https://github.com/textileio/go-threads' -environment: - sdk: '>=2.3.0 <3.0.0' -dependencies: - async: ^2.2.0 - grpc: ^2.1.3 - protobuf: ^1.0.1 -dev_dependencies: - pubspec_version: ^0.6.1 - diff --git a/api/pb/javascript/package-lock.json b/api/pb/javascript/package-lock.json index c0050df8..668bdaf5 100644 --- a/api/pb/javascript/package-lock.json +++ b/api/pb/javascript/package-lock.json @@ -1,21 +1,21 @@ { - "name": "@textile/threads-client-grpc", + "name": "@textile/threaddb-grpc", "version": "0.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { "@improbable-eng/grpc-web": { - "version": "0.13.0", - "resolved": "https://registry.npmjs.org/@improbable-eng/grpc-web/-/grpc-web-0.13.0.tgz", - "integrity": "sha512-vaxxT+Qwb7GPqDQrBV4vAAfH0HywgOLw6xGIKXd9Q8hcV63CQhmS3p4+pZ9/wVvt4Ph3ZDK9fdC983b9aGMUFg==", + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/@improbable-eng/grpc-web/-/grpc-web-0.14.0.tgz", + "integrity": "sha512-ag1PTMWpBZKGi6GrEcZ4lkU5Qag23Xjo10BmnK9qyx4TMmSVcWmQ3rECirfQzm2uogrM9n1M6xfOpFsJP62ivA==", "requires": { - "browser-headers": "^0.4.0" + "browser-headers": "^0.4.1" } }, "@types/google-protobuf": { - "version": "3.7.3", - "resolved": "https://registry.npmjs.org/@types/google-protobuf/-/google-protobuf-3.7.3.tgz", - "integrity": "sha512-FRwj40euE2bYkG+0X5w2nEA8yAzgJRcEa7RBd0Gsdkb9/tPM2pctVVAvnOUTbcXo2VmIHPo0Ae94Gl9vRHfKzg==" + "version": "3.7.4", + "resolved": "https://registry.npmjs.org/@types/google-protobuf/-/google-protobuf-3.7.4.tgz", + "integrity": "sha512-6PjMFKl13cgB4kRdYtvyjKl8VVa0PXS2IdVxHhQ8GEKbxBkyJtSbaIeK1eZGjDKN7dvUh4vkOvU9FMwYNv4GQQ==" }, "browser-headers": { "version": "0.4.1", @@ -23,14 +23,14 @@ "integrity": "sha512-CA9hsySZVo9371qEHjHZtYxV2cFtVj5Wj/ZHi8ooEsrtm4vOnl9Y9HmyYWk9q+05d7K3rdoAE0j3MVEFVvtQtg==" }, "google-protobuf": { - "version": "3.13.0", - "resolved": "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.13.0.tgz", - "integrity": "sha512-ZIf3qfLFayVrPvAjeKKxO5FRF1/NwRxt6Dko+fWEMuHwHbZx8/fcaAao9b0wCM6kr8qeg2te8XTpyuvKuD9aKw==" + "version": "3.15.5", + "resolved": "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.15.5.tgz", + "integrity": "sha512-6bLpAI4nMIQODlegR7OevgkCoyOj5frLVDArUpeuBWad7XWUNWMGP0v5lz1/aeUI6Yf3cG9XA6acZkPxom4SEw==" }, "ts-protoc-gen": { - "version": "0.13.0", - "resolved": "https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.13.0.tgz", - "integrity": "sha512-j18X4rkDBbG/ZHUJy88WFeZP6mStGow5uREaohowlHXTu3/N7WcpyPhb7Vh6wN38ERmc/AkT9gqT98+vtlRhJA==", + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.14.0.tgz", + "integrity": "sha512-2z6w2HioMCMVNcgNHBcEvudmQfzrn+3BjAlz+xgYZ9L0o8n8UG8WUiTJcbXHFiEg2SU8IltwH2pm1otLoMSKwg==", "dev": true, "requires": { "google-protobuf": "^3.6.1" diff --git a/api/pb/javascript/package.json b/api/pb/javascript/package.json index 3cdd0e1b..6aff684e 100644 --- a/api/pb/javascript/package.json +++ b/api/pb/javascript/package.json @@ -1,7 +1,7 @@ { - "name": "@textile/threads-client-grpc", + "name": "@textile/threaddb-grpc", "version": "0.0.0", - "description": "A gRPC client for interacting with a remote ThreadDB service.", + "description": "A client for interacting with the ThreadDB gRPC API.", "repository": { "type": "git", "url": "git+https://github.com/textileio/go-threads.git" @@ -9,17 +9,17 @@ "author": "Textile", "license": "MIT", "files": [ - "threads_pb.js", - "threads_pb_service.js", - "threads_pb.d.ts", - "threads_pb_service.d.ts" + "api/pb/threaddb_pb.js", + "api/pb/threaddb_pb_service.js", + "api/pb/threaddb_pb.d.ts", + "api/pb/threaddb_pb_service.d.ts" ], "dependencies": { - "@improbable-eng/grpc-web": "^0.13.0", - "@types/google-protobuf": "^3.7.3", - "google-protobuf": "^3.13.0" + "@improbable-eng/grpc-web": "^0.14.0", + "@types/google-protobuf": "^3.7.4", + "google-protobuf": "^3.15.5" }, "devDependencies": { - "ts-protoc-gen": "^0.13.0" + "ts-protoc-gen": "^0.14.0" } } diff --git a/api/pb/threaddb.pb.go b/api/pb/threaddb.pb.go new file mode 100644 index 00000000..7e2d294b --- /dev/null +++ b/api/pb/threaddb.pb.go @@ -0,0 +1,5221 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.23.0 +// protoc v3.13.0 +// source: api/pb/threaddb.proto + +package pb + +import ( + context "context" + proto "github.com/golang/protobuf/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type ListenRequest_Filter_Action int32 + +const ( + ListenRequest_Filter_ALL ListenRequest_Filter_Action = 0 + ListenRequest_Filter_CREATE ListenRequest_Filter_Action = 1 + ListenRequest_Filter_SAVE ListenRequest_Filter_Action = 2 + ListenRequest_Filter_DELETE ListenRequest_Filter_Action = 3 +) + +// Enum value maps for ListenRequest_Filter_Action. +var ( + ListenRequest_Filter_Action_name = map[int32]string{ + 0: "ALL", + 1: "CREATE", + 2: "SAVE", + 3: "DELETE", + } + ListenRequest_Filter_Action_value = map[string]int32{ + "ALL": 0, + "CREATE": 1, + "SAVE": 2, + "DELETE": 3, + } +) + +func (x ListenRequest_Filter_Action) Enum() *ListenRequest_Filter_Action { + p := new(ListenRequest_Filter_Action) + *p = x + return p +} + +func (x ListenRequest_Filter_Action) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ListenRequest_Filter_Action) Descriptor() protoreflect.EnumDescriptor { + return file_api_pb_threaddb_proto_enumTypes[0].Descriptor() +} + +func (ListenRequest_Filter_Action) Type() protoreflect.EnumType { + return &file_api_pb_threaddb_proto_enumTypes[0] +} + +func (x ListenRequest_Filter_Action) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ListenRequest_Filter_Action.Descriptor instead. +func (ListenRequest_Filter_Action) EnumDescriptor() ([]byte, []int) { + return file_api_pb_threaddb_proto_rawDescGZIP(), []int{44, 0, 0} +} + +type ListenReply_Action int32 + +const ( + ListenReply_CREATE ListenReply_Action = 0 + ListenReply_SAVE ListenReply_Action = 1 + ListenReply_DELETE ListenReply_Action = 2 +) + +// Enum value maps for ListenReply_Action. +var ( + ListenReply_Action_name = map[int32]string{ + 0: "CREATE", + 1: "SAVE", + 2: "DELETE", + } + ListenReply_Action_value = map[string]int32{ + "CREATE": 0, + "SAVE": 1, + "DELETE": 2, + } +) + +func (x ListenReply_Action) Enum() *ListenReply_Action { + p := new(ListenReply_Action) + *p = x + return p +} + +func (x ListenReply_Action) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ListenReply_Action) Descriptor() protoreflect.EnumDescriptor { + return file_api_pb_threaddb_proto_enumTypes[1].Descriptor() +} + +func (ListenReply_Action) Type() protoreflect.EnumType { + return &file_api_pb_threaddb_proto_enumTypes[1] +} + +func (x ListenReply_Action) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ListenReply_Action.Descriptor instead. +func (ListenReply_Action) EnumDescriptor() ([]byte, []int) { + return file_api_pb_threaddb_proto_rawDescGZIP(), []int{45, 0} +} + +// @todo: Clean up tag numbers with next major release +type NewDBRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DbID []byte `protobuf:"bytes,1,opt,name=dbID,proto3" json:"dbID,omitempty"` + Key []byte `protobuf:"bytes,6,opt,name=key,proto3" json:"key,omitempty"` + LogKey []byte `protobuf:"bytes,7,opt,name=logKey,proto3" json:"logKey,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Collections []*CollectionConfig `protobuf:"bytes,2,rep,name=collections,proto3" json:"collections,omitempty"` + // Deprecated: Do not use. + Block bool `protobuf:"varint,5,opt,name=block,proto3" json:"block,omitempty"` +} + +func (x *NewDBRequest) Reset() { + *x = NewDBRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_pb_threaddb_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NewDBRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NewDBRequest) ProtoMessage() {} + +func (x *NewDBRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_pb_threaddb_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NewDBRequest.ProtoReflect.Descriptor instead. +func (*NewDBRequest) Descriptor() ([]byte, []int) { + return file_api_pb_threaddb_proto_rawDescGZIP(), []int{0} +} + +func (x *NewDBRequest) GetDbID() []byte { + if x != nil { + return x.DbID + } + return nil +} + +func (x *NewDBRequest) GetKey() []byte { + if x != nil { + return x.Key + } + return nil +} + +func (x *NewDBRequest) GetLogKey() []byte { + if x != nil { + return x.LogKey + } + return nil +} + +func (x *NewDBRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *NewDBRequest) GetCollections() []*CollectionConfig { + if x != nil { + return x.Collections + } + return nil +} + +// Deprecated: Do not use. +func (x *NewDBRequest) GetBlock() bool { + if x != nil { + return x.Block + } + return false +} + +// @todo: Clean up tag numbers with next major release +type NewDBFromAddrRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Addr []byte `protobuf:"bytes,1,opt,name=addr,proto3" json:"addr,omitempty"` + Key []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` + LogKey []byte `protobuf:"bytes,7,opt,name=logKey,proto3" json:"logKey,omitempty"` + Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` + Collections []*CollectionConfig `protobuf:"bytes,3,rep,name=collections,proto3" json:"collections,omitempty"` + Block bool `protobuf:"varint,5,opt,name=block,proto3" json:"block,omitempty"` + // Deprecated: Do not use. + ThreadKey []byte `protobuf:"bytes,6,opt,name=threadKey,proto3" json:"threadKey,omitempty"` +} + +func (x *NewDBFromAddrRequest) Reset() { + *x = NewDBFromAddrRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_pb_threaddb_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NewDBFromAddrRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NewDBFromAddrRequest) ProtoMessage() {} + +func (x *NewDBFromAddrRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_pb_threaddb_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NewDBFromAddrRequest.ProtoReflect.Descriptor instead. +func (*NewDBFromAddrRequest) Descriptor() ([]byte, []int) { + return file_api_pb_threaddb_proto_rawDescGZIP(), []int{1} +} + +func (x *NewDBFromAddrRequest) GetAddr() []byte { + if x != nil { + return x.Addr + } + return nil +} + +func (x *NewDBFromAddrRequest) GetKey() []byte { + if x != nil { + return x.Key + } + return nil +} + +func (x *NewDBFromAddrRequest) GetLogKey() []byte { + if x != nil { + return x.LogKey + } + return nil +} + +func (x *NewDBFromAddrRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *NewDBFromAddrRequest) GetCollections() []*CollectionConfig { + if x != nil { + return x.Collections + } + return nil +} + +func (x *NewDBFromAddrRequest) GetBlock() bool { + if x != nil { + return x.Block + } + return false +} + +// Deprecated: Do not use. +func (x *NewDBFromAddrRequest) GetThreadKey() []byte { + if x != nil { + return x.ThreadKey + } + return nil +} + +type CollectionConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Schema []byte `protobuf:"bytes,2,opt,name=schema,proto3" json:"schema,omitempty"` + Indexes []*Index `protobuf:"bytes,3,rep,name=indexes,proto3" json:"indexes,omitempty"` + WriteValidator string `protobuf:"bytes,4,opt,name=writeValidator,proto3" json:"writeValidator,omitempty"` + ReadFilter string `protobuf:"bytes,5,opt,name=readFilter,proto3" json:"readFilter,omitempty"` +} + +func (x *CollectionConfig) Reset() { + *x = CollectionConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_api_pb_threaddb_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CollectionConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CollectionConfig) ProtoMessage() {} + +func (x *CollectionConfig) ProtoReflect() protoreflect.Message { + mi := &file_api_pb_threaddb_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CollectionConfig.ProtoReflect.Descriptor instead. +func (*CollectionConfig) Descriptor() ([]byte, []int) { + return file_api_pb_threaddb_proto_rawDescGZIP(), []int{2} +} + +func (x *CollectionConfig) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CollectionConfig) GetSchema() []byte { + if x != nil { + return x.Schema + } + return nil +} + +func (x *CollectionConfig) GetIndexes() []*Index { + if x != nil { + return x.Indexes + } + return nil +} + +func (x *CollectionConfig) GetWriteValidator() string { + if x != nil { + return x.WriteValidator + } + return "" +} + +func (x *CollectionConfig) GetReadFilter() string { + if x != nil { + return x.ReadFilter + } + return "" +} + +type Index struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` + Unique bool `protobuf:"varint,2,opt,name=unique,proto3" json:"unique,omitempty"` +} + +func (x *Index) Reset() { + *x = Index{} + if protoimpl.UnsafeEnabled { + mi := &file_api_pb_threaddb_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Index) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Index) ProtoMessage() {} + +func (x *Index) ProtoReflect() protoreflect.Message { + mi := &file_api_pb_threaddb_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Index.ProtoReflect.Descriptor instead. +func (*Index) Descriptor() ([]byte, []int) { + return file_api_pb_threaddb_proto_rawDescGZIP(), []int{3} +} + +func (x *Index) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +func (x *Index) GetUnique() bool { + if x != nil { + return x.Unique + } + return false +} + +type NewDBReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *NewDBReply) Reset() { + *x = NewDBReply{} + if protoimpl.UnsafeEnabled { + mi := &file_api_pb_threaddb_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NewDBReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NewDBReply) ProtoMessage() {} + +func (x *NewDBReply) ProtoReflect() protoreflect.Message { + mi := &file_api_pb_threaddb_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NewDBReply.ProtoReflect.Descriptor instead. +func (*NewDBReply) Descriptor() ([]byte, []int) { + return file_api_pb_threaddb_proto_rawDescGZIP(), []int{4} +} + +type ListDBsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ListDBsRequest) Reset() { + *x = ListDBsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_pb_threaddb_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListDBsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListDBsRequest) ProtoMessage() {} + +func (x *ListDBsRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_pb_threaddb_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListDBsRequest.ProtoReflect.Descriptor instead. +func (*ListDBsRequest) Descriptor() ([]byte, []int) { + return file_api_pb_threaddb_proto_rawDescGZIP(), []int{5} +} + +type ListDBsReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Dbs []*ListDBsReply_DB `protobuf:"bytes,1,rep,name=dbs,proto3" json:"dbs,omitempty"` +} + +func (x *ListDBsReply) Reset() { + *x = ListDBsReply{} + if protoimpl.UnsafeEnabled { + mi := &file_api_pb_threaddb_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListDBsReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListDBsReply) ProtoMessage() {} + +func (x *ListDBsReply) ProtoReflect() protoreflect.Message { + mi := &file_api_pb_threaddb_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListDBsReply.ProtoReflect.Descriptor instead. +func (*ListDBsReply) Descriptor() ([]byte, []int) { + return file_api_pb_threaddb_proto_rawDescGZIP(), []int{6} +} + +func (x *ListDBsReply) GetDbs() []*ListDBsReply_DB { + if x != nil { + return x.Dbs + } + return nil +} + +type GetDBInfoRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DbID []byte `protobuf:"bytes,1,opt,name=dbID,proto3" json:"dbID,omitempty"` +} + +func (x *GetDBInfoRequest) Reset() { + *x = GetDBInfoRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_pb_threaddb_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetDBInfoRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetDBInfoRequest) ProtoMessage() {} + +func (x *GetDBInfoRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_pb_threaddb_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetDBInfoRequest.ProtoReflect.Descriptor instead. +func (*GetDBInfoRequest) Descriptor() ([]byte, []int) { + return file_api_pb_threaddb_proto_rawDescGZIP(), []int{7} +} + +func (x *GetDBInfoRequest) GetDbID() []byte { + if x != nil { + return x.DbID + } + return nil +} + +type GetDBInfoReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Addrs [][]byte `protobuf:"bytes,1,rep,name=addrs,proto3" json:"addrs,omitempty"` + Key []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *GetDBInfoReply) Reset() { + *x = GetDBInfoReply{} + if protoimpl.UnsafeEnabled { + mi := &file_api_pb_threaddb_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetDBInfoReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetDBInfoReply) ProtoMessage() {} + +func (x *GetDBInfoReply) ProtoReflect() protoreflect.Message { + mi := &file_api_pb_threaddb_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetDBInfoReply.ProtoReflect.Descriptor instead. +func (*GetDBInfoReply) Descriptor() ([]byte, []int) { + return file_api_pb_threaddb_proto_rawDescGZIP(), []int{8} +} + +func (x *GetDBInfoReply) GetAddrs() [][]byte { + if x != nil { + return x.Addrs + } + return nil +} + +func (x *GetDBInfoReply) GetKey() []byte { + if x != nil { + return x.Key + } + return nil +} + +func (x *GetDBInfoReply) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type DeleteDBRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DbID []byte `protobuf:"bytes,1,opt,name=dbID,proto3" json:"dbID,omitempty"` +} + +func (x *DeleteDBRequest) Reset() { + *x = DeleteDBRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_pb_threaddb_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteDBRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteDBRequest) ProtoMessage() {} + +func (x *DeleteDBRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_pb_threaddb_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteDBRequest.ProtoReflect.Descriptor instead. +func (*DeleteDBRequest) Descriptor() ([]byte, []int) { + return file_api_pb_threaddb_proto_rawDescGZIP(), []int{9} +} + +func (x *DeleteDBRequest) GetDbID() []byte { + if x != nil { + return x.DbID + } + return nil +} + +type DeleteDBReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *DeleteDBReply) Reset() { + *x = DeleteDBReply{} + if protoimpl.UnsafeEnabled { + mi := &file_api_pb_threaddb_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteDBReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteDBReply) ProtoMessage() {} + +func (x *DeleteDBReply) ProtoReflect() protoreflect.Message { + mi := &file_api_pb_threaddb_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteDBReply.ProtoReflect.Descriptor instead. +func (*DeleteDBReply) Descriptor() ([]byte, []int) { + return file_api_pb_threaddb_proto_rawDescGZIP(), []int{10} +} + +type NewCollectionRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DbID []byte `protobuf:"bytes,1,opt,name=dbID,proto3" json:"dbID,omitempty"` + Config *CollectionConfig `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"` +} + +func (x *NewCollectionRequest) Reset() { + *x = NewCollectionRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_pb_threaddb_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NewCollectionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NewCollectionRequest) ProtoMessage() {} + +func (x *NewCollectionRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_pb_threaddb_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NewCollectionRequest.ProtoReflect.Descriptor instead. +func (*NewCollectionRequest) Descriptor() ([]byte, []int) { + return file_api_pb_threaddb_proto_rawDescGZIP(), []int{11} +} + +func (x *NewCollectionRequest) GetDbID() []byte { + if x != nil { + return x.DbID + } + return nil +} + +func (x *NewCollectionRequest) GetConfig() *CollectionConfig { + if x != nil { + return x.Config + } + return nil +} + +type NewCollectionReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *NewCollectionReply) Reset() { + *x = NewCollectionReply{} + if protoimpl.UnsafeEnabled { + mi := &file_api_pb_threaddb_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NewCollectionReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NewCollectionReply) ProtoMessage() {} + +func (x *NewCollectionReply) ProtoReflect() protoreflect.Message { + mi := &file_api_pb_threaddb_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NewCollectionReply.ProtoReflect.Descriptor instead. +func (*NewCollectionReply) Descriptor() ([]byte, []int) { + return file_api_pb_threaddb_proto_rawDescGZIP(), []int{12} +} + +type UpdateCollectionRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DbID []byte `protobuf:"bytes,1,opt,name=dbID,proto3" json:"dbID,omitempty"` + Config *CollectionConfig `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"` +} + +func (x *UpdateCollectionRequest) Reset() { + *x = UpdateCollectionRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_pb_threaddb_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateCollectionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateCollectionRequest) ProtoMessage() {} + +func (x *UpdateCollectionRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_pb_threaddb_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateCollectionRequest.ProtoReflect.Descriptor instead. +func (*UpdateCollectionRequest) Descriptor() ([]byte, []int) { + return file_api_pb_threaddb_proto_rawDescGZIP(), []int{13} +} + +func (x *UpdateCollectionRequest) GetDbID() []byte { + if x != nil { + return x.DbID + } + return nil +} + +func (x *UpdateCollectionRequest) GetConfig() *CollectionConfig { + if x != nil { + return x.Config + } + return nil +} + +type UpdateCollectionReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *UpdateCollectionReply) Reset() { + *x = UpdateCollectionReply{} + if protoimpl.UnsafeEnabled { + mi := &file_api_pb_threaddb_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateCollectionReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateCollectionReply) ProtoMessage() {} + +func (x *UpdateCollectionReply) ProtoReflect() protoreflect.Message { + mi := &file_api_pb_threaddb_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateCollectionReply.ProtoReflect.Descriptor instead. +func (*UpdateCollectionReply) Descriptor() ([]byte, []int) { + return file_api_pb_threaddb_proto_rawDescGZIP(), []int{14} +} + +type DeleteCollectionRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DbID []byte `protobuf:"bytes,1,opt,name=dbID,proto3" json:"dbID,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *DeleteCollectionRequest) Reset() { + *x = DeleteCollectionRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_pb_threaddb_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteCollectionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteCollectionRequest) ProtoMessage() {} + +func (x *DeleteCollectionRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_pb_threaddb_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteCollectionRequest.ProtoReflect.Descriptor instead. +func (*DeleteCollectionRequest) Descriptor() ([]byte, []int) { + return file_api_pb_threaddb_proto_rawDescGZIP(), []int{15} +} + +func (x *DeleteCollectionRequest) GetDbID() []byte { + if x != nil { + return x.DbID + } + return nil +} + +func (x *DeleteCollectionRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type DeleteCollectionReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *DeleteCollectionReply) Reset() { + *x = DeleteCollectionReply{} + if protoimpl.UnsafeEnabled { + mi := &file_api_pb_threaddb_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteCollectionReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteCollectionReply) ProtoMessage() {} + +func (x *DeleteCollectionReply) ProtoReflect() protoreflect.Message { + mi := &file_api_pb_threaddb_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteCollectionReply.ProtoReflect.Descriptor instead. +func (*DeleteCollectionReply) Descriptor() ([]byte, []int) { + return file_api_pb_threaddb_proto_rawDescGZIP(), []int{16} +} + +type GetCollectionInfoRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DbID []byte `protobuf:"bytes,1,opt,name=dbID,proto3" json:"dbID,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *GetCollectionInfoRequest) Reset() { + *x = GetCollectionInfoRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_pb_threaddb_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetCollectionInfoRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetCollectionInfoRequest) ProtoMessage() {} + +func (x *GetCollectionInfoRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_pb_threaddb_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetCollectionInfoRequest.ProtoReflect.Descriptor instead. +func (*GetCollectionInfoRequest) Descriptor() ([]byte, []int) { + return file_api_pb_threaddb_proto_rawDescGZIP(), []int{17} +} + +func (x *GetCollectionInfoRequest) GetDbID() []byte { + if x != nil { + return x.DbID + } + return nil +} + +func (x *GetCollectionInfoRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type GetCollectionInfoReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Schema []byte `protobuf:"bytes,2,opt,name=schema,proto3" json:"schema,omitempty"` + Indexes []*Index `protobuf:"bytes,3,rep,name=indexes,proto3" json:"indexes,omitempty"` + WriteValidator string `protobuf:"bytes,4,opt,name=writeValidator,proto3" json:"writeValidator,omitempty"` + ReadFilter string `protobuf:"bytes,5,opt,name=readFilter,proto3" json:"readFilter,omitempty"` +} + +func (x *GetCollectionInfoReply) Reset() { + *x = GetCollectionInfoReply{} + if protoimpl.UnsafeEnabled { + mi := &file_api_pb_threaddb_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetCollectionInfoReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetCollectionInfoReply) ProtoMessage() {} + +func (x *GetCollectionInfoReply) ProtoReflect() protoreflect.Message { + mi := &file_api_pb_threaddb_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetCollectionInfoReply.ProtoReflect.Descriptor instead. +func (*GetCollectionInfoReply) Descriptor() ([]byte, []int) { + return file_api_pb_threaddb_proto_rawDescGZIP(), []int{18} +} + +func (x *GetCollectionInfoReply) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *GetCollectionInfoReply) GetSchema() []byte { + if x != nil { + return x.Schema + } + return nil +} + +func (x *GetCollectionInfoReply) GetIndexes() []*Index { + if x != nil { + return x.Indexes + } + return nil +} + +func (x *GetCollectionInfoReply) GetWriteValidator() string { + if x != nil { + return x.WriteValidator + } + return "" +} + +func (x *GetCollectionInfoReply) GetReadFilter() string { + if x != nil { + return x.ReadFilter + } + return "" +} + +type GetCollectionIndexesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DbID []byte `protobuf:"bytes,1,opt,name=dbID,proto3" json:"dbID,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *GetCollectionIndexesRequest) Reset() { + *x = GetCollectionIndexesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_pb_threaddb_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetCollectionIndexesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetCollectionIndexesRequest) ProtoMessage() {} + +func (x *GetCollectionIndexesRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_pb_threaddb_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetCollectionIndexesRequest.ProtoReflect.Descriptor instead. +func (*GetCollectionIndexesRequest) Descriptor() ([]byte, []int) { + return file_api_pb_threaddb_proto_rawDescGZIP(), []int{19} +} + +func (x *GetCollectionIndexesRequest) GetDbID() []byte { + if x != nil { + return x.DbID + } + return nil +} + +func (x *GetCollectionIndexesRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type GetCollectionIndexesReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Indexes []*Index `protobuf:"bytes,1,rep,name=indexes,proto3" json:"indexes,omitempty"` +} + +func (x *GetCollectionIndexesReply) Reset() { + *x = GetCollectionIndexesReply{} + if protoimpl.UnsafeEnabled { + mi := &file_api_pb_threaddb_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetCollectionIndexesReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetCollectionIndexesReply) ProtoMessage() {} + +func (x *GetCollectionIndexesReply) ProtoReflect() protoreflect.Message { + mi := &file_api_pb_threaddb_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetCollectionIndexesReply.ProtoReflect.Descriptor instead. +func (*GetCollectionIndexesReply) Descriptor() ([]byte, []int) { + return file_api_pb_threaddb_proto_rawDescGZIP(), []int{20} +} + +func (x *GetCollectionIndexesReply) GetIndexes() []*Index { + if x != nil { + return x.Indexes + } + return nil +} + +type ListCollectionsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DbID []byte `protobuf:"bytes,1,opt,name=dbID,proto3" json:"dbID,omitempty"` +} + +func (x *ListCollectionsRequest) Reset() { + *x = ListCollectionsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_pb_threaddb_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListCollectionsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListCollectionsRequest) ProtoMessage() {} + +func (x *ListCollectionsRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_pb_threaddb_proto_msgTypes[21] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListCollectionsRequest.ProtoReflect.Descriptor instead. +func (*ListCollectionsRequest) Descriptor() ([]byte, []int) { + return file_api_pb_threaddb_proto_rawDescGZIP(), []int{21} +} + +func (x *ListCollectionsRequest) GetDbID() []byte { + if x != nil { + return x.DbID + } + return nil +} + +type ListCollectionsReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Collections []*GetCollectionInfoReply `protobuf:"bytes,1,rep,name=collections,proto3" json:"collections,omitempty"` +} + +func (x *ListCollectionsReply) Reset() { + *x = ListCollectionsReply{} + if protoimpl.UnsafeEnabled { + mi := &file_api_pb_threaddb_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListCollectionsReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListCollectionsReply) ProtoMessage() {} + +func (x *ListCollectionsReply) ProtoReflect() protoreflect.Message { + mi := &file_api_pb_threaddb_proto_msgTypes[22] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListCollectionsReply.ProtoReflect.Descriptor instead. +func (*ListCollectionsReply) Descriptor() ([]byte, []int) { + return file_api_pb_threaddb_proto_rawDescGZIP(), []int{22} +} + +func (x *ListCollectionsReply) GetCollections() []*GetCollectionInfoReply { + if x != nil { + return x.Collections + } + return nil +} + +type CreateRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DbID []byte `protobuf:"bytes,1,opt,name=dbID,proto3" json:"dbID,omitempty"` + CollectionName string `protobuf:"bytes,2,opt,name=collectionName,proto3" json:"collectionName,omitempty"` + Instances [][]byte `protobuf:"bytes,3,rep,name=instances,proto3" json:"instances,omitempty"` +} + +func (x *CreateRequest) Reset() { + *x = CreateRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_pb_threaddb_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateRequest) ProtoMessage() {} + +func (x *CreateRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_pb_threaddb_proto_msgTypes[23] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateRequest.ProtoReflect.Descriptor instead. +func (*CreateRequest) Descriptor() ([]byte, []int) { + return file_api_pb_threaddb_proto_rawDescGZIP(), []int{23} +} + +func (x *CreateRequest) GetDbID() []byte { + if x != nil { + return x.DbID + } + return nil +} + +func (x *CreateRequest) GetCollectionName() string { + if x != nil { + return x.CollectionName + } + return "" +} + +func (x *CreateRequest) GetInstances() [][]byte { + if x != nil { + return x.Instances + } + return nil +} + +type CreateReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InstanceIDs []string `protobuf:"bytes,1,rep,name=instanceIDs,proto3" json:"instanceIDs,omitempty"` + TransactionError string `protobuf:"bytes,2,opt,name=transactionError,proto3" json:"transactionError,omitempty"` +} + +func (x *CreateReply) Reset() { + *x = CreateReply{} + if protoimpl.UnsafeEnabled { + mi := &file_api_pb_threaddb_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateReply) ProtoMessage() {} + +func (x *CreateReply) ProtoReflect() protoreflect.Message { + mi := &file_api_pb_threaddb_proto_msgTypes[24] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateReply.ProtoReflect.Descriptor instead. +func (*CreateReply) Descriptor() ([]byte, []int) { + return file_api_pb_threaddb_proto_rawDescGZIP(), []int{24} +} + +func (x *CreateReply) GetInstanceIDs() []string { + if x != nil { + return x.InstanceIDs + } + return nil +} + +func (x *CreateReply) GetTransactionError() string { + if x != nil { + return x.TransactionError + } + return "" +} + +type VerifyRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DbID []byte `protobuf:"bytes,1,opt,name=dbID,proto3" json:"dbID,omitempty"` + CollectionName string `protobuf:"bytes,2,opt,name=collectionName,proto3" json:"collectionName,omitempty"` + Instances [][]byte `protobuf:"bytes,3,rep,name=instances,proto3" json:"instances,omitempty"` +} + +func (x *VerifyRequest) Reset() { + *x = VerifyRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_pb_threaddb_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *VerifyRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VerifyRequest) ProtoMessage() {} + +func (x *VerifyRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_pb_threaddb_proto_msgTypes[25] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use VerifyRequest.ProtoReflect.Descriptor instead. +func (*VerifyRequest) Descriptor() ([]byte, []int) { + return file_api_pb_threaddb_proto_rawDescGZIP(), []int{25} +} + +func (x *VerifyRequest) GetDbID() []byte { + if x != nil { + return x.DbID + } + return nil +} + +func (x *VerifyRequest) GetCollectionName() string { + if x != nil { + return x.CollectionName + } + return "" +} + +func (x *VerifyRequest) GetInstances() [][]byte { + if x != nil { + return x.Instances + } + return nil +} + +type VerifyReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TransactionError string `protobuf:"bytes,1,opt,name=transactionError,proto3" json:"transactionError,omitempty"` +} + +func (x *VerifyReply) Reset() { + *x = VerifyReply{} + if protoimpl.UnsafeEnabled { + mi := &file_api_pb_threaddb_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *VerifyReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VerifyReply) ProtoMessage() {} + +func (x *VerifyReply) ProtoReflect() protoreflect.Message { + mi := &file_api_pb_threaddb_proto_msgTypes[26] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use VerifyReply.ProtoReflect.Descriptor instead. +func (*VerifyReply) Descriptor() ([]byte, []int) { + return file_api_pb_threaddb_proto_rawDescGZIP(), []int{26} +} + +func (x *VerifyReply) GetTransactionError() string { + if x != nil { + return x.TransactionError + } + return "" +} + +type SaveRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DbID []byte `protobuf:"bytes,1,opt,name=dbID,proto3" json:"dbID,omitempty"` + CollectionName string `protobuf:"bytes,2,opt,name=collectionName,proto3" json:"collectionName,omitempty"` + Instances [][]byte `protobuf:"bytes,3,rep,name=instances,proto3" json:"instances,omitempty"` +} + +func (x *SaveRequest) Reset() { + *x = SaveRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_pb_threaddb_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SaveRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SaveRequest) ProtoMessage() {} + +func (x *SaveRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_pb_threaddb_proto_msgTypes[27] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SaveRequest.ProtoReflect.Descriptor instead. +func (*SaveRequest) Descriptor() ([]byte, []int) { + return file_api_pb_threaddb_proto_rawDescGZIP(), []int{27} +} + +func (x *SaveRequest) GetDbID() []byte { + if x != nil { + return x.DbID + } + return nil +} + +func (x *SaveRequest) GetCollectionName() string { + if x != nil { + return x.CollectionName + } + return "" +} + +func (x *SaveRequest) GetInstances() [][]byte { + if x != nil { + return x.Instances + } + return nil +} + +type SaveReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TransactionError string `protobuf:"bytes,1,opt,name=transactionError,proto3" json:"transactionError,omitempty"` +} + +func (x *SaveReply) Reset() { + *x = SaveReply{} + if protoimpl.UnsafeEnabled { + mi := &file_api_pb_threaddb_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SaveReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SaveReply) ProtoMessage() {} + +func (x *SaveReply) ProtoReflect() protoreflect.Message { + mi := &file_api_pb_threaddb_proto_msgTypes[28] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SaveReply.ProtoReflect.Descriptor instead. +func (*SaveReply) Descriptor() ([]byte, []int) { + return file_api_pb_threaddb_proto_rawDescGZIP(), []int{28} +} + +func (x *SaveReply) GetTransactionError() string { + if x != nil { + return x.TransactionError + } + return "" +} + +type DeleteRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DbID []byte `protobuf:"bytes,1,opt,name=dbID,proto3" json:"dbID,omitempty"` + CollectionName string `protobuf:"bytes,2,opt,name=collectionName,proto3" json:"collectionName,omitempty"` + InstanceIDs []string `protobuf:"bytes,3,rep,name=instanceIDs,proto3" json:"instanceIDs,omitempty"` +} + +func (x *DeleteRequest) Reset() { + *x = DeleteRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_pb_threaddb_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteRequest) ProtoMessage() {} + +func (x *DeleteRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_pb_threaddb_proto_msgTypes[29] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead. +func (*DeleteRequest) Descriptor() ([]byte, []int) { + return file_api_pb_threaddb_proto_rawDescGZIP(), []int{29} +} + +func (x *DeleteRequest) GetDbID() []byte { + if x != nil { + return x.DbID + } + return nil +} + +func (x *DeleteRequest) GetCollectionName() string { + if x != nil { + return x.CollectionName + } + return "" +} + +func (x *DeleteRequest) GetInstanceIDs() []string { + if x != nil { + return x.InstanceIDs + } + return nil +} + +type DeleteReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TransactionError string `protobuf:"bytes,1,opt,name=transactionError,proto3" json:"transactionError,omitempty"` +} + +func (x *DeleteReply) Reset() { + *x = DeleteReply{} + if protoimpl.UnsafeEnabled { + mi := &file_api_pb_threaddb_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteReply) ProtoMessage() {} + +func (x *DeleteReply) ProtoReflect() protoreflect.Message { + mi := &file_api_pb_threaddb_proto_msgTypes[30] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteReply.ProtoReflect.Descriptor instead. +func (*DeleteReply) Descriptor() ([]byte, []int) { + return file_api_pb_threaddb_proto_rawDescGZIP(), []int{30} +} + +func (x *DeleteReply) GetTransactionError() string { + if x != nil { + return x.TransactionError + } + return "" +} + +type HasRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DbID []byte `protobuf:"bytes,1,opt,name=dbID,proto3" json:"dbID,omitempty"` + CollectionName string `protobuf:"bytes,2,opt,name=collectionName,proto3" json:"collectionName,omitempty"` + InstanceIDs []string `protobuf:"bytes,3,rep,name=instanceIDs,proto3" json:"instanceIDs,omitempty"` +} + +func (x *HasRequest) Reset() { + *x = HasRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_pb_threaddb_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HasRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HasRequest) ProtoMessage() {} + +func (x *HasRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_pb_threaddb_proto_msgTypes[31] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HasRequest.ProtoReflect.Descriptor instead. +func (*HasRequest) Descriptor() ([]byte, []int) { + return file_api_pb_threaddb_proto_rawDescGZIP(), []int{31} +} + +func (x *HasRequest) GetDbID() []byte { + if x != nil { + return x.DbID + } + return nil +} + +func (x *HasRequest) GetCollectionName() string { + if x != nil { + return x.CollectionName + } + return "" +} + +func (x *HasRequest) GetInstanceIDs() []string { + if x != nil { + return x.InstanceIDs + } + return nil +} + +type HasReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Exists bool `protobuf:"varint,1,opt,name=exists,proto3" json:"exists,omitempty"` + TransactionError string `protobuf:"bytes,2,opt,name=transactionError,proto3" json:"transactionError,omitempty"` +} + +func (x *HasReply) Reset() { + *x = HasReply{} + if protoimpl.UnsafeEnabled { + mi := &file_api_pb_threaddb_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HasReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HasReply) ProtoMessage() {} + +func (x *HasReply) ProtoReflect() protoreflect.Message { + mi := &file_api_pb_threaddb_proto_msgTypes[32] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HasReply.ProtoReflect.Descriptor instead. +func (*HasReply) Descriptor() ([]byte, []int) { + return file_api_pb_threaddb_proto_rawDescGZIP(), []int{32} +} + +func (x *HasReply) GetExists() bool { + if x != nil { + return x.Exists + } + return false +} + +func (x *HasReply) GetTransactionError() string { + if x != nil { + return x.TransactionError + } + return "" +} + +type FindRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DbID []byte `protobuf:"bytes,1,opt,name=dbID,proto3" json:"dbID,omitempty"` + CollectionName string `protobuf:"bytes,2,opt,name=collectionName,proto3" json:"collectionName,omitempty"` + QueryJSON []byte `protobuf:"bytes,3,opt,name=queryJSON,proto3" json:"queryJSON,omitempty"` +} + +func (x *FindRequest) Reset() { + *x = FindRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_pb_threaddb_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FindRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FindRequest) ProtoMessage() {} + +func (x *FindRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_pb_threaddb_proto_msgTypes[33] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FindRequest.ProtoReflect.Descriptor instead. +func (*FindRequest) Descriptor() ([]byte, []int) { + return file_api_pb_threaddb_proto_rawDescGZIP(), []int{33} +} + +func (x *FindRequest) GetDbID() []byte { + if x != nil { + return x.DbID + } + return nil +} + +func (x *FindRequest) GetCollectionName() string { + if x != nil { + return x.CollectionName + } + return "" +} + +func (x *FindRequest) GetQueryJSON() []byte { + if x != nil { + return x.QueryJSON + } + return nil +} + +type FindReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Instances [][]byte `protobuf:"bytes,1,rep,name=instances,proto3" json:"instances,omitempty"` + TransactionError string `protobuf:"bytes,2,opt,name=transactionError,proto3" json:"transactionError,omitempty"` +} + +func (x *FindReply) Reset() { + *x = FindReply{} + if protoimpl.UnsafeEnabled { + mi := &file_api_pb_threaddb_proto_msgTypes[34] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FindReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FindReply) ProtoMessage() {} + +func (x *FindReply) ProtoReflect() protoreflect.Message { + mi := &file_api_pb_threaddb_proto_msgTypes[34] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FindReply.ProtoReflect.Descriptor instead. +func (*FindReply) Descriptor() ([]byte, []int) { + return file_api_pb_threaddb_proto_rawDescGZIP(), []int{34} +} + +func (x *FindReply) GetInstances() [][]byte { + if x != nil { + return x.Instances + } + return nil +} + +func (x *FindReply) GetTransactionError() string { + if x != nil { + return x.TransactionError + } + return "" +} + +type FindByIDRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DbID []byte `protobuf:"bytes,1,opt,name=dbID,proto3" json:"dbID,omitempty"` + CollectionName string `protobuf:"bytes,2,opt,name=collectionName,proto3" json:"collectionName,omitempty"` + InstanceID string `protobuf:"bytes,3,opt,name=instanceID,proto3" json:"instanceID,omitempty"` +} + +func (x *FindByIDRequest) Reset() { + *x = FindByIDRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_pb_threaddb_proto_msgTypes[35] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FindByIDRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FindByIDRequest) ProtoMessage() {} + +func (x *FindByIDRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_pb_threaddb_proto_msgTypes[35] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FindByIDRequest.ProtoReflect.Descriptor instead. +func (*FindByIDRequest) Descriptor() ([]byte, []int) { + return file_api_pb_threaddb_proto_rawDescGZIP(), []int{35} +} + +func (x *FindByIDRequest) GetDbID() []byte { + if x != nil { + return x.DbID + } + return nil +} + +func (x *FindByIDRequest) GetCollectionName() string { + if x != nil { + return x.CollectionName + } + return "" +} + +func (x *FindByIDRequest) GetInstanceID() string { + if x != nil { + return x.InstanceID + } + return "" +} + +type FindByIDReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Instance []byte `protobuf:"bytes,1,opt,name=instance,proto3" json:"instance,omitempty"` + TransactionError string `protobuf:"bytes,2,opt,name=transactionError,proto3" json:"transactionError,omitempty"` +} + +func (x *FindByIDReply) Reset() { + *x = FindByIDReply{} + if protoimpl.UnsafeEnabled { + mi := &file_api_pb_threaddb_proto_msgTypes[36] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FindByIDReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FindByIDReply) ProtoMessage() {} + +func (x *FindByIDReply) ProtoReflect() protoreflect.Message { + mi := &file_api_pb_threaddb_proto_msgTypes[36] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FindByIDReply.ProtoReflect.Descriptor instead. +func (*FindByIDReply) Descriptor() ([]byte, []int) { + return file_api_pb_threaddb_proto_rawDescGZIP(), []int{36} +} + +func (x *FindByIDReply) GetInstance() []byte { + if x != nil { + return x.Instance + } + return nil +} + +func (x *FindByIDReply) GetTransactionError() string { + if x != nil { + return x.TransactionError + } + return "" +} + +type DiscardRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *DiscardRequest) Reset() { + *x = DiscardRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_pb_threaddb_proto_msgTypes[37] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DiscardRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DiscardRequest) ProtoMessage() {} + +func (x *DiscardRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_pb_threaddb_proto_msgTypes[37] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DiscardRequest.ProtoReflect.Descriptor instead. +func (*DiscardRequest) Descriptor() ([]byte, []int) { + return file_api_pb_threaddb_proto_rawDescGZIP(), []int{37} +} + +type DiscardReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *DiscardReply) Reset() { + *x = DiscardReply{} + if protoimpl.UnsafeEnabled { + mi := &file_api_pb_threaddb_proto_msgTypes[38] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DiscardReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DiscardReply) ProtoMessage() {} + +func (x *DiscardReply) ProtoReflect() protoreflect.Message { + mi := &file_api_pb_threaddb_proto_msgTypes[38] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DiscardReply.ProtoReflect.Descriptor instead. +func (*DiscardReply) Descriptor() ([]byte, []int) { + return file_api_pb_threaddb_proto_rawDescGZIP(), []int{38} +} + +type StartTransactionRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DbID []byte `protobuf:"bytes,1,opt,name=dbID,proto3" json:"dbID,omitempty"` + CollectionName string `protobuf:"bytes,2,opt,name=collectionName,proto3" json:"collectionName,omitempty"` +} + +func (x *StartTransactionRequest) Reset() { + *x = StartTransactionRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_pb_threaddb_proto_msgTypes[39] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StartTransactionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StartTransactionRequest) ProtoMessage() {} + +func (x *StartTransactionRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_pb_threaddb_proto_msgTypes[39] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StartTransactionRequest.ProtoReflect.Descriptor instead. +func (*StartTransactionRequest) Descriptor() ([]byte, []int) { + return file_api_pb_threaddb_proto_rawDescGZIP(), []int{39} +} + +func (x *StartTransactionRequest) GetDbID() []byte { + if x != nil { + return x.DbID + } + return nil +} + +func (x *StartTransactionRequest) GetCollectionName() string { + if x != nil { + return x.CollectionName + } + return "" +} + +type ReadTransactionRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Option: + // *ReadTransactionRequest_StartTransactionRequest + // *ReadTransactionRequest_HasRequest + // *ReadTransactionRequest_FindRequest + // *ReadTransactionRequest_FindByIDRequest + Option isReadTransactionRequest_Option `protobuf_oneof:"option"` +} + +func (x *ReadTransactionRequest) Reset() { + *x = ReadTransactionRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_pb_threaddb_proto_msgTypes[40] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReadTransactionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReadTransactionRequest) ProtoMessage() {} + +func (x *ReadTransactionRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_pb_threaddb_proto_msgTypes[40] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReadTransactionRequest.ProtoReflect.Descriptor instead. +func (*ReadTransactionRequest) Descriptor() ([]byte, []int) { + return file_api_pb_threaddb_proto_rawDescGZIP(), []int{40} +} + +func (m *ReadTransactionRequest) GetOption() isReadTransactionRequest_Option { + if m != nil { + return m.Option + } + return nil +} + +func (x *ReadTransactionRequest) GetStartTransactionRequest() *StartTransactionRequest { + if x, ok := x.GetOption().(*ReadTransactionRequest_StartTransactionRequest); ok { + return x.StartTransactionRequest + } + return nil +} + +func (x *ReadTransactionRequest) GetHasRequest() *HasRequest { + if x, ok := x.GetOption().(*ReadTransactionRequest_HasRequest); ok { + return x.HasRequest + } + return nil +} + +func (x *ReadTransactionRequest) GetFindRequest() *FindRequest { + if x, ok := x.GetOption().(*ReadTransactionRequest_FindRequest); ok { + return x.FindRequest + } + return nil +} + +func (x *ReadTransactionRequest) GetFindByIDRequest() *FindByIDRequest { + if x, ok := x.GetOption().(*ReadTransactionRequest_FindByIDRequest); ok { + return x.FindByIDRequest + } + return nil +} + +type isReadTransactionRequest_Option interface { + isReadTransactionRequest_Option() +} + +type ReadTransactionRequest_StartTransactionRequest struct { + StartTransactionRequest *StartTransactionRequest `protobuf:"bytes,1,opt,name=startTransactionRequest,proto3,oneof"` +} + +type ReadTransactionRequest_HasRequest struct { + HasRequest *HasRequest `protobuf:"bytes,2,opt,name=hasRequest,proto3,oneof"` +} + +type ReadTransactionRequest_FindRequest struct { + FindRequest *FindRequest `protobuf:"bytes,3,opt,name=findRequest,proto3,oneof"` +} + +type ReadTransactionRequest_FindByIDRequest struct { + FindByIDRequest *FindByIDRequest `protobuf:"bytes,4,opt,name=findByIDRequest,proto3,oneof"` +} + +func (*ReadTransactionRequest_StartTransactionRequest) isReadTransactionRequest_Option() {} + +func (*ReadTransactionRequest_HasRequest) isReadTransactionRequest_Option() {} + +func (*ReadTransactionRequest_FindRequest) isReadTransactionRequest_Option() {} + +func (*ReadTransactionRequest_FindByIDRequest) isReadTransactionRequest_Option() {} + +type ReadTransactionReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Option: + // *ReadTransactionReply_HasReply + // *ReadTransactionReply_FindReply + // *ReadTransactionReply_FindByIDReply + Option isReadTransactionReply_Option `protobuf_oneof:"option"` +} + +func (x *ReadTransactionReply) Reset() { + *x = ReadTransactionReply{} + if protoimpl.UnsafeEnabled { + mi := &file_api_pb_threaddb_proto_msgTypes[41] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReadTransactionReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReadTransactionReply) ProtoMessage() {} + +func (x *ReadTransactionReply) ProtoReflect() protoreflect.Message { + mi := &file_api_pb_threaddb_proto_msgTypes[41] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReadTransactionReply.ProtoReflect.Descriptor instead. +func (*ReadTransactionReply) Descriptor() ([]byte, []int) { + return file_api_pb_threaddb_proto_rawDescGZIP(), []int{41} +} + +func (m *ReadTransactionReply) GetOption() isReadTransactionReply_Option { + if m != nil { + return m.Option + } + return nil +} + +func (x *ReadTransactionReply) GetHasReply() *HasReply { + if x, ok := x.GetOption().(*ReadTransactionReply_HasReply); ok { + return x.HasReply + } + return nil +} + +func (x *ReadTransactionReply) GetFindReply() *FindReply { + if x, ok := x.GetOption().(*ReadTransactionReply_FindReply); ok { + return x.FindReply + } + return nil +} + +func (x *ReadTransactionReply) GetFindByIDReply() *FindByIDReply { + if x, ok := x.GetOption().(*ReadTransactionReply_FindByIDReply); ok { + return x.FindByIDReply + } + return nil +} + +type isReadTransactionReply_Option interface { + isReadTransactionReply_Option() +} + +type ReadTransactionReply_HasReply struct { + HasReply *HasReply `protobuf:"bytes,1,opt,name=hasReply,proto3,oneof"` +} + +type ReadTransactionReply_FindReply struct { + FindReply *FindReply `protobuf:"bytes,2,opt,name=findReply,proto3,oneof"` +} + +type ReadTransactionReply_FindByIDReply struct { + FindByIDReply *FindByIDReply `protobuf:"bytes,3,opt,name=findByIDReply,proto3,oneof"` +} + +func (*ReadTransactionReply_HasReply) isReadTransactionReply_Option() {} + +func (*ReadTransactionReply_FindReply) isReadTransactionReply_Option() {} + +func (*ReadTransactionReply_FindByIDReply) isReadTransactionReply_Option() {} + +type WriteTransactionRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Option: + // *WriteTransactionRequest_StartTransactionRequest + // *WriteTransactionRequest_CreateRequest + // *WriteTransactionRequest_VerifyRequest + // *WriteTransactionRequest_SaveRequest + // *WriteTransactionRequest_DeleteRequest + // *WriteTransactionRequest_HasRequest + // *WriteTransactionRequest_FindRequest + // *WriteTransactionRequest_FindByIDRequest + // *WriteTransactionRequest_DiscardRequest + Option isWriteTransactionRequest_Option `protobuf_oneof:"option"` +} + +func (x *WriteTransactionRequest) Reset() { + *x = WriteTransactionRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_pb_threaddb_proto_msgTypes[42] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WriteTransactionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WriteTransactionRequest) ProtoMessage() {} + +func (x *WriteTransactionRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_pb_threaddb_proto_msgTypes[42] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WriteTransactionRequest.ProtoReflect.Descriptor instead. +func (*WriteTransactionRequest) Descriptor() ([]byte, []int) { + return file_api_pb_threaddb_proto_rawDescGZIP(), []int{42} +} + +func (m *WriteTransactionRequest) GetOption() isWriteTransactionRequest_Option { + if m != nil { + return m.Option + } + return nil +} + +func (x *WriteTransactionRequest) GetStartTransactionRequest() *StartTransactionRequest { + if x, ok := x.GetOption().(*WriteTransactionRequest_StartTransactionRequest); ok { + return x.StartTransactionRequest + } + return nil +} + +func (x *WriteTransactionRequest) GetCreateRequest() *CreateRequest { + if x, ok := x.GetOption().(*WriteTransactionRequest_CreateRequest); ok { + return x.CreateRequest + } + return nil +} + +func (x *WriteTransactionRequest) GetVerifyRequest() *VerifyRequest { + if x, ok := x.GetOption().(*WriteTransactionRequest_VerifyRequest); ok { + return x.VerifyRequest + } + return nil +} + +func (x *WriteTransactionRequest) GetSaveRequest() *SaveRequest { + if x, ok := x.GetOption().(*WriteTransactionRequest_SaveRequest); ok { + return x.SaveRequest + } + return nil +} + +func (x *WriteTransactionRequest) GetDeleteRequest() *DeleteRequest { + if x, ok := x.GetOption().(*WriteTransactionRequest_DeleteRequest); ok { + return x.DeleteRequest + } + return nil +} + +func (x *WriteTransactionRequest) GetHasRequest() *HasRequest { + if x, ok := x.GetOption().(*WriteTransactionRequest_HasRequest); ok { + return x.HasRequest + } + return nil +} + +func (x *WriteTransactionRequest) GetFindRequest() *FindRequest { + if x, ok := x.GetOption().(*WriteTransactionRequest_FindRequest); ok { + return x.FindRequest + } + return nil +} + +func (x *WriteTransactionRequest) GetFindByIDRequest() *FindByIDRequest { + if x, ok := x.GetOption().(*WriteTransactionRequest_FindByIDRequest); ok { + return x.FindByIDRequest + } + return nil +} + +func (x *WriteTransactionRequest) GetDiscardRequest() *DiscardRequest { + if x, ok := x.GetOption().(*WriteTransactionRequest_DiscardRequest); ok { + return x.DiscardRequest + } + return nil +} + +type isWriteTransactionRequest_Option interface { + isWriteTransactionRequest_Option() +} + +type WriteTransactionRequest_StartTransactionRequest struct { + StartTransactionRequest *StartTransactionRequest `protobuf:"bytes,1,opt,name=startTransactionRequest,proto3,oneof"` +} + +type WriteTransactionRequest_CreateRequest struct { + CreateRequest *CreateRequest `protobuf:"bytes,2,opt,name=createRequest,proto3,oneof"` +} + +type WriteTransactionRequest_VerifyRequest struct { + VerifyRequest *VerifyRequest `protobuf:"bytes,8,opt,name=verifyRequest,proto3,oneof"` +} + +type WriteTransactionRequest_SaveRequest struct { + SaveRequest *SaveRequest `protobuf:"bytes,3,opt,name=saveRequest,proto3,oneof"` +} + +type WriteTransactionRequest_DeleteRequest struct { + DeleteRequest *DeleteRequest `protobuf:"bytes,4,opt,name=deleteRequest,proto3,oneof"` +} + +type WriteTransactionRequest_HasRequest struct { + HasRequest *HasRequest `protobuf:"bytes,5,opt,name=hasRequest,proto3,oneof"` +} + +type WriteTransactionRequest_FindRequest struct { + FindRequest *FindRequest `protobuf:"bytes,6,opt,name=findRequest,proto3,oneof"` +} + +type WriteTransactionRequest_FindByIDRequest struct { + FindByIDRequest *FindByIDRequest `protobuf:"bytes,7,opt,name=findByIDRequest,proto3,oneof"` +} + +type WriteTransactionRequest_DiscardRequest struct { + DiscardRequest *DiscardRequest `protobuf:"bytes,9,opt,name=discardRequest,proto3,oneof"` +} + +func (*WriteTransactionRequest_StartTransactionRequest) isWriteTransactionRequest_Option() {} + +func (*WriteTransactionRequest_CreateRequest) isWriteTransactionRequest_Option() {} + +func (*WriteTransactionRequest_VerifyRequest) isWriteTransactionRequest_Option() {} + +func (*WriteTransactionRequest_SaveRequest) isWriteTransactionRequest_Option() {} + +func (*WriteTransactionRequest_DeleteRequest) isWriteTransactionRequest_Option() {} + +func (*WriteTransactionRequest_HasRequest) isWriteTransactionRequest_Option() {} + +func (*WriteTransactionRequest_FindRequest) isWriteTransactionRequest_Option() {} + +func (*WriteTransactionRequest_FindByIDRequest) isWriteTransactionRequest_Option() {} + +func (*WriteTransactionRequest_DiscardRequest) isWriteTransactionRequest_Option() {} + +type WriteTransactionReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Option: + // *WriteTransactionReply_CreateReply + // *WriteTransactionReply_VerifyReply + // *WriteTransactionReply_SaveReply + // *WriteTransactionReply_DeleteReply + // *WriteTransactionReply_HasReply + // *WriteTransactionReply_FindReply + // *WriteTransactionReply_FindByIDReply + // *WriteTransactionReply_DiscardReply + Option isWriteTransactionReply_Option `protobuf_oneof:"option"` +} + +func (x *WriteTransactionReply) Reset() { + *x = WriteTransactionReply{} + if protoimpl.UnsafeEnabled { + mi := &file_api_pb_threaddb_proto_msgTypes[43] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WriteTransactionReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WriteTransactionReply) ProtoMessage() {} + +func (x *WriteTransactionReply) ProtoReflect() protoreflect.Message { + mi := &file_api_pb_threaddb_proto_msgTypes[43] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WriteTransactionReply.ProtoReflect.Descriptor instead. +func (*WriteTransactionReply) Descriptor() ([]byte, []int) { + return file_api_pb_threaddb_proto_rawDescGZIP(), []int{43} +} + +func (m *WriteTransactionReply) GetOption() isWriteTransactionReply_Option { + if m != nil { + return m.Option + } + return nil +} + +func (x *WriteTransactionReply) GetCreateReply() *CreateReply { + if x, ok := x.GetOption().(*WriteTransactionReply_CreateReply); ok { + return x.CreateReply + } + return nil +} + +func (x *WriteTransactionReply) GetVerifyReply() *VerifyReply { + if x, ok := x.GetOption().(*WriteTransactionReply_VerifyReply); ok { + return x.VerifyReply + } + return nil +} + +func (x *WriteTransactionReply) GetSaveReply() *SaveReply { + if x, ok := x.GetOption().(*WriteTransactionReply_SaveReply); ok { + return x.SaveReply + } + return nil +} + +func (x *WriteTransactionReply) GetDeleteReply() *DeleteReply { + if x, ok := x.GetOption().(*WriteTransactionReply_DeleteReply); ok { + return x.DeleteReply + } + return nil +} + +func (x *WriteTransactionReply) GetHasReply() *HasReply { + if x, ok := x.GetOption().(*WriteTransactionReply_HasReply); ok { + return x.HasReply + } + return nil +} + +func (x *WriteTransactionReply) GetFindReply() *FindReply { + if x, ok := x.GetOption().(*WriteTransactionReply_FindReply); ok { + return x.FindReply + } + return nil +} + +func (x *WriteTransactionReply) GetFindByIDReply() *FindByIDReply { + if x, ok := x.GetOption().(*WriteTransactionReply_FindByIDReply); ok { + return x.FindByIDReply + } + return nil +} + +func (x *WriteTransactionReply) GetDiscardReply() *DiscardReply { + if x, ok := x.GetOption().(*WriteTransactionReply_DiscardReply); ok { + return x.DiscardReply + } + return nil +} + +type isWriteTransactionReply_Option interface { + isWriteTransactionReply_Option() +} + +type WriteTransactionReply_CreateReply struct { + CreateReply *CreateReply `protobuf:"bytes,1,opt,name=createReply,proto3,oneof"` +} + +type WriteTransactionReply_VerifyReply struct { + VerifyReply *VerifyReply `protobuf:"bytes,7,opt,name=verifyReply,proto3,oneof"` +} + +type WriteTransactionReply_SaveReply struct { + SaveReply *SaveReply `protobuf:"bytes,2,opt,name=saveReply,proto3,oneof"` +} + +type WriteTransactionReply_DeleteReply struct { + DeleteReply *DeleteReply `protobuf:"bytes,3,opt,name=deleteReply,proto3,oneof"` +} + +type WriteTransactionReply_HasReply struct { + HasReply *HasReply `protobuf:"bytes,4,opt,name=hasReply,proto3,oneof"` +} + +type WriteTransactionReply_FindReply struct { + FindReply *FindReply `protobuf:"bytes,5,opt,name=findReply,proto3,oneof"` +} + +type WriteTransactionReply_FindByIDReply struct { + FindByIDReply *FindByIDReply `protobuf:"bytes,6,opt,name=findByIDReply,proto3,oneof"` +} + +type WriteTransactionReply_DiscardReply struct { + DiscardReply *DiscardReply `protobuf:"bytes,8,opt,name=discardReply,proto3,oneof"` +} + +func (*WriteTransactionReply_CreateReply) isWriteTransactionReply_Option() {} + +func (*WriteTransactionReply_VerifyReply) isWriteTransactionReply_Option() {} + +func (*WriteTransactionReply_SaveReply) isWriteTransactionReply_Option() {} + +func (*WriteTransactionReply_DeleteReply) isWriteTransactionReply_Option() {} + +func (*WriteTransactionReply_HasReply) isWriteTransactionReply_Option() {} + +func (*WriteTransactionReply_FindReply) isWriteTransactionReply_Option() {} + +func (*WriteTransactionReply_FindByIDReply) isWriteTransactionReply_Option() {} + +func (*WriteTransactionReply_DiscardReply) isWriteTransactionReply_Option() {} + +type ListenRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DbID []byte `protobuf:"bytes,1,opt,name=dbID,proto3" json:"dbID,omitempty"` + Filters []*ListenRequest_Filter `protobuf:"bytes,2,rep,name=filters,proto3" json:"filters,omitempty"` +} + +func (x *ListenRequest) Reset() { + *x = ListenRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_pb_threaddb_proto_msgTypes[44] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListenRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListenRequest) ProtoMessage() {} + +func (x *ListenRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_pb_threaddb_proto_msgTypes[44] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListenRequest.ProtoReflect.Descriptor instead. +func (*ListenRequest) Descriptor() ([]byte, []int) { + return file_api_pb_threaddb_proto_rawDescGZIP(), []int{44} +} + +func (x *ListenRequest) GetDbID() []byte { + if x != nil { + return x.DbID + } + return nil +} + +func (x *ListenRequest) GetFilters() []*ListenRequest_Filter { + if x != nil { + return x.Filters + } + return nil +} + +type ListenReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CollectionName string `protobuf:"bytes,1,opt,name=collectionName,proto3" json:"collectionName,omitempty"` + InstanceID string `protobuf:"bytes,2,opt,name=instanceID,proto3" json:"instanceID,omitempty"` + Action ListenReply_Action `protobuf:"varint,3,opt,name=action,proto3,enum=api.pb.ListenReply_Action" json:"action,omitempty"` + Instance []byte `protobuf:"bytes,4,opt,name=instance,proto3" json:"instance,omitempty"` +} + +func (x *ListenReply) Reset() { + *x = ListenReply{} + if protoimpl.UnsafeEnabled { + mi := &file_api_pb_threaddb_proto_msgTypes[45] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListenReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListenReply) ProtoMessage() {} + +func (x *ListenReply) ProtoReflect() protoreflect.Message { + mi := &file_api_pb_threaddb_proto_msgTypes[45] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListenReply.ProtoReflect.Descriptor instead. +func (*ListenReply) Descriptor() ([]byte, []int) { + return file_api_pb_threaddb_proto_rawDescGZIP(), []int{45} +} + +func (x *ListenReply) GetCollectionName() string { + if x != nil { + return x.CollectionName + } + return "" +} + +func (x *ListenReply) GetInstanceID() string { + if x != nil { + return x.InstanceID + } + return "" +} + +func (x *ListenReply) GetAction() ListenReply_Action { + if x != nil { + return x.Action + } + return ListenReply_CREATE +} + +func (x *ListenReply) GetInstance() []byte { + if x != nil { + return x.Instance + } + return nil +} + +type ListDBsReply_DB struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DbID []byte `protobuf:"bytes,1,opt,name=dbID,proto3" json:"dbID,omitempty"` + Info *GetDBInfoReply `protobuf:"bytes,2,opt,name=info,proto3" json:"info,omitempty"` +} + +func (x *ListDBsReply_DB) Reset() { + *x = ListDBsReply_DB{} + if protoimpl.UnsafeEnabled { + mi := &file_api_pb_threaddb_proto_msgTypes[46] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListDBsReply_DB) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListDBsReply_DB) ProtoMessage() {} + +func (x *ListDBsReply_DB) ProtoReflect() protoreflect.Message { + mi := &file_api_pb_threaddb_proto_msgTypes[46] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListDBsReply_DB.ProtoReflect.Descriptor instead. +func (*ListDBsReply_DB) Descriptor() ([]byte, []int) { + return file_api_pb_threaddb_proto_rawDescGZIP(), []int{6, 0} +} + +func (x *ListDBsReply_DB) GetDbID() []byte { + if x != nil { + return x.DbID + } + return nil +} + +func (x *ListDBsReply_DB) GetInfo() *GetDBInfoReply { + if x != nil { + return x.Info + } + return nil +} + +type ListenRequest_Filter struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CollectionName string `protobuf:"bytes,1,opt,name=collectionName,proto3" json:"collectionName,omitempty"` + InstanceID string `protobuf:"bytes,2,opt,name=instanceID,proto3" json:"instanceID,omitempty"` + Action ListenRequest_Filter_Action `protobuf:"varint,3,opt,name=action,proto3,enum=api.pb.ListenRequest_Filter_Action" json:"action,omitempty"` +} + +func (x *ListenRequest_Filter) Reset() { + *x = ListenRequest_Filter{} + if protoimpl.UnsafeEnabled { + mi := &file_api_pb_threaddb_proto_msgTypes[47] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListenRequest_Filter) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListenRequest_Filter) ProtoMessage() {} + +func (x *ListenRequest_Filter) ProtoReflect() protoreflect.Message { + mi := &file_api_pb_threaddb_proto_msgTypes[47] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListenRequest_Filter.ProtoReflect.Descriptor instead. +func (*ListenRequest_Filter) Descriptor() ([]byte, []int) { + return file_api_pb_threaddb_proto_rawDescGZIP(), []int{44, 0} +} + +func (x *ListenRequest_Filter) GetCollectionName() string { + if x != nil { + return x.CollectionName + } + return "" +} + +func (x *ListenRequest_Filter) GetInstanceID() string { + if x != nil { + return x.InstanceID + } + return "" +} + +func (x *ListenRequest_Filter) GetAction() ListenRequest_Filter_Action { + if x != nil { + return x.Action + } + return ListenRequest_Filter_ALL +} + +var File_api_pb_threaddb_proto protoreflect.FileDescriptor + +var file_api_pb_threaddb_proto_rawDesc = []byte{ + 0x0a, 0x15, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x62, 0x2f, 0x74, 0x68, 0x72, 0x65, 0x61, 0x64, 0x64, + 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x22, + 0xb6, 0x01, 0x0a, 0x0c, 0x4e, 0x65, 0x77, 0x44, 0x42, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x12, 0x0a, 0x04, 0x64, 0x62, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, + 0x64, 0x62, 0x49, 0x44, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x6f, 0x67, 0x4b, 0x65, 0x79, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x6c, 0x6f, 0x67, 0x4b, 0x65, 0x79, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x3a, 0x0a, 0x0b, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, + 0x2e, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x52, 0x0b, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x18, + 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x42, 0x02, 0x18, + 0x01, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0xdc, 0x01, 0x0a, 0x14, 0x4e, 0x65, 0x77, + 0x44, 0x42, 0x46, 0x72, 0x6f, 0x6d, 0x41, 0x64, 0x64, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x6f, 0x67, 0x4b, 0x65, + 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x6c, 0x6f, 0x67, 0x4b, 0x65, 0x79, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x3a, 0x0a, 0x0b, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, + 0x62, 0x2e, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x52, 0x0b, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, + 0x14, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x20, 0x0a, 0x09, 0x74, 0x68, 0x72, 0x65, 0x61, 0x64, 0x4b, + 0x65, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x02, 0x18, 0x01, 0x52, 0x09, 0x74, 0x68, + 0x72, 0x65, 0x61, 0x64, 0x4b, 0x65, 0x79, 0x22, 0xaf, 0x01, 0x0a, 0x10, 0x43, 0x6f, 0x6c, 0x6c, + 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x27, 0x0a, 0x07, 0x69, 0x6e, 0x64, 0x65, + 0x78, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x70, 0x62, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x07, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x65, + 0x73, 0x12, 0x26, 0x0a, 0x0e, 0x77, 0x72, 0x69, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x77, 0x72, 0x69, 0x74, 0x65, + 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x61, + 0x64, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, + 0x65, 0x61, 0x64, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0x33, 0x0a, 0x05, 0x49, 0x6e, 0x64, + 0x65, 0x78, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x22, 0x0c, + 0x0a, 0x0a, 0x4e, 0x65, 0x77, 0x44, 0x42, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x10, 0x0a, 0x0e, + 0x4c, 0x69, 0x73, 0x74, 0x44, 0x42, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x7f, + 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x42, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x29, + 0x0a, 0x03, 0x64, 0x62, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x42, 0x73, 0x52, 0x65, 0x70, 0x6c, + 0x79, 0x2e, 0x44, 0x42, 0x52, 0x03, 0x64, 0x62, 0x73, 0x1a, 0x44, 0x0a, 0x02, 0x44, 0x42, 0x12, + 0x12, 0x0a, 0x04, 0x64, 0x62, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, + 0x62, 0x49, 0x44, 0x12, 0x2a, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x42, + 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x22, + 0x26, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x44, 0x42, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x62, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x04, 0x64, 0x62, 0x49, 0x44, 0x22, 0x4c, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x44, 0x42, + 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x64, 0x64, + 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x05, 0x61, 0x64, 0x64, 0x72, 0x73, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x25, 0x0a, 0x0f, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, + 0x42, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x62, 0x49, 0x44, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x62, 0x49, 0x44, 0x22, 0x0f, 0x0a, 0x0d, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, 0x42, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x5c, 0x0a, + 0x14, 0x4e, 0x65, 0x77, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x62, 0x49, 0x44, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x62, 0x49, 0x44, 0x12, 0x30, 0x0a, 0x06, 0x63, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x14, 0x0a, 0x12, 0x4e, + 0x65, 0x77, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, + 0x79, 0x22, 0x5f, 0x0a, 0x17, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, + 0x64, 0x62, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x62, 0x49, 0x44, + 0x12, 0x30, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x18, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x22, 0x17, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6c, 0x6c, + 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x41, 0x0a, 0x17, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x62, 0x49, 0x44, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x62, 0x49, 0x44, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x17, + 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x42, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x43, 0x6f, + 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x62, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x04, 0x64, 0x62, 0x49, 0x44, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xb5, 0x01, 0x0a, 0x16, + 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, + 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, + 0x68, 0x65, 0x6d, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, + 0x6d, 0x61, 0x12, 0x27, 0x0a, 0x07, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x73, 0x18, 0x03, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x49, 0x6e, 0x64, + 0x65, 0x78, 0x52, 0x07, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x73, 0x12, 0x26, 0x0a, 0x0e, 0x77, + 0x72, 0x69, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0e, 0x77, 0x72, 0x69, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x46, 0x69, 0x6c, 0x74, 0x65, + 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x46, 0x69, 0x6c, + 0x74, 0x65, 0x72, 0x22, 0x45, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x62, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x04, 0x64, 0x62, 0x49, 0x44, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x44, 0x0a, 0x19, 0x47, 0x65, + 0x74, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, + 0x65, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x27, 0x0a, 0x07, 0x69, 0x6e, 0x64, 0x65, 0x78, + 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, + 0x62, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x07, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x73, + 0x22, 0x2c, 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x62, + 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x62, 0x49, 0x44, 0x22, 0x58, + 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x40, 0x0a, 0x0b, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x52, 0x0b, 0x63, 0x6f, 0x6c, + 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x69, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x62, 0x49, + 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x62, 0x49, 0x44, 0x12, 0x26, 0x0a, + 0x0e, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, + 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x09, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, + 0x63, 0x65, 0x73, 0x22, 0x5b, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, + 0x6c, 0x79, 0x12, 0x20, 0x0a, 0x0b, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x49, 0x44, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, + 0x65, 0x49, 0x44, 0x73, 0x12, 0x2a, 0x0a, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, + 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, + 0x22, 0x69, 0x0a, 0x0d, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x62, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x04, 0x64, 0x62, 0x49, 0x44, 0x12, 0x26, 0x0a, 0x0e, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, + 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, + 0x09, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, + 0x52, 0x09, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x22, 0x39, 0x0a, 0x0b, 0x56, + 0x65, 0x72, 0x69, 0x66, 0x79, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x2a, 0x0a, 0x10, 0x74, 0x72, + 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x67, 0x0a, 0x0b, 0x53, 0x61, 0x76, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x62, 0x49, 0x44, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x62, 0x49, 0x44, 0x12, 0x26, 0x0a, 0x0e, 0x63, 0x6f, 0x6c, + 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0e, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, + 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x0c, 0x52, 0x09, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x22, + 0x37, 0x0a, 0x09, 0x53, 0x61, 0x76, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x2a, 0x0a, 0x10, + 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x6d, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x62, 0x49, + 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x62, 0x49, 0x44, 0x12, 0x26, 0x0a, + 0x0e, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, + 0x65, 0x49, 0x44, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x69, 0x6e, 0x73, 0x74, + 0x61, 0x6e, 0x63, 0x65, 0x49, 0x44, 0x73, 0x22, 0x39, 0x0a, 0x0b, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x2a, 0x0a, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x72, 0x72, + 0x6f, 0x72, 0x22, 0x6a, 0x0a, 0x0a, 0x48, 0x61, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x12, 0x0a, 0x04, 0x64, 0x62, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, + 0x64, 0x62, 0x49, 0x44, 0x12, 0x26, 0x0a, 0x0e, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6f, + 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, + 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x49, 0x44, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x0b, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x49, 0x44, 0x73, 0x22, 0x4e, + 0x0a, 0x08, 0x48, 0x61, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x78, + 0x69, 0x73, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x78, 0x69, 0x73, + 0x74, 0x73, 0x12, 0x2a, 0x0a, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x74, 0x72, + 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x67, + 0x0a, 0x0b, 0x46, 0x69, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, + 0x04, 0x64, 0x62, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x62, 0x49, + 0x44, 0x12, 0x26, 0x0a, 0x0e, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4e, + 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6f, 0x6c, 0x6c, 0x65, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x71, 0x75, 0x65, + 0x72, 0x79, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x71, 0x75, + 0x65, 0x72, 0x79, 0x4a, 0x53, 0x4f, 0x4e, 0x22, 0x55, 0x0a, 0x09, 0x46, 0x69, 0x6e, 0x64, 0x52, + 0x65, 0x70, 0x6c, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x09, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, + 0x65, 0x73, 0x12, 0x2a, 0x0a, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x74, 0x72, + 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x6d, + 0x0a, 0x0f, 0x46, 0x69, 0x6e, 0x64, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x62, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x04, 0x64, 0x62, 0x49, 0x44, 0x12, 0x26, 0x0a, 0x0e, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, + 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, + 0x0a, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x49, 0x44, 0x22, 0x57, 0x0a, + 0x0d, 0x46, 0x69, 0x6e, 0x64, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x1a, + 0x0a, 0x08, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x08, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x2a, 0x0a, 0x10, 0x74, 0x72, + 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x10, 0x0a, 0x0e, 0x44, 0x69, 0x73, 0x63, 0x61, 0x72, + 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x0e, 0x0a, 0x0c, 0x44, 0x69, 0x73, 0x63, + 0x61, 0x72, 0x64, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x55, 0x0a, 0x17, 0x53, 0x74, 0x61, 0x72, + 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x62, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x04, 0x64, 0x62, 0x49, 0x44, 0x12, 0x26, 0x0a, 0x0e, 0x63, 0x6f, 0x6c, 0x6c, 0x65, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0e, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x22, + 0xb3, 0x02, 0x0a, 0x16, 0x52, 0x65, 0x61, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x5b, 0x0a, 0x17, 0x73, 0x74, + 0x61, 0x72, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x17, + 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x34, 0x0a, 0x0a, 0x68, 0x61, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x48, 0x61, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, + 0x00, 0x52, 0x0a, 0x68, 0x61, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x37, 0x0a, + 0x0b, 0x66, 0x69, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0b, 0x66, 0x69, 0x6e, 0x64, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x43, 0x0a, 0x0f, 0x66, 0x69, 0x6e, 0x64, 0x42, 0x79, + 0x49, 0x44, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x17, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x42, 0x79, 0x49, + 0x44, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0f, 0x66, 0x69, 0x6e, 0x64, + 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x08, 0x0a, 0x06, 0x6f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xc2, 0x01, 0x0a, 0x14, 0x52, 0x65, 0x61, 0x64, 0x54, 0x72, + 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x2e, + 0x0a, 0x08, 0x68, 0x61, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x48, 0x61, 0x73, 0x52, 0x65, 0x70, + 0x6c, 0x79, 0x48, 0x00, 0x52, 0x08, 0x68, 0x61, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x31, + 0x0a, 0x09, 0x66, 0x69, 0x6e, 0x64, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x52, + 0x65, 0x70, 0x6c, 0x79, 0x48, 0x00, 0x52, 0x09, 0x66, 0x69, 0x6e, 0x64, 0x52, 0x65, 0x70, 0x6c, + 0x79, 0x12, 0x3d, 0x0a, 0x0d, 0x66, 0x69, 0x6e, 0x64, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, 0x70, + 0x6c, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, + 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x48, + 0x00, 0x52, 0x0d, 0x66, 0x69, 0x6e, 0x64, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, 0x70, 0x6c, 0x79, + 0x42, 0x08, 0x0a, 0x06, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xec, 0x04, 0x0a, 0x17, 0x57, + 0x72, 0x69, 0x74, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x5b, 0x0a, 0x17, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, + 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, + 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x17, 0x73, 0x74, 0x61, 0x72, + 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x0d, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x48, 0x00, 0x52, 0x0d, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x0d, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x70, 0x62, 0x2e, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x48, 0x00, 0x52, 0x0d, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x37, 0x0a, 0x0b, 0x73, 0x61, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, + 0x53, 0x61, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0b, 0x73, + 0x61, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x0d, 0x64, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x15, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0d, 0x64, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x34, 0x0a, 0x0a, 0x68, 0x61, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x48, 0x61, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x48, 0x00, 0x52, 0x0a, 0x68, 0x61, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x37, 0x0a, 0x0b, 0x66, 0x69, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, + 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0b, 0x66, 0x69, 0x6e, + 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x43, 0x0a, 0x0f, 0x66, 0x69, 0x6e, 0x64, + 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x17, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x42, + 0x79, 0x49, 0x44, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0f, 0x66, 0x69, + 0x6e, 0x64, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x40, 0x0a, + 0x0e, 0x64, 0x69, 0x73, 0x63, 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, + 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x44, + 0x69, 0x73, 0x63, 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, + 0x0e, 0x64, 0x69, 0x73, 0x63, 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, + 0x08, 0x0a, 0x06, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xdd, 0x03, 0x0a, 0x15, 0x57, 0x72, + 0x69, 0x74, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x70, 0x6c, 0x79, 0x12, 0x37, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, + 0x6c, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, + 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x48, 0x00, 0x52, + 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x37, 0x0a, 0x0b, + 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x56, 0x65, 0x72, 0x69, 0x66, + 0x79, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x48, 0x00, 0x52, 0x0b, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, + 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x31, 0x0a, 0x09, 0x73, 0x61, 0x76, 0x65, 0x52, 0x65, 0x70, + 0x6c, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, + 0x62, 0x2e, 0x53, 0x61, 0x76, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x48, 0x00, 0x52, 0x09, 0x73, + 0x61, 0x76, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x37, 0x0a, 0x0b, 0x64, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x70, + 0x6c, 0x79, 0x48, 0x00, 0x52, 0x0b, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6c, + 0x79, 0x12, 0x2e, 0x0a, 0x08, 0x68, 0x61, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x48, 0x61, 0x73, + 0x52, 0x65, 0x70, 0x6c, 0x79, 0x48, 0x00, 0x52, 0x08, 0x68, 0x61, 0x73, 0x52, 0x65, 0x70, 0x6c, + 0x79, 0x12, 0x31, 0x0a, 0x09, 0x66, 0x69, 0x6e, 0x64, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, + 0x6e, 0x64, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x48, 0x00, 0x52, 0x09, 0x66, 0x69, 0x6e, 0x64, 0x52, + 0x65, 0x70, 0x6c, 0x79, 0x12, 0x3d, 0x0a, 0x0d, 0x66, 0x69, 0x6e, 0x64, 0x42, 0x79, 0x49, 0x44, + 0x52, 0x65, 0x70, 0x6c, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, 0x70, + 0x6c, 0x79, 0x48, 0x00, 0x52, 0x0d, 0x66, 0x69, 0x6e, 0x64, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, + 0x70, 0x6c, 0x79, 0x12, 0x3a, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x63, 0x61, 0x72, 0x64, 0x52, 0x65, + 0x70, 0x6c, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x70, 0x62, 0x2e, 0x44, 0x69, 0x73, 0x63, 0x61, 0x72, 0x64, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x48, + 0x00, 0x52, 0x0c, 0x64, 0x69, 0x73, 0x63, 0x61, 0x72, 0x64, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x42, + 0x08, 0x0a, 0x06, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xa0, 0x02, 0x0a, 0x0d, 0x4c, 0x69, + 0x73, 0x74, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, + 0x62, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x62, 0x49, 0x44, 0x12, + 0x36, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x07, + 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x1a, 0xc2, 0x01, 0x0a, 0x06, 0x46, 0x69, 0x6c, 0x74, + 0x65, 0x72, 0x12, 0x26, 0x0a, 0x0e, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6f, 0x6c, 0x6c, + 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x6e, + 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, + 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x49, 0x44, 0x12, 0x3b, 0x0a, 0x06, 0x61, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x33, 0x0a, 0x06, 0x41, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x07, 0x0a, 0x03, 0x41, 0x4c, 0x4c, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x43, 0x52, + 0x45, 0x41, 0x54, 0x45, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x53, 0x41, 0x56, 0x45, 0x10, 0x02, + 0x12, 0x0a, 0x0a, 0x06, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x10, 0x03, 0x22, 0xd1, 0x01, 0x0a, + 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x26, 0x0a, 0x0e, + 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, + 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, + 0x63, 0x65, 0x49, 0x44, 0x12, 0x32, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x65, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x6e, 0x73, 0x74, + 0x61, 0x6e, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x69, 0x6e, 0x73, 0x74, + 0x61, 0x6e, 0x63, 0x65, 0x22, 0x2a, 0x0a, 0x06, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0a, + 0x0a, 0x06, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x53, 0x41, + 0x56, 0x45, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x10, 0x02, + 0x32, 0xae, 0x0b, 0x0a, 0x0a, 0x41, 0x50, 0x49, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, + 0x33, 0x0a, 0x05, 0x4e, 0x65, 0x77, 0x44, 0x42, 0x12, 0x14, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, + 0x62, 0x2e, 0x4e, 0x65, 0x77, 0x44, 0x42, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x65, 0x77, 0x44, 0x42, 0x52, 0x65, 0x70, + 0x6c, 0x79, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x0d, 0x4e, 0x65, 0x77, 0x44, 0x42, 0x46, 0x72, 0x6f, + 0x6d, 0x41, 0x64, 0x64, 0x72, 0x12, 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x4e, + 0x65, 0x77, 0x44, 0x42, 0x46, 0x72, 0x6f, 0x6d, 0x41, 0x64, 0x64, 0x72, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x65, 0x77, + 0x44, 0x42, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x39, 0x0a, 0x07, 0x4c, 0x69, 0x73, + 0x74, 0x44, 0x42, 0x73, 0x12, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x44, 0x42, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x42, 0x73, 0x52, 0x65, 0x70, + 0x6c, 0x79, 0x22, 0x00, 0x12, 0x3f, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x44, 0x42, 0x49, 0x6e, 0x66, + 0x6f, 0x12, 0x18, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x42, + 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x42, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, + 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x3c, 0x0a, 0x08, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, + 0x42, 0x12, 0x17, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x44, 0x42, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, 0x42, 0x52, 0x65, 0x70, 0x6c, + 0x79, 0x22, 0x00, 0x12, 0x4b, 0x0a, 0x0d, 0x4e, 0x65, 0x77, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x65, + 0x77, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x65, 0x77, 0x43, + 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, + 0x12, 0x54, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x54, 0x0a, 0x10, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x57, 0x0a, 0x11, + 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, + 0x6f, 0x12, 0x20, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, + 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, + 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, + 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x63, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6c, 0x6c, + 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x73, 0x12, 0x23, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x43, + 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x73, + 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x03, 0x88, 0x02, 0x01, 0x12, 0x51, 0x0a, 0x0f, 0x4c, 0x69, + 0x73, 0x74, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1e, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6c, 0x6c, 0x65, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6c, 0x6c, 0x65, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x36, 0x0a, + 0x06, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x15, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, + 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x36, 0x0a, 0x06, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x12, + 0x15, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, + 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x30, 0x0a, + 0x04, 0x53, 0x61, 0x76, 0x65, 0x12, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x53, + 0x61, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x61, 0x76, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, + 0x36, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x15, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x2d, 0x0a, 0x03, 0x48, 0x61, 0x73, 0x12, 0x12, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x48, 0x61, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x48, 0x61, 0x73, 0x52, + 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x30, 0x0a, 0x04, 0x46, 0x69, 0x6e, 0x64, 0x12, 0x13, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, + 0x64, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x3c, 0x0a, 0x08, 0x46, 0x69, 0x6e, 0x64, + 0x42, 0x79, 0x49, 0x44, 0x12, 0x17, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, + 0x6e, 0x64, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x42, 0x79, 0x49, 0x44, 0x52, + 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x55, 0x0a, 0x0f, 0x52, 0x65, 0x61, 0x64, 0x54, 0x72, + 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x70, 0x62, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x70, 0x62, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x12, 0x58, 0x0a, + 0x10, 0x57, 0x72, 0x69, 0x74, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x1f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, + 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x57, 0x72, 0x69, 0x74, + 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, + 0x79, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x12, 0x38, 0x0a, 0x06, 0x4c, 0x69, 0x73, 0x74, 0x65, + 0x6e, 0x12, 0x15, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x65, + 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, + 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x30, + 0x01, 0x42, 0x28, 0x5a, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x74, 0x65, 0x78, 0x74, 0x69, 0x6c, 0x65, 0x69, 0x6f, 0x2f, 0x67, 0x6f, 0x2d, 0x62, 0x75, 0x63, + 0x6b, 0x65, 0x74, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var ( + file_api_pb_threaddb_proto_rawDescOnce sync.Once + file_api_pb_threaddb_proto_rawDescData = file_api_pb_threaddb_proto_rawDesc +) + +func file_api_pb_threaddb_proto_rawDescGZIP() []byte { + file_api_pb_threaddb_proto_rawDescOnce.Do(func() { + file_api_pb_threaddb_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_pb_threaddb_proto_rawDescData) + }) + return file_api_pb_threaddb_proto_rawDescData +} + +var file_api_pb_threaddb_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_api_pb_threaddb_proto_msgTypes = make([]protoimpl.MessageInfo, 48) +var file_api_pb_threaddb_proto_goTypes = []interface{}{ + (ListenRequest_Filter_Action)(0), // 0: api.pb.ListenRequest.Filter.Action + (ListenReply_Action)(0), // 1: api.pb.ListenReply.Action + (*NewDBRequest)(nil), // 2: api.pb.NewDBRequest + (*NewDBFromAddrRequest)(nil), // 3: api.pb.NewDBFromAddrRequest + (*CollectionConfig)(nil), // 4: api.pb.CollectionConfig + (*Index)(nil), // 5: api.pb.Index + (*NewDBReply)(nil), // 6: api.pb.NewDBReply + (*ListDBsRequest)(nil), // 7: api.pb.ListDBsRequest + (*ListDBsReply)(nil), // 8: api.pb.ListDBsReply + (*GetDBInfoRequest)(nil), // 9: api.pb.GetDBInfoRequest + (*GetDBInfoReply)(nil), // 10: api.pb.GetDBInfoReply + (*DeleteDBRequest)(nil), // 11: api.pb.DeleteDBRequest + (*DeleteDBReply)(nil), // 12: api.pb.DeleteDBReply + (*NewCollectionRequest)(nil), // 13: api.pb.NewCollectionRequest + (*NewCollectionReply)(nil), // 14: api.pb.NewCollectionReply + (*UpdateCollectionRequest)(nil), // 15: api.pb.UpdateCollectionRequest + (*UpdateCollectionReply)(nil), // 16: api.pb.UpdateCollectionReply + (*DeleteCollectionRequest)(nil), // 17: api.pb.DeleteCollectionRequest + (*DeleteCollectionReply)(nil), // 18: api.pb.DeleteCollectionReply + (*GetCollectionInfoRequest)(nil), // 19: api.pb.GetCollectionInfoRequest + (*GetCollectionInfoReply)(nil), // 20: api.pb.GetCollectionInfoReply + (*GetCollectionIndexesRequest)(nil), // 21: api.pb.GetCollectionIndexesRequest + (*GetCollectionIndexesReply)(nil), // 22: api.pb.GetCollectionIndexesReply + (*ListCollectionsRequest)(nil), // 23: api.pb.ListCollectionsRequest + (*ListCollectionsReply)(nil), // 24: api.pb.ListCollectionsReply + (*CreateRequest)(nil), // 25: api.pb.CreateRequest + (*CreateReply)(nil), // 26: api.pb.CreateReply + (*VerifyRequest)(nil), // 27: api.pb.VerifyRequest + (*VerifyReply)(nil), // 28: api.pb.VerifyReply + (*SaveRequest)(nil), // 29: api.pb.SaveRequest + (*SaveReply)(nil), // 30: api.pb.SaveReply + (*DeleteRequest)(nil), // 31: api.pb.DeleteRequest + (*DeleteReply)(nil), // 32: api.pb.DeleteReply + (*HasRequest)(nil), // 33: api.pb.HasRequest + (*HasReply)(nil), // 34: api.pb.HasReply + (*FindRequest)(nil), // 35: api.pb.FindRequest + (*FindReply)(nil), // 36: api.pb.FindReply + (*FindByIDRequest)(nil), // 37: api.pb.FindByIDRequest + (*FindByIDReply)(nil), // 38: api.pb.FindByIDReply + (*DiscardRequest)(nil), // 39: api.pb.DiscardRequest + (*DiscardReply)(nil), // 40: api.pb.DiscardReply + (*StartTransactionRequest)(nil), // 41: api.pb.StartTransactionRequest + (*ReadTransactionRequest)(nil), // 42: api.pb.ReadTransactionRequest + (*ReadTransactionReply)(nil), // 43: api.pb.ReadTransactionReply + (*WriteTransactionRequest)(nil), // 44: api.pb.WriteTransactionRequest + (*WriteTransactionReply)(nil), // 45: api.pb.WriteTransactionReply + (*ListenRequest)(nil), // 46: api.pb.ListenRequest + (*ListenReply)(nil), // 47: api.pb.ListenReply + (*ListDBsReply_DB)(nil), // 48: api.pb.ListDBsReply.DB + (*ListenRequest_Filter)(nil), // 49: api.pb.ListenRequest.Filter +} +var file_api_pb_threaddb_proto_depIdxs = []int32{ + 4, // 0: api.pb.NewDBRequest.collections:type_name -> api.pb.CollectionConfig + 4, // 1: api.pb.NewDBFromAddrRequest.collections:type_name -> api.pb.CollectionConfig + 5, // 2: api.pb.CollectionConfig.indexes:type_name -> api.pb.Index + 48, // 3: api.pb.ListDBsReply.dbs:type_name -> api.pb.ListDBsReply.DB + 4, // 4: api.pb.NewCollectionRequest.config:type_name -> api.pb.CollectionConfig + 4, // 5: api.pb.UpdateCollectionRequest.config:type_name -> api.pb.CollectionConfig + 5, // 6: api.pb.GetCollectionInfoReply.indexes:type_name -> api.pb.Index + 5, // 7: api.pb.GetCollectionIndexesReply.indexes:type_name -> api.pb.Index + 20, // 8: api.pb.ListCollectionsReply.collections:type_name -> api.pb.GetCollectionInfoReply + 41, // 9: api.pb.ReadTransactionRequest.startTransactionRequest:type_name -> api.pb.StartTransactionRequest + 33, // 10: api.pb.ReadTransactionRequest.hasRequest:type_name -> api.pb.HasRequest + 35, // 11: api.pb.ReadTransactionRequest.findRequest:type_name -> api.pb.FindRequest + 37, // 12: api.pb.ReadTransactionRequest.findByIDRequest:type_name -> api.pb.FindByIDRequest + 34, // 13: api.pb.ReadTransactionReply.hasReply:type_name -> api.pb.HasReply + 36, // 14: api.pb.ReadTransactionReply.findReply:type_name -> api.pb.FindReply + 38, // 15: api.pb.ReadTransactionReply.findByIDReply:type_name -> api.pb.FindByIDReply + 41, // 16: api.pb.WriteTransactionRequest.startTransactionRequest:type_name -> api.pb.StartTransactionRequest + 25, // 17: api.pb.WriteTransactionRequest.createRequest:type_name -> api.pb.CreateRequest + 27, // 18: api.pb.WriteTransactionRequest.verifyRequest:type_name -> api.pb.VerifyRequest + 29, // 19: api.pb.WriteTransactionRequest.saveRequest:type_name -> api.pb.SaveRequest + 31, // 20: api.pb.WriteTransactionRequest.deleteRequest:type_name -> api.pb.DeleteRequest + 33, // 21: api.pb.WriteTransactionRequest.hasRequest:type_name -> api.pb.HasRequest + 35, // 22: api.pb.WriteTransactionRequest.findRequest:type_name -> api.pb.FindRequest + 37, // 23: api.pb.WriteTransactionRequest.findByIDRequest:type_name -> api.pb.FindByIDRequest + 39, // 24: api.pb.WriteTransactionRequest.discardRequest:type_name -> api.pb.DiscardRequest + 26, // 25: api.pb.WriteTransactionReply.createReply:type_name -> api.pb.CreateReply + 28, // 26: api.pb.WriteTransactionReply.verifyReply:type_name -> api.pb.VerifyReply + 30, // 27: api.pb.WriteTransactionReply.saveReply:type_name -> api.pb.SaveReply + 32, // 28: api.pb.WriteTransactionReply.deleteReply:type_name -> api.pb.DeleteReply + 34, // 29: api.pb.WriteTransactionReply.hasReply:type_name -> api.pb.HasReply + 36, // 30: api.pb.WriteTransactionReply.findReply:type_name -> api.pb.FindReply + 38, // 31: api.pb.WriteTransactionReply.findByIDReply:type_name -> api.pb.FindByIDReply + 40, // 32: api.pb.WriteTransactionReply.discardReply:type_name -> api.pb.DiscardReply + 49, // 33: api.pb.ListenRequest.filters:type_name -> api.pb.ListenRequest.Filter + 1, // 34: api.pb.ListenReply.action:type_name -> api.pb.ListenReply.Action + 10, // 35: api.pb.ListDBsReply.DB.info:type_name -> api.pb.GetDBInfoReply + 0, // 36: api.pb.ListenRequest.Filter.action:type_name -> api.pb.ListenRequest.Filter.Action + 2, // 37: api.pb.APIService.NewDB:input_type -> api.pb.NewDBRequest + 3, // 38: api.pb.APIService.NewDBFromAddr:input_type -> api.pb.NewDBFromAddrRequest + 7, // 39: api.pb.APIService.ListDBs:input_type -> api.pb.ListDBsRequest + 9, // 40: api.pb.APIService.GetDBInfo:input_type -> api.pb.GetDBInfoRequest + 11, // 41: api.pb.APIService.DeleteDB:input_type -> api.pb.DeleteDBRequest + 13, // 42: api.pb.APIService.NewCollection:input_type -> api.pb.NewCollectionRequest + 15, // 43: api.pb.APIService.UpdateCollection:input_type -> api.pb.UpdateCollectionRequest + 17, // 44: api.pb.APIService.DeleteCollection:input_type -> api.pb.DeleteCollectionRequest + 19, // 45: api.pb.APIService.GetCollectionInfo:input_type -> api.pb.GetCollectionInfoRequest + 21, // 46: api.pb.APIService.GetCollectionIndexes:input_type -> api.pb.GetCollectionIndexesRequest + 23, // 47: api.pb.APIService.ListCollections:input_type -> api.pb.ListCollectionsRequest + 25, // 48: api.pb.APIService.Create:input_type -> api.pb.CreateRequest + 27, // 49: api.pb.APIService.Verify:input_type -> api.pb.VerifyRequest + 29, // 50: api.pb.APIService.Save:input_type -> api.pb.SaveRequest + 31, // 51: api.pb.APIService.Delete:input_type -> api.pb.DeleteRequest + 33, // 52: api.pb.APIService.Has:input_type -> api.pb.HasRequest + 35, // 53: api.pb.APIService.Find:input_type -> api.pb.FindRequest + 37, // 54: api.pb.APIService.FindByID:input_type -> api.pb.FindByIDRequest + 42, // 55: api.pb.APIService.ReadTransaction:input_type -> api.pb.ReadTransactionRequest + 44, // 56: api.pb.APIService.WriteTransaction:input_type -> api.pb.WriteTransactionRequest + 46, // 57: api.pb.APIService.Listen:input_type -> api.pb.ListenRequest + 6, // 58: api.pb.APIService.NewDB:output_type -> api.pb.NewDBReply + 6, // 59: api.pb.APIService.NewDBFromAddr:output_type -> api.pb.NewDBReply + 8, // 60: api.pb.APIService.ListDBs:output_type -> api.pb.ListDBsReply + 10, // 61: api.pb.APIService.GetDBInfo:output_type -> api.pb.GetDBInfoReply + 12, // 62: api.pb.APIService.DeleteDB:output_type -> api.pb.DeleteDBReply + 14, // 63: api.pb.APIService.NewCollection:output_type -> api.pb.NewCollectionReply + 16, // 64: api.pb.APIService.UpdateCollection:output_type -> api.pb.UpdateCollectionReply + 18, // 65: api.pb.APIService.DeleteCollection:output_type -> api.pb.DeleteCollectionReply + 20, // 66: api.pb.APIService.GetCollectionInfo:output_type -> api.pb.GetCollectionInfoReply + 22, // 67: api.pb.APIService.GetCollectionIndexes:output_type -> api.pb.GetCollectionIndexesReply + 24, // 68: api.pb.APIService.ListCollections:output_type -> api.pb.ListCollectionsReply + 26, // 69: api.pb.APIService.Create:output_type -> api.pb.CreateReply + 28, // 70: api.pb.APIService.Verify:output_type -> api.pb.VerifyReply + 30, // 71: api.pb.APIService.Save:output_type -> api.pb.SaveReply + 32, // 72: api.pb.APIService.Delete:output_type -> api.pb.DeleteReply + 34, // 73: api.pb.APIService.Has:output_type -> api.pb.HasReply + 36, // 74: api.pb.APIService.Find:output_type -> api.pb.FindReply + 38, // 75: api.pb.APIService.FindByID:output_type -> api.pb.FindByIDReply + 43, // 76: api.pb.APIService.ReadTransaction:output_type -> api.pb.ReadTransactionReply + 45, // 77: api.pb.APIService.WriteTransaction:output_type -> api.pb.WriteTransactionReply + 47, // 78: api.pb.APIService.Listen:output_type -> api.pb.ListenReply + 58, // [58:79] is the sub-list for method output_type + 37, // [37:58] is the sub-list for method input_type + 37, // [37:37] is the sub-list for extension type_name + 37, // [37:37] is the sub-list for extension extendee + 0, // [0:37] is the sub-list for field type_name +} + +func init() { file_api_pb_threaddb_proto_init() } +func file_api_pb_threaddb_proto_init() { + if File_api_pb_threaddb_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_api_pb_threaddb_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NewDBRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_pb_threaddb_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NewDBFromAddrRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_pb_threaddb_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CollectionConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_pb_threaddb_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Index); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_pb_threaddb_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NewDBReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_pb_threaddb_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListDBsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_pb_threaddb_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListDBsReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_pb_threaddb_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetDBInfoRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_pb_threaddb_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetDBInfoReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_pb_threaddb_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteDBRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_pb_threaddb_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteDBReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_pb_threaddb_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NewCollectionRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_pb_threaddb_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NewCollectionReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_pb_threaddb_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateCollectionRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_pb_threaddb_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateCollectionReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_pb_threaddb_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteCollectionRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_pb_threaddb_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteCollectionReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_pb_threaddb_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetCollectionInfoRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_pb_threaddb_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetCollectionInfoReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_pb_threaddb_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetCollectionIndexesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_pb_threaddb_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetCollectionIndexesReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_pb_threaddb_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListCollectionsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_pb_threaddb_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListCollectionsReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_pb_threaddb_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_pb_threaddb_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_pb_threaddb_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*VerifyRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_pb_threaddb_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*VerifyReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_pb_threaddb_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SaveRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_pb_threaddb_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SaveReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_pb_threaddb_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_pb_threaddb_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_pb_threaddb_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HasRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_pb_threaddb_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HasReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_pb_threaddb_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FindRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_pb_threaddb_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FindReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_pb_threaddb_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FindByIDRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_pb_threaddb_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FindByIDReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_pb_threaddb_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DiscardRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_pb_threaddb_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DiscardReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_pb_threaddb_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StartTransactionRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_pb_threaddb_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReadTransactionRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_pb_threaddb_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReadTransactionReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_pb_threaddb_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WriteTransactionRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_pb_threaddb_proto_msgTypes[43].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WriteTransactionReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_pb_threaddb_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListenRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_pb_threaddb_proto_msgTypes[45].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListenReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_pb_threaddb_proto_msgTypes[46].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListDBsReply_DB); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_pb_threaddb_proto_msgTypes[47].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListenRequest_Filter); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_api_pb_threaddb_proto_msgTypes[40].OneofWrappers = []interface{}{ + (*ReadTransactionRequest_StartTransactionRequest)(nil), + (*ReadTransactionRequest_HasRequest)(nil), + (*ReadTransactionRequest_FindRequest)(nil), + (*ReadTransactionRequest_FindByIDRequest)(nil), + } + file_api_pb_threaddb_proto_msgTypes[41].OneofWrappers = []interface{}{ + (*ReadTransactionReply_HasReply)(nil), + (*ReadTransactionReply_FindReply)(nil), + (*ReadTransactionReply_FindByIDReply)(nil), + } + file_api_pb_threaddb_proto_msgTypes[42].OneofWrappers = []interface{}{ + (*WriteTransactionRequest_StartTransactionRequest)(nil), + (*WriteTransactionRequest_CreateRequest)(nil), + (*WriteTransactionRequest_VerifyRequest)(nil), + (*WriteTransactionRequest_SaveRequest)(nil), + (*WriteTransactionRequest_DeleteRequest)(nil), + (*WriteTransactionRequest_HasRequest)(nil), + (*WriteTransactionRequest_FindRequest)(nil), + (*WriteTransactionRequest_FindByIDRequest)(nil), + (*WriteTransactionRequest_DiscardRequest)(nil), + } + file_api_pb_threaddb_proto_msgTypes[43].OneofWrappers = []interface{}{ + (*WriteTransactionReply_CreateReply)(nil), + (*WriteTransactionReply_VerifyReply)(nil), + (*WriteTransactionReply_SaveReply)(nil), + (*WriteTransactionReply_DeleteReply)(nil), + (*WriteTransactionReply_HasReply)(nil), + (*WriteTransactionReply_FindReply)(nil), + (*WriteTransactionReply_FindByIDReply)(nil), + (*WriteTransactionReply_DiscardReply)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_api_pb_threaddb_proto_rawDesc, + NumEnums: 2, + NumMessages: 48, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_api_pb_threaddb_proto_goTypes, + DependencyIndexes: file_api_pb_threaddb_proto_depIdxs, + EnumInfos: file_api_pb_threaddb_proto_enumTypes, + MessageInfos: file_api_pb_threaddb_proto_msgTypes, + }.Build() + File_api_pb_threaddb_proto = out.File + file_api_pb_threaddb_proto_rawDesc = nil + file_api_pb_threaddb_proto_goTypes = nil + file_api_pb_threaddb_proto_depIdxs = nil +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConnInterface + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion6 + +// APIServiceClient is the client API for APIService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type APIServiceClient interface { + NewDB(ctx context.Context, in *NewDBRequest, opts ...grpc.CallOption) (*NewDBReply, error) + NewDBFromAddr(ctx context.Context, in *NewDBFromAddrRequest, opts ...grpc.CallOption) (*NewDBReply, error) + ListDBs(ctx context.Context, in *ListDBsRequest, opts ...grpc.CallOption) (*ListDBsReply, error) + GetDBInfo(ctx context.Context, in *GetDBInfoRequest, opts ...grpc.CallOption) (*GetDBInfoReply, error) + DeleteDB(ctx context.Context, in *DeleteDBRequest, opts ...grpc.CallOption) (*DeleteDBReply, error) + NewCollection(ctx context.Context, in *NewCollectionRequest, opts ...grpc.CallOption) (*NewCollectionReply, error) + UpdateCollection(ctx context.Context, in *UpdateCollectionRequest, opts ...grpc.CallOption) (*UpdateCollectionReply, error) + DeleteCollection(ctx context.Context, in *DeleteCollectionRequest, opts ...grpc.CallOption) (*DeleteCollectionReply, error) + GetCollectionInfo(ctx context.Context, in *GetCollectionInfoRequest, opts ...grpc.CallOption) (*GetCollectionInfoReply, error) + // Deprecated: Do not use. + GetCollectionIndexes(ctx context.Context, in *GetCollectionIndexesRequest, opts ...grpc.CallOption) (*GetCollectionIndexesReply, error) + ListCollections(ctx context.Context, in *ListCollectionsRequest, opts ...grpc.CallOption) (*ListCollectionsReply, error) + Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateReply, error) + Verify(ctx context.Context, in *VerifyRequest, opts ...grpc.CallOption) (*VerifyReply, error) + Save(ctx context.Context, in *SaveRequest, opts ...grpc.CallOption) (*SaveReply, error) + Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteReply, error) + Has(ctx context.Context, in *HasRequest, opts ...grpc.CallOption) (*HasReply, error) + Find(ctx context.Context, in *FindRequest, opts ...grpc.CallOption) (*FindReply, error) + FindByID(ctx context.Context, in *FindByIDRequest, opts ...grpc.CallOption) (*FindByIDReply, error) + ReadTransaction(ctx context.Context, opts ...grpc.CallOption) (APIService_ReadTransactionClient, error) + WriteTransaction(ctx context.Context, opts ...grpc.CallOption) (APIService_WriteTransactionClient, error) + Listen(ctx context.Context, in *ListenRequest, opts ...grpc.CallOption) (APIService_ListenClient, error) +} + +type aPIServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewAPIServiceClient(cc grpc.ClientConnInterface) APIServiceClient { + return &aPIServiceClient{cc} +} + +func (c *aPIServiceClient) NewDB(ctx context.Context, in *NewDBRequest, opts ...grpc.CallOption) (*NewDBReply, error) { + out := new(NewDBReply) + err := c.cc.Invoke(ctx, "/api.pb.APIService/NewDB", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aPIServiceClient) NewDBFromAddr(ctx context.Context, in *NewDBFromAddrRequest, opts ...grpc.CallOption) (*NewDBReply, error) { + out := new(NewDBReply) + err := c.cc.Invoke(ctx, "/api.pb.APIService/NewDBFromAddr", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aPIServiceClient) ListDBs(ctx context.Context, in *ListDBsRequest, opts ...grpc.CallOption) (*ListDBsReply, error) { + out := new(ListDBsReply) + err := c.cc.Invoke(ctx, "/api.pb.APIService/ListDBs", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aPIServiceClient) GetDBInfo(ctx context.Context, in *GetDBInfoRequest, opts ...grpc.CallOption) (*GetDBInfoReply, error) { + out := new(GetDBInfoReply) + err := c.cc.Invoke(ctx, "/api.pb.APIService/GetDBInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aPIServiceClient) DeleteDB(ctx context.Context, in *DeleteDBRequest, opts ...grpc.CallOption) (*DeleteDBReply, error) { + out := new(DeleteDBReply) + err := c.cc.Invoke(ctx, "/api.pb.APIService/DeleteDB", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aPIServiceClient) NewCollection(ctx context.Context, in *NewCollectionRequest, opts ...grpc.CallOption) (*NewCollectionReply, error) { + out := new(NewCollectionReply) + err := c.cc.Invoke(ctx, "/api.pb.APIService/NewCollection", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aPIServiceClient) UpdateCollection(ctx context.Context, in *UpdateCollectionRequest, opts ...grpc.CallOption) (*UpdateCollectionReply, error) { + out := new(UpdateCollectionReply) + err := c.cc.Invoke(ctx, "/api.pb.APIService/UpdateCollection", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aPIServiceClient) DeleteCollection(ctx context.Context, in *DeleteCollectionRequest, opts ...grpc.CallOption) (*DeleteCollectionReply, error) { + out := new(DeleteCollectionReply) + err := c.cc.Invoke(ctx, "/api.pb.APIService/DeleteCollection", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aPIServiceClient) GetCollectionInfo(ctx context.Context, in *GetCollectionInfoRequest, opts ...grpc.CallOption) (*GetCollectionInfoReply, error) { + out := new(GetCollectionInfoReply) + err := c.cc.Invoke(ctx, "/api.pb.APIService/GetCollectionInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Deprecated: Do not use. +func (c *aPIServiceClient) GetCollectionIndexes(ctx context.Context, in *GetCollectionIndexesRequest, opts ...grpc.CallOption) (*GetCollectionIndexesReply, error) { + out := new(GetCollectionIndexesReply) + err := c.cc.Invoke(ctx, "/api.pb.APIService/GetCollectionIndexes", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aPIServiceClient) ListCollections(ctx context.Context, in *ListCollectionsRequest, opts ...grpc.CallOption) (*ListCollectionsReply, error) { + out := new(ListCollectionsReply) + err := c.cc.Invoke(ctx, "/api.pb.APIService/ListCollections", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aPIServiceClient) Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateReply, error) { + out := new(CreateReply) + err := c.cc.Invoke(ctx, "/api.pb.APIService/Create", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aPIServiceClient) Verify(ctx context.Context, in *VerifyRequest, opts ...grpc.CallOption) (*VerifyReply, error) { + out := new(VerifyReply) + err := c.cc.Invoke(ctx, "/api.pb.APIService/Verify", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aPIServiceClient) Save(ctx context.Context, in *SaveRequest, opts ...grpc.CallOption) (*SaveReply, error) { + out := new(SaveReply) + err := c.cc.Invoke(ctx, "/api.pb.APIService/Save", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aPIServiceClient) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteReply, error) { + out := new(DeleteReply) + err := c.cc.Invoke(ctx, "/api.pb.APIService/Delete", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aPIServiceClient) Has(ctx context.Context, in *HasRequest, opts ...grpc.CallOption) (*HasReply, error) { + out := new(HasReply) + err := c.cc.Invoke(ctx, "/api.pb.APIService/Has", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aPIServiceClient) Find(ctx context.Context, in *FindRequest, opts ...grpc.CallOption) (*FindReply, error) { + out := new(FindReply) + err := c.cc.Invoke(ctx, "/api.pb.APIService/Find", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aPIServiceClient) FindByID(ctx context.Context, in *FindByIDRequest, opts ...grpc.CallOption) (*FindByIDReply, error) { + out := new(FindByIDReply) + err := c.cc.Invoke(ctx, "/api.pb.APIService/FindByID", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aPIServiceClient) ReadTransaction(ctx context.Context, opts ...grpc.CallOption) (APIService_ReadTransactionClient, error) { + stream, err := c.cc.NewStream(ctx, &_APIService_serviceDesc.Streams[0], "/api.pb.APIService/ReadTransaction", opts...) + if err != nil { + return nil, err + } + x := &aPIServiceReadTransactionClient{stream} + return x, nil +} + +type APIService_ReadTransactionClient interface { + Send(*ReadTransactionRequest) error + Recv() (*ReadTransactionReply, error) + grpc.ClientStream +} + +type aPIServiceReadTransactionClient struct { + grpc.ClientStream +} + +func (x *aPIServiceReadTransactionClient) Send(m *ReadTransactionRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *aPIServiceReadTransactionClient) Recv() (*ReadTransactionReply, error) { + m := new(ReadTransactionReply) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *aPIServiceClient) WriteTransaction(ctx context.Context, opts ...grpc.CallOption) (APIService_WriteTransactionClient, error) { + stream, err := c.cc.NewStream(ctx, &_APIService_serviceDesc.Streams[1], "/api.pb.APIService/WriteTransaction", opts...) + if err != nil { + return nil, err + } + x := &aPIServiceWriteTransactionClient{stream} + return x, nil +} + +type APIService_WriteTransactionClient interface { + Send(*WriteTransactionRequest) error + Recv() (*WriteTransactionReply, error) + grpc.ClientStream +} + +type aPIServiceWriteTransactionClient struct { + grpc.ClientStream +} + +func (x *aPIServiceWriteTransactionClient) Send(m *WriteTransactionRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *aPIServiceWriteTransactionClient) Recv() (*WriteTransactionReply, error) { + m := new(WriteTransactionReply) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *aPIServiceClient) Listen(ctx context.Context, in *ListenRequest, opts ...grpc.CallOption) (APIService_ListenClient, error) { + stream, err := c.cc.NewStream(ctx, &_APIService_serviceDesc.Streams[2], "/api.pb.APIService/Listen", opts...) + if err != nil { + return nil, err + } + x := &aPIServiceListenClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type APIService_ListenClient interface { + Recv() (*ListenReply, error) + grpc.ClientStream +} + +type aPIServiceListenClient struct { + grpc.ClientStream +} + +func (x *aPIServiceListenClient) Recv() (*ListenReply, error) { + m := new(ListenReply) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// APIServiceServer is the server API for APIService service. +type APIServiceServer interface { + NewDB(context.Context, *NewDBRequest) (*NewDBReply, error) + NewDBFromAddr(context.Context, *NewDBFromAddrRequest) (*NewDBReply, error) + ListDBs(context.Context, *ListDBsRequest) (*ListDBsReply, error) + GetDBInfo(context.Context, *GetDBInfoRequest) (*GetDBInfoReply, error) + DeleteDB(context.Context, *DeleteDBRequest) (*DeleteDBReply, error) + NewCollection(context.Context, *NewCollectionRequest) (*NewCollectionReply, error) + UpdateCollection(context.Context, *UpdateCollectionRequest) (*UpdateCollectionReply, error) + DeleteCollection(context.Context, *DeleteCollectionRequest) (*DeleteCollectionReply, error) + GetCollectionInfo(context.Context, *GetCollectionInfoRequest) (*GetCollectionInfoReply, error) + // Deprecated: Do not use. + GetCollectionIndexes(context.Context, *GetCollectionIndexesRequest) (*GetCollectionIndexesReply, error) + ListCollections(context.Context, *ListCollectionsRequest) (*ListCollectionsReply, error) + Create(context.Context, *CreateRequest) (*CreateReply, error) + Verify(context.Context, *VerifyRequest) (*VerifyReply, error) + Save(context.Context, *SaveRequest) (*SaveReply, error) + Delete(context.Context, *DeleteRequest) (*DeleteReply, error) + Has(context.Context, *HasRequest) (*HasReply, error) + Find(context.Context, *FindRequest) (*FindReply, error) + FindByID(context.Context, *FindByIDRequest) (*FindByIDReply, error) + ReadTransaction(APIService_ReadTransactionServer) error + WriteTransaction(APIService_WriteTransactionServer) error + Listen(*ListenRequest, APIService_ListenServer) error +} + +// UnimplementedAPIServiceServer can be embedded to have forward compatible implementations. +type UnimplementedAPIServiceServer struct { +} + +func (*UnimplementedAPIServiceServer) NewDB(context.Context, *NewDBRequest) (*NewDBReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method NewDB not implemented") +} +func (*UnimplementedAPIServiceServer) NewDBFromAddr(context.Context, *NewDBFromAddrRequest) (*NewDBReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method NewDBFromAddr not implemented") +} +func (*UnimplementedAPIServiceServer) ListDBs(context.Context, *ListDBsRequest) (*ListDBsReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListDBs not implemented") +} +func (*UnimplementedAPIServiceServer) GetDBInfo(context.Context, *GetDBInfoRequest) (*GetDBInfoReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetDBInfo not implemented") +} +func (*UnimplementedAPIServiceServer) DeleteDB(context.Context, *DeleteDBRequest) (*DeleteDBReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteDB not implemented") +} +func (*UnimplementedAPIServiceServer) NewCollection(context.Context, *NewCollectionRequest) (*NewCollectionReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method NewCollection not implemented") +} +func (*UnimplementedAPIServiceServer) UpdateCollection(context.Context, *UpdateCollectionRequest) (*UpdateCollectionReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateCollection not implemented") +} +func (*UnimplementedAPIServiceServer) DeleteCollection(context.Context, *DeleteCollectionRequest) (*DeleteCollectionReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteCollection not implemented") +} +func (*UnimplementedAPIServiceServer) GetCollectionInfo(context.Context, *GetCollectionInfoRequest) (*GetCollectionInfoReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetCollectionInfo not implemented") +} +func (*UnimplementedAPIServiceServer) GetCollectionIndexes(context.Context, *GetCollectionIndexesRequest) (*GetCollectionIndexesReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetCollectionIndexes not implemented") +} +func (*UnimplementedAPIServiceServer) ListCollections(context.Context, *ListCollectionsRequest) (*ListCollectionsReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListCollections not implemented") +} +func (*UnimplementedAPIServiceServer) Create(context.Context, *CreateRequest) (*CreateReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method Create not implemented") +} +func (*UnimplementedAPIServiceServer) Verify(context.Context, *VerifyRequest) (*VerifyReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method Verify not implemented") +} +func (*UnimplementedAPIServiceServer) Save(context.Context, *SaveRequest) (*SaveReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method Save not implemented") +} +func (*UnimplementedAPIServiceServer) Delete(context.Context, *DeleteRequest) (*DeleteReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented") +} +func (*UnimplementedAPIServiceServer) Has(context.Context, *HasRequest) (*HasReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method Has not implemented") +} +func (*UnimplementedAPIServiceServer) Find(context.Context, *FindRequest) (*FindReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method Find not implemented") +} +func (*UnimplementedAPIServiceServer) FindByID(context.Context, *FindByIDRequest) (*FindByIDReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method FindByID not implemented") +} +func (*UnimplementedAPIServiceServer) ReadTransaction(APIService_ReadTransactionServer) error { + return status.Errorf(codes.Unimplemented, "method ReadTransaction not implemented") +} +func (*UnimplementedAPIServiceServer) WriteTransaction(APIService_WriteTransactionServer) error { + return status.Errorf(codes.Unimplemented, "method WriteTransaction not implemented") +} +func (*UnimplementedAPIServiceServer) Listen(*ListenRequest, APIService_ListenServer) error { + return status.Errorf(codes.Unimplemented, "method Listen not implemented") +} + +func RegisterAPIServiceServer(s *grpc.Server, srv APIServiceServer) { + s.RegisterService(&_APIService_serviceDesc, srv) +} + +func _APIService_NewDB_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(NewDBRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(APIServiceServer).NewDB(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.pb.APIService/NewDB", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(APIServiceServer).NewDB(ctx, req.(*NewDBRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _APIService_NewDBFromAddr_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(NewDBFromAddrRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(APIServiceServer).NewDBFromAddr(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.pb.APIService/NewDBFromAddr", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(APIServiceServer).NewDBFromAddr(ctx, req.(*NewDBFromAddrRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _APIService_ListDBs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListDBsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(APIServiceServer).ListDBs(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.pb.APIService/ListDBs", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(APIServiceServer).ListDBs(ctx, req.(*ListDBsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _APIService_GetDBInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetDBInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(APIServiceServer).GetDBInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.pb.APIService/GetDBInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(APIServiceServer).GetDBInfo(ctx, req.(*GetDBInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _APIService_DeleteDB_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteDBRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(APIServiceServer).DeleteDB(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.pb.APIService/DeleteDB", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(APIServiceServer).DeleteDB(ctx, req.(*DeleteDBRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _APIService_NewCollection_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(NewCollectionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(APIServiceServer).NewCollection(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.pb.APIService/NewCollection", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(APIServiceServer).NewCollection(ctx, req.(*NewCollectionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _APIService_UpdateCollection_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateCollectionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(APIServiceServer).UpdateCollection(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.pb.APIService/UpdateCollection", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(APIServiceServer).UpdateCollection(ctx, req.(*UpdateCollectionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _APIService_DeleteCollection_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteCollectionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(APIServiceServer).DeleteCollection(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.pb.APIService/DeleteCollection", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(APIServiceServer).DeleteCollection(ctx, req.(*DeleteCollectionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _APIService_GetCollectionInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetCollectionInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(APIServiceServer).GetCollectionInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.pb.APIService/GetCollectionInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(APIServiceServer).GetCollectionInfo(ctx, req.(*GetCollectionInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _APIService_GetCollectionIndexes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetCollectionIndexesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(APIServiceServer).GetCollectionIndexes(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.pb.APIService/GetCollectionIndexes", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(APIServiceServer).GetCollectionIndexes(ctx, req.(*GetCollectionIndexesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _APIService_ListCollections_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListCollectionsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(APIServiceServer).ListCollections(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.pb.APIService/ListCollections", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(APIServiceServer).ListCollections(ctx, req.(*ListCollectionsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _APIService_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(APIServiceServer).Create(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.pb.APIService/Create", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(APIServiceServer).Create(ctx, req.(*CreateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _APIService_Verify_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(VerifyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(APIServiceServer).Verify(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.pb.APIService/Verify", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(APIServiceServer).Verify(ctx, req.(*VerifyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _APIService_Save_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SaveRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(APIServiceServer).Save(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.pb.APIService/Save", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(APIServiceServer).Save(ctx, req.(*SaveRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _APIService_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(APIServiceServer).Delete(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.pb.APIService/Delete", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(APIServiceServer).Delete(ctx, req.(*DeleteRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _APIService_Has_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(HasRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(APIServiceServer).Has(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.pb.APIService/Has", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(APIServiceServer).Has(ctx, req.(*HasRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _APIService_Find_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(FindRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(APIServiceServer).Find(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.pb.APIService/Find", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(APIServiceServer).Find(ctx, req.(*FindRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _APIService_FindByID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(FindByIDRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(APIServiceServer).FindByID(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.pb.APIService/FindByID", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(APIServiceServer).FindByID(ctx, req.(*FindByIDRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _APIService_ReadTransaction_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(APIServiceServer).ReadTransaction(&aPIServiceReadTransactionServer{stream}) +} + +type APIService_ReadTransactionServer interface { + Send(*ReadTransactionReply) error + Recv() (*ReadTransactionRequest, error) + grpc.ServerStream +} + +type aPIServiceReadTransactionServer struct { + grpc.ServerStream +} + +func (x *aPIServiceReadTransactionServer) Send(m *ReadTransactionReply) error { + return x.ServerStream.SendMsg(m) +} + +func (x *aPIServiceReadTransactionServer) Recv() (*ReadTransactionRequest, error) { + m := new(ReadTransactionRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _APIService_WriteTransaction_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(APIServiceServer).WriteTransaction(&aPIServiceWriteTransactionServer{stream}) +} + +type APIService_WriteTransactionServer interface { + Send(*WriteTransactionReply) error + Recv() (*WriteTransactionRequest, error) + grpc.ServerStream +} + +type aPIServiceWriteTransactionServer struct { + grpc.ServerStream +} + +func (x *aPIServiceWriteTransactionServer) Send(m *WriteTransactionReply) error { + return x.ServerStream.SendMsg(m) +} + +func (x *aPIServiceWriteTransactionServer) Recv() (*WriteTransactionRequest, error) { + m := new(WriteTransactionRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _APIService_Listen_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(ListenRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(APIServiceServer).Listen(m, &aPIServiceListenServer{stream}) +} + +type APIService_ListenServer interface { + Send(*ListenReply) error + grpc.ServerStream +} + +type aPIServiceListenServer struct { + grpc.ServerStream +} + +func (x *aPIServiceListenServer) Send(m *ListenReply) error { + return x.ServerStream.SendMsg(m) +} + +var _APIService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "api.pb.APIService", + HandlerType: (*APIServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "NewDB", + Handler: _APIService_NewDB_Handler, + }, + { + MethodName: "NewDBFromAddr", + Handler: _APIService_NewDBFromAddr_Handler, + }, + { + MethodName: "ListDBs", + Handler: _APIService_ListDBs_Handler, + }, + { + MethodName: "GetDBInfo", + Handler: _APIService_GetDBInfo_Handler, + }, + { + MethodName: "DeleteDB", + Handler: _APIService_DeleteDB_Handler, + }, + { + MethodName: "NewCollection", + Handler: _APIService_NewCollection_Handler, + }, + { + MethodName: "UpdateCollection", + Handler: _APIService_UpdateCollection_Handler, + }, + { + MethodName: "DeleteCollection", + Handler: _APIService_DeleteCollection_Handler, + }, + { + MethodName: "GetCollectionInfo", + Handler: _APIService_GetCollectionInfo_Handler, + }, + { + MethodName: "GetCollectionIndexes", + Handler: _APIService_GetCollectionIndexes_Handler, + }, + { + MethodName: "ListCollections", + Handler: _APIService_ListCollections_Handler, + }, + { + MethodName: "Create", + Handler: _APIService_Create_Handler, + }, + { + MethodName: "Verify", + Handler: _APIService_Verify_Handler, + }, + { + MethodName: "Save", + Handler: _APIService_Save_Handler, + }, + { + MethodName: "Delete", + Handler: _APIService_Delete_Handler, + }, + { + MethodName: "Has", + Handler: _APIService_Has_Handler, + }, + { + MethodName: "Find", + Handler: _APIService_Find_Handler, + }, + { + MethodName: "FindByID", + Handler: _APIService_FindByID_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "ReadTransaction", + Handler: _APIService_ReadTransaction_Handler, + ServerStreams: true, + ClientStreams: true, + }, + { + StreamName: "WriteTransaction", + Handler: _APIService_WriteTransaction_Handler, + ServerStreams: true, + ClientStreams: true, + }, + { + StreamName: "Listen", + Handler: _APIService_Listen_Handler, + ServerStreams: true, + }, + }, + Metadata: "api/pb/threaddb.proto", +} diff --git a/api/pb/threads.proto b/api/pb/threaddb.proto similarity index 93% rename from api/pb/threads.proto rename to api/pb/threaddb.proto index 5f380357..e54b3899 100644 --- a/api/pb/threads.proto +++ b/api/pb/threaddb.proto @@ -1,24 +1,6 @@ syntax = "proto3"; -package threads.pb; - -option java_multiple_files = true; -option java_package = "io.textile.threads_grpc"; -option java_outer_classname = "Threads"; -option objc_class_prefix = "THREADS"; - -message GetTokenRequest { - oneof payload { - string key = 1; - bytes signature = 2; - } -} - -message GetTokenReply { - oneof payload { - bytes challenge = 1; - string token = 2; - } -} +package api.pb; +option go_package = "github.com/textileio/go-buckets/api/pb"; // @todo: Clean up tag numbers with next major release message NewDBRequest { @@ -293,8 +275,7 @@ message ListenReply { } } -service API { - rpc GetToken(stream GetTokenRequest) returns (stream GetTokenReply) {} +service APIService { rpc NewDB(NewDBRequest) returns (NewDBReply) {} rpc NewDBFromAddr(NewDBFromAddrRequest) returns (NewDBReply) {} rpc ListDBs(ListDBsRequest) returns (ListDBsReply) {} diff --git a/api/pb/threads.pb.go b/api/pb/threads.pb.go deleted file mode 100644 index a7d7fff0..00000000 --- a/api/pb/threads.pb.go +++ /dev/null @@ -1,4023 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: threads.proto - -package threads_pb - -import ( - context "context" - fmt "fmt" - proto "github.com/golang/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -type ListenRequest_Filter_Action int32 - -const ( - ListenRequest_Filter_ALL ListenRequest_Filter_Action = 0 - ListenRequest_Filter_CREATE ListenRequest_Filter_Action = 1 - ListenRequest_Filter_SAVE ListenRequest_Filter_Action = 2 - ListenRequest_Filter_DELETE ListenRequest_Filter_Action = 3 -) - -var ListenRequest_Filter_Action_name = map[int32]string{ - 0: "ALL", - 1: "CREATE", - 2: "SAVE", - 3: "DELETE", -} - -var ListenRequest_Filter_Action_value = map[string]int32{ - "ALL": 0, - "CREATE": 1, - "SAVE": 2, - "DELETE": 3, -} - -func (x ListenRequest_Filter_Action) String() string { - return proto.EnumName(ListenRequest_Filter_Action_name, int32(x)) -} - -func (ListenRequest_Filter_Action) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_f2ba358bb2150022, []int{46, 0, 0} -} - -type ListenReply_Action int32 - -const ( - ListenReply_CREATE ListenReply_Action = 0 - ListenReply_SAVE ListenReply_Action = 1 - ListenReply_DELETE ListenReply_Action = 2 -) - -var ListenReply_Action_name = map[int32]string{ - 0: "CREATE", - 1: "SAVE", - 2: "DELETE", -} - -var ListenReply_Action_value = map[string]int32{ - "CREATE": 0, - "SAVE": 1, - "DELETE": 2, -} - -func (x ListenReply_Action) String() string { - return proto.EnumName(ListenReply_Action_name, int32(x)) -} - -func (ListenReply_Action) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_f2ba358bb2150022, []int{47, 0} -} - -type GetTokenRequest struct { - // Types that are valid to be assigned to Payload: - // *GetTokenRequest_Key - // *GetTokenRequest_Signature - Payload isGetTokenRequest_Payload `protobuf_oneof:"payload"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetTokenRequest) Reset() { *m = GetTokenRequest{} } -func (m *GetTokenRequest) String() string { return proto.CompactTextString(m) } -func (*GetTokenRequest) ProtoMessage() {} -func (*GetTokenRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f2ba358bb2150022, []int{0} -} - -func (m *GetTokenRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetTokenRequest.Unmarshal(m, b) -} -func (m *GetTokenRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetTokenRequest.Marshal(b, m, deterministic) -} -func (m *GetTokenRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetTokenRequest.Merge(m, src) -} -func (m *GetTokenRequest) XXX_Size() int { - return xxx_messageInfo_GetTokenRequest.Size(m) -} -func (m *GetTokenRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetTokenRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetTokenRequest proto.InternalMessageInfo - -type isGetTokenRequest_Payload interface { - isGetTokenRequest_Payload() -} - -type GetTokenRequest_Key struct { - Key string `protobuf:"bytes,1,opt,name=key,proto3,oneof"` -} - -type GetTokenRequest_Signature struct { - Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3,oneof"` -} - -func (*GetTokenRequest_Key) isGetTokenRequest_Payload() {} - -func (*GetTokenRequest_Signature) isGetTokenRequest_Payload() {} - -func (m *GetTokenRequest) GetPayload() isGetTokenRequest_Payload { - if m != nil { - return m.Payload - } - return nil -} - -func (m *GetTokenRequest) GetKey() string { - if x, ok := m.GetPayload().(*GetTokenRequest_Key); ok { - return x.Key - } - return "" -} - -func (m *GetTokenRequest) GetSignature() []byte { - if x, ok := m.GetPayload().(*GetTokenRequest_Signature); ok { - return x.Signature - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*GetTokenRequest) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*GetTokenRequest_Key)(nil), - (*GetTokenRequest_Signature)(nil), - } -} - -type GetTokenReply struct { - // Types that are valid to be assigned to Payload: - // *GetTokenReply_Challenge - // *GetTokenReply_Token - Payload isGetTokenReply_Payload `protobuf_oneof:"payload"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetTokenReply) Reset() { *m = GetTokenReply{} } -func (m *GetTokenReply) String() string { return proto.CompactTextString(m) } -func (*GetTokenReply) ProtoMessage() {} -func (*GetTokenReply) Descriptor() ([]byte, []int) { - return fileDescriptor_f2ba358bb2150022, []int{1} -} - -func (m *GetTokenReply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetTokenReply.Unmarshal(m, b) -} -func (m *GetTokenReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetTokenReply.Marshal(b, m, deterministic) -} -func (m *GetTokenReply) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetTokenReply.Merge(m, src) -} -func (m *GetTokenReply) XXX_Size() int { - return xxx_messageInfo_GetTokenReply.Size(m) -} -func (m *GetTokenReply) XXX_DiscardUnknown() { - xxx_messageInfo_GetTokenReply.DiscardUnknown(m) -} - -var xxx_messageInfo_GetTokenReply proto.InternalMessageInfo - -type isGetTokenReply_Payload interface { - isGetTokenReply_Payload() -} - -type GetTokenReply_Challenge struct { - Challenge []byte `protobuf:"bytes,1,opt,name=challenge,proto3,oneof"` -} - -type GetTokenReply_Token struct { - Token string `protobuf:"bytes,2,opt,name=token,proto3,oneof"` -} - -func (*GetTokenReply_Challenge) isGetTokenReply_Payload() {} - -func (*GetTokenReply_Token) isGetTokenReply_Payload() {} - -func (m *GetTokenReply) GetPayload() isGetTokenReply_Payload { - if m != nil { - return m.Payload - } - return nil -} - -func (m *GetTokenReply) GetChallenge() []byte { - if x, ok := m.GetPayload().(*GetTokenReply_Challenge); ok { - return x.Challenge - } - return nil -} - -func (m *GetTokenReply) GetToken() string { - if x, ok := m.GetPayload().(*GetTokenReply_Token); ok { - return x.Token - } - return "" -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*GetTokenReply) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*GetTokenReply_Challenge)(nil), - (*GetTokenReply_Token)(nil), - } -} - -// @todo: Clean up tag numbers with next major release -type NewDBRequest struct { - DbID []byte `protobuf:"bytes,1,opt,name=dbID,proto3" json:"dbID,omitempty"` - Key []byte `protobuf:"bytes,6,opt,name=key,proto3" json:"key,omitempty"` - LogKey []byte `protobuf:"bytes,7,opt,name=logKey,proto3" json:"logKey,omitempty"` - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - Collections []*CollectionConfig `protobuf:"bytes,2,rep,name=collections,proto3" json:"collections,omitempty"` - Block bool `protobuf:"varint,5,opt,name=block,proto3" json:"block,omitempty"` // Deprecated: Do not use. - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NewDBRequest) Reset() { *m = NewDBRequest{} } -func (m *NewDBRequest) String() string { return proto.CompactTextString(m) } -func (*NewDBRequest) ProtoMessage() {} -func (*NewDBRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f2ba358bb2150022, []int{2} -} - -func (m *NewDBRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NewDBRequest.Unmarshal(m, b) -} -func (m *NewDBRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NewDBRequest.Marshal(b, m, deterministic) -} -func (m *NewDBRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_NewDBRequest.Merge(m, src) -} -func (m *NewDBRequest) XXX_Size() int { - return xxx_messageInfo_NewDBRequest.Size(m) -} -func (m *NewDBRequest) XXX_DiscardUnknown() { - xxx_messageInfo_NewDBRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_NewDBRequest proto.InternalMessageInfo - -func (m *NewDBRequest) GetDbID() []byte { - if m != nil { - return m.DbID - } - return nil -} - -func (m *NewDBRequest) GetKey() []byte { - if m != nil { - return m.Key - } - return nil -} - -func (m *NewDBRequest) GetLogKey() []byte { - if m != nil { - return m.LogKey - } - return nil -} - -func (m *NewDBRequest) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *NewDBRequest) GetCollections() []*CollectionConfig { - if m != nil { - return m.Collections - } - return nil -} - -// Deprecated: Do not use. -func (m *NewDBRequest) GetBlock() bool { - if m != nil { - return m.Block - } - return false -} - -// @todo: Clean up tag numbers with next major release -type NewDBFromAddrRequest struct { - Addr []byte `protobuf:"bytes,1,opt,name=addr,proto3" json:"addr,omitempty"` - Key []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` - LogKey []byte `protobuf:"bytes,7,opt,name=logKey,proto3" json:"logKey,omitempty"` - Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` - Collections []*CollectionConfig `protobuf:"bytes,3,rep,name=collections,proto3" json:"collections,omitempty"` - Block bool `protobuf:"varint,5,opt,name=block,proto3" json:"block,omitempty"` - ThreadKey []byte `protobuf:"bytes,6,opt,name=threadKey,proto3" json:"threadKey,omitempty"` // Deprecated: Do not use. - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NewDBFromAddrRequest) Reset() { *m = NewDBFromAddrRequest{} } -func (m *NewDBFromAddrRequest) String() string { return proto.CompactTextString(m) } -func (*NewDBFromAddrRequest) ProtoMessage() {} -func (*NewDBFromAddrRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f2ba358bb2150022, []int{3} -} - -func (m *NewDBFromAddrRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NewDBFromAddrRequest.Unmarshal(m, b) -} -func (m *NewDBFromAddrRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NewDBFromAddrRequest.Marshal(b, m, deterministic) -} -func (m *NewDBFromAddrRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_NewDBFromAddrRequest.Merge(m, src) -} -func (m *NewDBFromAddrRequest) XXX_Size() int { - return xxx_messageInfo_NewDBFromAddrRequest.Size(m) -} -func (m *NewDBFromAddrRequest) XXX_DiscardUnknown() { - xxx_messageInfo_NewDBFromAddrRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_NewDBFromAddrRequest proto.InternalMessageInfo - -func (m *NewDBFromAddrRequest) GetAddr() []byte { - if m != nil { - return m.Addr - } - return nil -} - -func (m *NewDBFromAddrRequest) GetKey() []byte { - if m != nil { - return m.Key - } - return nil -} - -func (m *NewDBFromAddrRequest) GetLogKey() []byte { - if m != nil { - return m.LogKey - } - return nil -} - -func (m *NewDBFromAddrRequest) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *NewDBFromAddrRequest) GetCollections() []*CollectionConfig { - if m != nil { - return m.Collections - } - return nil -} - -func (m *NewDBFromAddrRequest) GetBlock() bool { - if m != nil { - return m.Block - } - return false -} - -// Deprecated: Do not use. -func (m *NewDBFromAddrRequest) GetThreadKey() []byte { - if m != nil { - return m.ThreadKey - } - return nil -} - -type CollectionConfig struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Schema []byte `protobuf:"bytes,2,opt,name=schema,proto3" json:"schema,omitempty"` - Indexes []*Index `protobuf:"bytes,3,rep,name=indexes,proto3" json:"indexes,omitempty"` - WriteValidator string `protobuf:"bytes,4,opt,name=writeValidator,proto3" json:"writeValidator,omitempty"` - ReadFilter string `protobuf:"bytes,5,opt,name=readFilter,proto3" json:"readFilter,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CollectionConfig) Reset() { *m = CollectionConfig{} } -func (m *CollectionConfig) String() string { return proto.CompactTextString(m) } -func (*CollectionConfig) ProtoMessage() {} -func (*CollectionConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_f2ba358bb2150022, []int{4} -} - -func (m *CollectionConfig) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CollectionConfig.Unmarshal(m, b) -} -func (m *CollectionConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CollectionConfig.Marshal(b, m, deterministic) -} -func (m *CollectionConfig) XXX_Merge(src proto.Message) { - xxx_messageInfo_CollectionConfig.Merge(m, src) -} -func (m *CollectionConfig) XXX_Size() int { - return xxx_messageInfo_CollectionConfig.Size(m) -} -func (m *CollectionConfig) XXX_DiscardUnknown() { - xxx_messageInfo_CollectionConfig.DiscardUnknown(m) -} - -var xxx_messageInfo_CollectionConfig proto.InternalMessageInfo - -func (m *CollectionConfig) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *CollectionConfig) GetSchema() []byte { - if m != nil { - return m.Schema - } - return nil -} - -func (m *CollectionConfig) GetIndexes() []*Index { - if m != nil { - return m.Indexes - } - return nil -} - -func (m *CollectionConfig) GetWriteValidator() string { - if m != nil { - return m.WriteValidator - } - return "" -} - -func (m *CollectionConfig) GetReadFilter() string { - if m != nil { - return m.ReadFilter - } - return "" -} - -type Index struct { - Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` - Unique bool `protobuf:"varint,2,opt,name=unique,proto3" json:"unique,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Index) Reset() { *m = Index{} } -func (m *Index) String() string { return proto.CompactTextString(m) } -func (*Index) ProtoMessage() {} -func (*Index) Descriptor() ([]byte, []int) { - return fileDescriptor_f2ba358bb2150022, []int{5} -} - -func (m *Index) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Index.Unmarshal(m, b) -} -func (m *Index) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Index.Marshal(b, m, deterministic) -} -func (m *Index) XXX_Merge(src proto.Message) { - xxx_messageInfo_Index.Merge(m, src) -} -func (m *Index) XXX_Size() int { - return xxx_messageInfo_Index.Size(m) -} -func (m *Index) XXX_DiscardUnknown() { - xxx_messageInfo_Index.DiscardUnknown(m) -} - -var xxx_messageInfo_Index proto.InternalMessageInfo - -func (m *Index) GetPath() string { - if m != nil { - return m.Path - } - return "" -} - -func (m *Index) GetUnique() bool { - if m != nil { - return m.Unique - } - return false -} - -type NewDBReply struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NewDBReply) Reset() { *m = NewDBReply{} } -func (m *NewDBReply) String() string { return proto.CompactTextString(m) } -func (*NewDBReply) ProtoMessage() {} -func (*NewDBReply) Descriptor() ([]byte, []int) { - return fileDescriptor_f2ba358bb2150022, []int{6} -} - -func (m *NewDBReply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NewDBReply.Unmarshal(m, b) -} -func (m *NewDBReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NewDBReply.Marshal(b, m, deterministic) -} -func (m *NewDBReply) XXX_Merge(src proto.Message) { - xxx_messageInfo_NewDBReply.Merge(m, src) -} -func (m *NewDBReply) XXX_Size() int { - return xxx_messageInfo_NewDBReply.Size(m) -} -func (m *NewDBReply) XXX_DiscardUnknown() { - xxx_messageInfo_NewDBReply.DiscardUnknown(m) -} - -var xxx_messageInfo_NewDBReply proto.InternalMessageInfo - -type ListDBsRequest struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ListDBsRequest) Reset() { *m = ListDBsRequest{} } -func (m *ListDBsRequest) String() string { return proto.CompactTextString(m) } -func (*ListDBsRequest) ProtoMessage() {} -func (*ListDBsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f2ba358bb2150022, []int{7} -} - -func (m *ListDBsRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ListDBsRequest.Unmarshal(m, b) -} -func (m *ListDBsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ListDBsRequest.Marshal(b, m, deterministic) -} -func (m *ListDBsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListDBsRequest.Merge(m, src) -} -func (m *ListDBsRequest) XXX_Size() int { - return xxx_messageInfo_ListDBsRequest.Size(m) -} -func (m *ListDBsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ListDBsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ListDBsRequest proto.InternalMessageInfo - -type ListDBsReply struct { - Dbs []*ListDBsReply_DB `protobuf:"bytes,1,rep,name=dbs,proto3" json:"dbs,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ListDBsReply) Reset() { *m = ListDBsReply{} } -func (m *ListDBsReply) String() string { return proto.CompactTextString(m) } -func (*ListDBsReply) ProtoMessage() {} -func (*ListDBsReply) Descriptor() ([]byte, []int) { - return fileDescriptor_f2ba358bb2150022, []int{8} -} - -func (m *ListDBsReply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ListDBsReply.Unmarshal(m, b) -} -func (m *ListDBsReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ListDBsReply.Marshal(b, m, deterministic) -} -func (m *ListDBsReply) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListDBsReply.Merge(m, src) -} -func (m *ListDBsReply) XXX_Size() int { - return xxx_messageInfo_ListDBsReply.Size(m) -} -func (m *ListDBsReply) XXX_DiscardUnknown() { - xxx_messageInfo_ListDBsReply.DiscardUnknown(m) -} - -var xxx_messageInfo_ListDBsReply proto.InternalMessageInfo - -func (m *ListDBsReply) GetDbs() []*ListDBsReply_DB { - if m != nil { - return m.Dbs - } - return nil -} - -type ListDBsReply_DB struct { - DbID []byte `protobuf:"bytes,1,opt,name=dbID,proto3" json:"dbID,omitempty"` - Info *GetDBInfoReply `protobuf:"bytes,2,opt,name=info,proto3" json:"info,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ListDBsReply_DB) Reset() { *m = ListDBsReply_DB{} } -func (m *ListDBsReply_DB) String() string { return proto.CompactTextString(m) } -func (*ListDBsReply_DB) ProtoMessage() {} -func (*ListDBsReply_DB) Descriptor() ([]byte, []int) { - return fileDescriptor_f2ba358bb2150022, []int{8, 0} -} - -func (m *ListDBsReply_DB) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ListDBsReply_DB.Unmarshal(m, b) -} -func (m *ListDBsReply_DB) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ListDBsReply_DB.Marshal(b, m, deterministic) -} -func (m *ListDBsReply_DB) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListDBsReply_DB.Merge(m, src) -} -func (m *ListDBsReply_DB) XXX_Size() int { - return xxx_messageInfo_ListDBsReply_DB.Size(m) -} -func (m *ListDBsReply_DB) XXX_DiscardUnknown() { - xxx_messageInfo_ListDBsReply_DB.DiscardUnknown(m) -} - -var xxx_messageInfo_ListDBsReply_DB proto.InternalMessageInfo - -func (m *ListDBsReply_DB) GetDbID() []byte { - if m != nil { - return m.DbID - } - return nil -} - -func (m *ListDBsReply_DB) GetInfo() *GetDBInfoReply { - if m != nil { - return m.Info - } - return nil -} - -type GetDBInfoRequest struct { - DbID []byte `protobuf:"bytes,1,opt,name=dbID,proto3" json:"dbID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetDBInfoRequest) Reset() { *m = GetDBInfoRequest{} } -func (m *GetDBInfoRequest) String() string { return proto.CompactTextString(m) } -func (*GetDBInfoRequest) ProtoMessage() {} -func (*GetDBInfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f2ba358bb2150022, []int{9} -} - -func (m *GetDBInfoRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetDBInfoRequest.Unmarshal(m, b) -} -func (m *GetDBInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetDBInfoRequest.Marshal(b, m, deterministic) -} -func (m *GetDBInfoRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetDBInfoRequest.Merge(m, src) -} -func (m *GetDBInfoRequest) XXX_Size() int { - return xxx_messageInfo_GetDBInfoRequest.Size(m) -} -func (m *GetDBInfoRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetDBInfoRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetDBInfoRequest proto.InternalMessageInfo - -func (m *GetDBInfoRequest) GetDbID() []byte { - if m != nil { - return m.DbID - } - return nil -} - -type GetDBInfoReply struct { - Addrs [][]byte `protobuf:"bytes,1,rep,name=addrs,proto3" json:"addrs,omitempty"` - Key []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetDBInfoReply) Reset() { *m = GetDBInfoReply{} } -func (m *GetDBInfoReply) String() string { return proto.CompactTextString(m) } -func (*GetDBInfoReply) ProtoMessage() {} -func (*GetDBInfoReply) Descriptor() ([]byte, []int) { - return fileDescriptor_f2ba358bb2150022, []int{10} -} - -func (m *GetDBInfoReply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetDBInfoReply.Unmarshal(m, b) -} -func (m *GetDBInfoReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetDBInfoReply.Marshal(b, m, deterministic) -} -func (m *GetDBInfoReply) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetDBInfoReply.Merge(m, src) -} -func (m *GetDBInfoReply) XXX_Size() int { - return xxx_messageInfo_GetDBInfoReply.Size(m) -} -func (m *GetDBInfoReply) XXX_DiscardUnknown() { - xxx_messageInfo_GetDBInfoReply.DiscardUnknown(m) -} - -var xxx_messageInfo_GetDBInfoReply proto.InternalMessageInfo - -func (m *GetDBInfoReply) GetAddrs() [][]byte { - if m != nil { - return m.Addrs - } - return nil -} - -func (m *GetDBInfoReply) GetKey() []byte { - if m != nil { - return m.Key - } - return nil -} - -func (m *GetDBInfoReply) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -type DeleteDBRequest struct { - DbID []byte `protobuf:"bytes,1,opt,name=dbID,proto3" json:"dbID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeleteDBRequest) Reset() { *m = DeleteDBRequest{} } -func (m *DeleteDBRequest) String() string { return proto.CompactTextString(m) } -func (*DeleteDBRequest) ProtoMessage() {} -func (*DeleteDBRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f2ba358bb2150022, []int{11} -} - -func (m *DeleteDBRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteDBRequest.Unmarshal(m, b) -} -func (m *DeleteDBRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteDBRequest.Marshal(b, m, deterministic) -} -func (m *DeleteDBRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteDBRequest.Merge(m, src) -} -func (m *DeleteDBRequest) XXX_Size() int { - return xxx_messageInfo_DeleteDBRequest.Size(m) -} -func (m *DeleteDBRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteDBRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteDBRequest proto.InternalMessageInfo - -func (m *DeleteDBRequest) GetDbID() []byte { - if m != nil { - return m.DbID - } - return nil -} - -type DeleteDBReply struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeleteDBReply) Reset() { *m = DeleteDBReply{} } -func (m *DeleteDBReply) String() string { return proto.CompactTextString(m) } -func (*DeleteDBReply) ProtoMessage() {} -func (*DeleteDBReply) Descriptor() ([]byte, []int) { - return fileDescriptor_f2ba358bb2150022, []int{12} -} - -func (m *DeleteDBReply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteDBReply.Unmarshal(m, b) -} -func (m *DeleteDBReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteDBReply.Marshal(b, m, deterministic) -} -func (m *DeleteDBReply) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteDBReply.Merge(m, src) -} -func (m *DeleteDBReply) XXX_Size() int { - return xxx_messageInfo_DeleteDBReply.Size(m) -} -func (m *DeleteDBReply) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteDBReply.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteDBReply proto.InternalMessageInfo - -type NewCollectionRequest struct { - DbID []byte `protobuf:"bytes,1,opt,name=dbID,proto3" json:"dbID,omitempty"` - Config *CollectionConfig `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NewCollectionRequest) Reset() { *m = NewCollectionRequest{} } -func (m *NewCollectionRequest) String() string { return proto.CompactTextString(m) } -func (*NewCollectionRequest) ProtoMessage() {} -func (*NewCollectionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f2ba358bb2150022, []int{13} -} - -func (m *NewCollectionRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NewCollectionRequest.Unmarshal(m, b) -} -func (m *NewCollectionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NewCollectionRequest.Marshal(b, m, deterministic) -} -func (m *NewCollectionRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_NewCollectionRequest.Merge(m, src) -} -func (m *NewCollectionRequest) XXX_Size() int { - return xxx_messageInfo_NewCollectionRequest.Size(m) -} -func (m *NewCollectionRequest) XXX_DiscardUnknown() { - xxx_messageInfo_NewCollectionRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_NewCollectionRequest proto.InternalMessageInfo - -func (m *NewCollectionRequest) GetDbID() []byte { - if m != nil { - return m.DbID - } - return nil -} - -func (m *NewCollectionRequest) GetConfig() *CollectionConfig { - if m != nil { - return m.Config - } - return nil -} - -type NewCollectionReply struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NewCollectionReply) Reset() { *m = NewCollectionReply{} } -func (m *NewCollectionReply) String() string { return proto.CompactTextString(m) } -func (*NewCollectionReply) ProtoMessage() {} -func (*NewCollectionReply) Descriptor() ([]byte, []int) { - return fileDescriptor_f2ba358bb2150022, []int{14} -} - -func (m *NewCollectionReply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NewCollectionReply.Unmarshal(m, b) -} -func (m *NewCollectionReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NewCollectionReply.Marshal(b, m, deterministic) -} -func (m *NewCollectionReply) XXX_Merge(src proto.Message) { - xxx_messageInfo_NewCollectionReply.Merge(m, src) -} -func (m *NewCollectionReply) XXX_Size() int { - return xxx_messageInfo_NewCollectionReply.Size(m) -} -func (m *NewCollectionReply) XXX_DiscardUnknown() { - xxx_messageInfo_NewCollectionReply.DiscardUnknown(m) -} - -var xxx_messageInfo_NewCollectionReply proto.InternalMessageInfo - -type UpdateCollectionRequest struct { - DbID []byte `protobuf:"bytes,1,opt,name=dbID,proto3" json:"dbID,omitempty"` - Config *CollectionConfig `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *UpdateCollectionRequest) Reset() { *m = UpdateCollectionRequest{} } -func (m *UpdateCollectionRequest) String() string { return proto.CompactTextString(m) } -func (*UpdateCollectionRequest) ProtoMessage() {} -func (*UpdateCollectionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f2ba358bb2150022, []int{15} -} - -func (m *UpdateCollectionRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_UpdateCollectionRequest.Unmarshal(m, b) -} -func (m *UpdateCollectionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_UpdateCollectionRequest.Marshal(b, m, deterministic) -} -func (m *UpdateCollectionRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_UpdateCollectionRequest.Merge(m, src) -} -func (m *UpdateCollectionRequest) XXX_Size() int { - return xxx_messageInfo_UpdateCollectionRequest.Size(m) -} -func (m *UpdateCollectionRequest) XXX_DiscardUnknown() { - xxx_messageInfo_UpdateCollectionRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_UpdateCollectionRequest proto.InternalMessageInfo - -func (m *UpdateCollectionRequest) GetDbID() []byte { - if m != nil { - return m.DbID - } - return nil -} - -func (m *UpdateCollectionRequest) GetConfig() *CollectionConfig { - if m != nil { - return m.Config - } - return nil -} - -type UpdateCollectionReply struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *UpdateCollectionReply) Reset() { *m = UpdateCollectionReply{} } -func (m *UpdateCollectionReply) String() string { return proto.CompactTextString(m) } -func (*UpdateCollectionReply) ProtoMessage() {} -func (*UpdateCollectionReply) Descriptor() ([]byte, []int) { - return fileDescriptor_f2ba358bb2150022, []int{16} -} - -func (m *UpdateCollectionReply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_UpdateCollectionReply.Unmarshal(m, b) -} -func (m *UpdateCollectionReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_UpdateCollectionReply.Marshal(b, m, deterministic) -} -func (m *UpdateCollectionReply) XXX_Merge(src proto.Message) { - xxx_messageInfo_UpdateCollectionReply.Merge(m, src) -} -func (m *UpdateCollectionReply) XXX_Size() int { - return xxx_messageInfo_UpdateCollectionReply.Size(m) -} -func (m *UpdateCollectionReply) XXX_DiscardUnknown() { - xxx_messageInfo_UpdateCollectionReply.DiscardUnknown(m) -} - -var xxx_messageInfo_UpdateCollectionReply proto.InternalMessageInfo - -type DeleteCollectionRequest struct { - DbID []byte `protobuf:"bytes,1,opt,name=dbID,proto3" json:"dbID,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeleteCollectionRequest) Reset() { *m = DeleteCollectionRequest{} } -func (m *DeleteCollectionRequest) String() string { return proto.CompactTextString(m) } -func (*DeleteCollectionRequest) ProtoMessage() {} -func (*DeleteCollectionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f2ba358bb2150022, []int{17} -} - -func (m *DeleteCollectionRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteCollectionRequest.Unmarshal(m, b) -} -func (m *DeleteCollectionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteCollectionRequest.Marshal(b, m, deterministic) -} -func (m *DeleteCollectionRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteCollectionRequest.Merge(m, src) -} -func (m *DeleteCollectionRequest) XXX_Size() int { - return xxx_messageInfo_DeleteCollectionRequest.Size(m) -} -func (m *DeleteCollectionRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteCollectionRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteCollectionRequest proto.InternalMessageInfo - -func (m *DeleteCollectionRequest) GetDbID() []byte { - if m != nil { - return m.DbID - } - return nil -} - -func (m *DeleteCollectionRequest) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -type DeleteCollectionReply struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeleteCollectionReply) Reset() { *m = DeleteCollectionReply{} } -func (m *DeleteCollectionReply) String() string { return proto.CompactTextString(m) } -func (*DeleteCollectionReply) ProtoMessage() {} -func (*DeleteCollectionReply) Descriptor() ([]byte, []int) { - return fileDescriptor_f2ba358bb2150022, []int{18} -} - -func (m *DeleteCollectionReply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteCollectionReply.Unmarshal(m, b) -} -func (m *DeleteCollectionReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteCollectionReply.Marshal(b, m, deterministic) -} -func (m *DeleteCollectionReply) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteCollectionReply.Merge(m, src) -} -func (m *DeleteCollectionReply) XXX_Size() int { - return xxx_messageInfo_DeleteCollectionReply.Size(m) -} -func (m *DeleteCollectionReply) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteCollectionReply.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteCollectionReply proto.InternalMessageInfo - -type GetCollectionInfoRequest struct { - DbID []byte `protobuf:"bytes,1,opt,name=dbID,proto3" json:"dbID,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetCollectionInfoRequest) Reset() { *m = GetCollectionInfoRequest{} } -func (m *GetCollectionInfoRequest) String() string { return proto.CompactTextString(m) } -func (*GetCollectionInfoRequest) ProtoMessage() {} -func (*GetCollectionInfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f2ba358bb2150022, []int{19} -} - -func (m *GetCollectionInfoRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetCollectionInfoRequest.Unmarshal(m, b) -} -func (m *GetCollectionInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetCollectionInfoRequest.Marshal(b, m, deterministic) -} -func (m *GetCollectionInfoRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetCollectionInfoRequest.Merge(m, src) -} -func (m *GetCollectionInfoRequest) XXX_Size() int { - return xxx_messageInfo_GetCollectionInfoRequest.Size(m) -} -func (m *GetCollectionInfoRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetCollectionInfoRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetCollectionInfoRequest proto.InternalMessageInfo - -func (m *GetCollectionInfoRequest) GetDbID() []byte { - if m != nil { - return m.DbID - } - return nil -} - -func (m *GetCollectionInfoRequest) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -type GetCollectionInfoReply struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Schema []byte `protobuf:"bytes,2,opt,name=schema,proto3" json:"schema,omitempty"` - Indexes []*Index `protobuf:"bytes,3,rep,name=indexes,proto3" json:"indexes,omitempty"` - WriteValidator string `protobuf:"bytes,4,opt,name=writeValidator,proto3" json:"writeValidator,omitempty"` - ReadFilter string `protobuf:"bytes,5,opt,name=readFilter,proto3" json:"readFilter,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetCollectionInfoReply) Reset() { *m = GetCollectionInfoReply{} } -func (m *GetCollectionInfoReply) String() string { return proto.CompactTextString(m) } -func (*GetCollectionInfoReply) ProtoMessage() {} -func (*GetCollectionInfoReply) Descriptor() ([]byte, []int) { - return fileDescriptor_f2ba358bb2150022, []int{20} -} - -func (m *GetCollectionInfoReply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetCollectionInfoReply.Unmarshal(m, b) -} -func (m *GetCollectionInfoReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetCollectionInfoReply.Marshal(b, m, deterministic) -} -func (m *GetCollectionInfoReply) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetCollectionInfoReply.Merge(m, src) -} -func (m *GetCollectionInfoReply) XXX_Size() int { - return xxx_messageInfo_GetCollectionInfoReply.Size(m) -} -func (m *GetCollectionInfoReply) XXX_DiscardUnknown() { - xxx_messageInfo_GetCollectionInfoReply.DiscardUnknown(m) -} - -var xxx_messageInfo_GetCollectionInfoReply proto.InternalMessageInfo - -func (m *GetCollectionInfoReply) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *GetCollectionInfoReply) GetSchema() []byte { - if m != nil { - return m.Schema - } - return nil -} - -func (m *GetCollectionInfoReply) GetIndexes() []*Index { - if m != nil { - return m.Indexes - } - return nil -} - -func (m *GetCollectionInfoReply) GetWriteValidator() string { - if m != nil { - return m.WriteValidator - } - return "" -} - -func (m *GetCollectionInfoReply) GetReadFilter() string { - if m != nil { - return m.ReadFilter - } - return "" -} - -type GetCollectionIndexesRequest struct { - DbID []byte `protobuf:"bytes,1,opt,name=dbID,proto3" json:"dbID,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetCollectionIndexesRequest) Reset() { *m = GetCollectionIndexesRequest{} } -func (m *GetCollectionIndexesRequest) String() string { return proto.CompactTextString(m) } -func (*GetCollectionIndexesRequest) ProtoMessage() {} -func (*GetCollectionIndexesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f2ba358bb2150022, []int{21} -} - -func (m *GetCollectionIndexesRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetCollectionIndexesRequest.Unmarshal(m, b) -} -func (m *GetCollectionIndexesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetCollectionIndexesRequest.Marshal(b, m, deterministic) -} -func (m *GetCollectionIndexesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetCollectionIndexesRequest.Merge(m, src) -} -func (m *GetCollectionIndexesRequest) XXX_Size() int { - return xxx_messageInfo_GetCollectionIndexesRequest.Size(m) -} -func (m *GetCollectionIndexesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetCollectionIndexesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetCollectionIndexesRequest proto.InternalMessageInfo - -func (m *GetCollectionIndexesRequest) GetDbID() []byte { - if m != nil { - return m.DbID - } - return nil -} - -func (m *GetCollectionIndexesRequest) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -type GetCollectionIndexesReply struct { - Indexes []*Index `protobuf:"bytes,1,rep,name=indexes,proto3" json:"indexes,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetCollectionIndexesReply) Reset() { *m = GetCollectionIndexesReply{} } -func (m *GetCollectionIndexesReply) String() string { return proto.CompactTextString(m) } -func (*GetCollectionIndexesReply) ProtoMessage() {} -func (*GetCollectionIndexesReply) Descriptor() ([]byte, []int) { - return fileDescriptor_f2ba358bb2150022, []int{22} -} - -func (m *GetCollectionIndexesReply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetCollectionIndexesReply.Unmarshal(m, b) -} -func (m *GetCollectionIndexesReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetCollectionIndexesReply.Marshal(b, m, deterministic) -} -func (m *GetCollectionIndexesReply) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetCollectionIndexesReply.Merge(m, src) -} -func (m *GetCollectionIndexesReply) XXX_Size() int { - return xxx_messageInfo_GetCollectionIndexesReply.Size(m) -} -func (m *GetCollectionIndexesReply) XXX_DiscardUnknown() { - xxx_messageInfo_GetCollectionIndexesReply.DiscardUnknown(m) -} - -var xxx_messageInfo_GetCollectionIndexesReply proto.InternalMessageInfo - -func (m *GetCollectionIndexesReply) GetIndexes() []*Index { - if m != nil { - return m.Indexes - } - return nil -} - -type ListCollectionsRequest struct { - DbID []byte `protobuf:"bytes,1,opt,name=dbID,proto3" json:"dbID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ListCollectionsRequest) Reset() { *m = ListCollectionsRequest{} } -func (m *ListCollectionsRequest) String() string { return proto.CompactTextString(m) } -func (*ListCollectionsRequest) ProtoMessage() {} -func (*ListCollectionsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f2ba358bb2150022, []int{23} -} - -func (m *ListCollectionsRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ListCollectionsRequest.Unmarshal(m, b) -} -func (m *ListCollectionsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ListCollectionsRequest.Marshal(b, m, deterministic) -} -func (m *ListCollectionsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListCollectionsRequest.Merge(m, src) -} -func (m *ListCollectionsRequest) XXX_Size() int { - return xxx_messageInfo_ListCollectionsRequest.Size(m) -} -func (m *ListCollectionsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ListCollectionsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ListCollectionsRequest proto.InternalMessageInfo - -func (m *ListCollectionsRequest) GetDbID() []byte { - if m != nil { - return m.DbID - } - return nil -} - -type ListCollectionsReply struct { - Collections []*GetCollectionInfoReply `protobuf:"bytes,1,rep,name=collections,proto3" json:"collections,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ListCollectionsReply) Reset() { *m = ListCollectionsReply{} } -func (m *ListCollectionsReply) String() string { return proto.CompactTextString(m) } -func (*ListCollectionsReply) ProtoMessage() {} -func (*ListCollectionsReply) Descriptor() ([]byte, []int) { - return fileDescriptor_f2ba358bb2150022, []int{24} -} - -func (m *ListCollectionsReply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ListCollectionsReply.Unmarshal(m, b) -} -func (m *ListCollectionsReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ListCollectionsReply.Marshal(b, m, deterministic) -} -func (m *ListCollectionsReply) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListCollectionsReply.Merge(m, src) -} -func (m *ListCollectionsReply) XXX_Size() int { - return xxx_messageInfo_ListCollectionsReply.Size(m) -} -func (m *ListCollectionsReply) XXX_DiscardUnknown() { - xxx_messageInfo_ListCollectionsReply.DiscardUnknown(m) -} - -var xxx_messageInfo_ListCollectionsReply proto.InternalMessageInfo - -func (m *ListCollectionsReply) GetCollections() []*GetCollectionInfoReply { - if m != nil { - return m.Collections - } - return nil -} - -type CreateRequest struct { - DbID []byte `protobuf:"bytes,1,opt,name=dbID,proto3" json:"dbID,omitempty"` - CollectionName string `protobuf:"bytes,2,opt,name=collectionName,proto3" json:"collectionName,omitempty"` - Instances [][]byte `protobuf:"bytes,3,rep,name=instances,proto3" json:"instances,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CreateRequest) Reset() { *m = CreateRequest{} } -func (m *CreateRequest) String() string { return proto.CompactTextString(m) } -func (*CreateRequest) ProtoMessage() {} -func (*CreateRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f2ba358bb2150022, []int{25} -} - -func (m *CreateRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CreateRequest.Unmarshal(m, b) -} -func (m *CreateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CreateRequest.Marshal(b, m, deterministic) -} -func (m *CreateRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateRequest.Merge(m, src) -} -func (m *CreateRequest) XXX_Size() int { - return xxx_messageInfo_CreateRequest.Size(m) -} -func (m *CreateRequest) XXX_DiscardUnknown() { - xxx_messageInfo_CreateRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateRequest proto.InternalMessageInfo - -func (m *CreateRequest) GetDbID() []byte { - if m != nil { - return m.DbID - } - return nil -} - -func (m *CreateRequest) GetCollectionName() string { - if m != nil { - return m.CollectionName - } - return "" -} - -func (m *CreateRequest) GetInstances() [][]byte { - if m != nil { - return m.Instances - } - return nil -} - -type CreateReply struct { - InstanceIDs []string `protobuf:"bytes,1,rep,name=instanceIDs,proto3" json:"instanceIDs,omitempty"` - TransactionError string `protobuf:"bytes,2,opt,name=transactionError,proto3" json:"transactionError,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CreateReply) Reset() { *m = CreateReply{} } -func (m *CreateReply) String() string { return proto.CompactTextString(m) } -func (*CreateReply) ProtoMessage() {} -func (*CreateReply) Descriptor() ([]byte, []int) { - return fileDescriptor_f2ba358bb2150022, []int{26} -} - -func (m *CreateReply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CreateReply.Unmarshal(m, b) -} -func (m *CreateReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CreateReply.Marshal(b, m, deterministic) -} -func (m *CreateReply) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateReply.Merge(m, src) -} -func (m *CreateReply) XXX_Size() int { - return xxx_messageInfo_CreateReply.Size(m) -} -func (m *CreateReply) XXX_DiscardUnknown() { - xxx_messageInfo_CreateReply.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateReply proto.InternalMessageInfo - -func (m *CreateReply) GetInstanceIDs() []string { - if m != nil { - return m.InstanceIDs - } - return nil -} - -func (m *CreateReply) GetTransactionError() string { - if m != nil { - return m.TransactionError - } - return "" -} - -type VerifyRequest struct { - DbID []byte `protobuf:"bytes,1,opt,name=dbID,proto3" json:"dbID,omitempty"` - CollectionName string `protobuf:"bytes,2,opt,name=collectionName,proto3" json:"collectionName,omitempty"` - Instances [][]byte `protobuf:"bytes,3,rep,name=instances,proto3" json:"instances,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *VerifyRequest) Reset() { *m = VerifyRequest{} } -func (m *VerifyRequest) String() string { return proto.CompactTextString(m) } -func (*VerifyRequest) ProtoMessage() {} -func (*VerifyRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f2ba358bb2150022, []int{27} -} - -func (m *VerifyRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_VerifyRequest.Unmarshal(m, b) -} -func (m *VerifyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_VerifyRequest.Marshal(b, m, deterministic) -} -func (m *VerifyRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_VerifyRequest.Merge(m, src) -} -func (m *VerifyRequest) XXX_Size() int { - return xxx_messageInfo_VerifyRequest.Size(m) -} -func (m *VerifyRequest) XXX_DiscardUnknown() { - xxx_messageInfo_VerifyRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_VerifyRequest proto.InternalMessageInfo - -func (m *VerifyRequest) GetDbID() []byte { - if m != nil { - return m.DbID - } - return nil -} - -func (m *VerifyRequest) GetCollectionName() string { - if m != nil { - return m.CollectionName - } - return "" -} - -func (m *VerifyRequest) GetInstances() [][]byte { - if m != nil { - return m.Instances - } - return nil -} - -type VerifyReply struct { - TransactionError string `protobuf:"bytes,1,opt,name=transactionError,proto3" json:"transactionError,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *VerifyReply) Reset() { *m = VerifyReply{} } -func (m *VerifyReply) String() string { return proto.CompactTextString(m) } -func (*VerifyReply) ProtoMessage() {} -func (*VerifyReply) Descriptor() ([]byte, []int) { - return fileDescriptor_f2ba358bb2150022, []int{28} -} - -func (m *VerifyReply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_VerifyReply.Unmarshal(m, b) -} -func (m *VerifyReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_VerifyReply.Marshal(b, m, deterministic) -} -func (m *VerifyReply) XXX_Merge(src proto.Message) { - xxx_messageInfo_VerifyReply.Merge(m, src) -} -func (m *VerifyReply) XXX_Size() int { - return xxx_messageInfo_VerifyReply.Size(m) -} -func (m *VerifyReply) XXX_DiscardUnknown() { - xxx_messageInfo_VerifyReply.DiscardUnknown(m) -} - -var xxx_messageInfo_VerifyReply proto.InternalMessageInfo - -func (m *VerifyReply) GetTransactionError() string { - if m != nil { - return m.TransactionError - } - return "" -} - -type SaveRequest struct { - DbID []byte `protobuf:"bytes,1,opt,name=dbID,proto3" json:"dbID,omitempty"` - CollectionName string `protobuf:"bytes,2,opt,name=collectionName,proto3" json:"collectionName,omitempty"` - Instances [][]byte `protobuf:"bytes,3,rep,name=instances,proto3" json:"instances,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SaveRequest) Reset() { *m = SaveRequest{} } -func (m *SaveRequest) String() string { return proto.CompactTextString(m) } -func (*SaveRequest) ProtoMessage() {} -func (*SaveRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f2ba358bb2150022, []int{29} -} - -func (m *SaveRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SaveRequest.Unmarshal(m, b) -} -func (m *SaveRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SaveRequest.Marshal(b, m, deterministic) -} -func (m *SaveRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_SaveRequest.Merge(m, src) -} -func (m *SaveRequest) XXX_Size() int { - return xxx_messageInfo_SaveRequest.Size(m) -} -func (m *SaveRequest) XXX_DiscardUnknown() { - xxx_messageInfo_SaveRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_SaveRequest proto.InternalMessageInfo - -func (m *SaveRequest) GetDbID() []byte { - if m != nil { - return m.DbID - } - return nil -} - -func (m *SaveRequest) GetCollectionName() string { - if m != nil { - return m.CollectionName - } - return "" -} - -func (m *SaveRequest) GetInstances() [][]byte { - if m != nil { - return m.Instances - } - return nil -} - -type SaveReply struct { - TransactionError string `protobuf:"bytes,1,opt,name=transactionError,proto3" json:"transactionError,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SaveReply) Reset() { *m = SaveReply{} } -func (m *SaveReply) String() string { return proto.CompactTextString(m) } -func (*SaveReply) ProtoMessage() {} -func (*SaveReply) Descriptor() ([]byte, []int) { - return fileDescriptor_f2ba358bb2150022, []int{30} -} - -func (m *SaveReply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SaveReply.Unmarshal(m, b) -} -func (m *SaveReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SaveReply.Marshal(b, m, deterministic) -} -func (m *SaveReply) XXX_Merge(src proto.Message) { - xxx_messageInfo_SaveReply.Merge(m, src) -} -func (m *SaveReply) XXX_Size() int { - return xxx_messageInfo_SaveReply.Size(m) -} -func (m *SaveReply) XXX_DiscardUnknown() { - xxx_messageInfo_SaveReply.DiscardUnknown(m) -} - -var xxx_messageInfo_SaveReply proto.InternalMessageInfo - -func (m *SaveReply) GetTransactionError() string { - if m != nil { - return m.TransactionError - } - return "" -} - -type DeleteRequest struct { - DbID []byte `protobuf:"bytes,1,opt,name=dbID,proto3" json:"dbID,omitempty"` - CollectionName string `protobuf:"bytes,2,opt,name=collectionName,proto3" json:"collectionName,omitempty"` - InstanceIDs []string `protobuf:"bytes,3,rep,name=instanceIDs,proto3" json:"instanceIDs,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeleteRequest) Reset() { *m = DeleteRequest{} } -func (m *DeleteRequest) String() string { return proto.CompactTextString(m) } -func (*DeleteRequest) ProtoMessage() {} -func (*DeleteRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f2ba358bb2150022, []int{31} -} - -func (m *DeleteRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteRequest.Unmarshal(m, b) -} -func (m *DeleteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteRequest.Marshal(b, m, deterministic) -} -func (m *DeleteRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteRequest.Merge(m, src) -} -func (m *DeleteRequest) XXX_Size() int { - return xxx_messageInfo_DeleteRequest.Size(m) -} -func (m *DeleteRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteRequest proto.InternalMessageInfo - -func (m *DeleteRequest) GetDbID() []byte { - if m != nil { - return m.DbID - } - return nil -} - -func (m *DeleteRequest) GetCollectionName() string { - if m != nil { - return m.CollectionName - } - return "" -} - -func (m *DeleteRequest) GetInstanceIDs() []string { - if m != nil { - return m.InstanceIDs - } - return nil -} - -type DeleteReply struct { - TransactionError string `protobuf:"bytes,1,opt,name=transactionError,proto3" json:"transactionError,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeleteReply) Reset() { *m = DeleteReply{} } -func (m *DeleteReply) String() string { return proto.CompactTextString(m) } -func (*DeleteReply) ProtoMessage() {} -func (*DeleteReply) Descriptor() ([]byte, []int) { - return fileDescriptor_f2ba358bb2150022, []int{32} -} - -func (m *DeleteReply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteReply.Unmarshal(m, b) -} -func (m *DeleteReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteReply.Marshal(b, m, deterministic) -} -func (m *DeleteReply) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteReply.Merge(m, src) -} -func (m *DeleteReply) XXX_Size() int { - return xxx_messageInfo_DeleteReply.Size(m) -} -func (m *DeleteReply) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteReply.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteReply proto.InternalMessageInfo - -func (m *DeleteReply) GetTransactionError() string { - if m != nil { - return m.TransactionError - } - return "" -} - -type HasRequest struct { - DbID []byte `protobuf:"bytes,1,opt,name=dbID,proto3" json:"dbID,omitempty"` - CollectionName string `protobuf:"bytes,2,opt,name=collectionName,proto3" json:"collectionName,omitempty"` - InstanceIDs []string `protobuf:"bytes,3,rep,name=instanceIDs,proto3" json:"instanceIDs,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *HasRequest) Reset() { *m = HasRequest{} } -func (m *HasRequest) String() string { return proto.CompactTextString(m) } -func (*HasRequest) ProtoMessage() {} -func (*HasRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f2ba358bb2150022, []int{33} -} - -func (m *HasRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_HasRequest.Unmarshal(m, b) -} -func (m *HasRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_HasRequest.Marshal(b, m, deterministic) -} -func (m *HasRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_HasRequest.Merge(m, src) -} -func (m *HasRequest) XXX_Size() int { - return xxx_messageInfo_HasRequest.Size(m) -} -func (m *HasRequest) XXX_DiscardUnknown() { - xxx_messageInfo_HasRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_HasRequest proto.InternalMessageInfo - -func (m *HasRequest) GetDbID() []byte { - if m != nil { - return m.DbID - } - return nil -} - -func (m *HasRequest) GetCollectionName() string { - if m != nil { - return m.CollectionName - } - return "" -} - -func (m *HasRequest) GetInstanceIDs() []string { - if m != nil { - return m.InstanceIDs - } - return nil -} - -type HasReply struct { - Exists bool `protobuf:"varint,1,opt,name=exists,proto3" json:"exists,omitempty"` - TransactionError string `protobuf:"bytes,2,opt,name=transactionError,proto3" json:"transactionError,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *HasReply) Reset() { *m = HasReply{} } -func (m *HasReply) String() string { return proto.CompactTextString(m) } -func (*HasReply) ProtoMessage() {} -func (*HasReply) Descriptor() ([]byte, []int) { - return fileDescriptor_f2ba358bb2150022, []int{34} -} - -func (m *HasReply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_HasReply.Unmarshal(m, b) -} -func (m *HasReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_HasReply.Marshal(b, m, deterministic) -} -func (m *HasReply) XXX_Merge(src proto.Message) { - xxx_messageInfo_HasReply.Merge(m, src) -} -func (m *HasReply) XXX_Size() int { - return xxx_messageInfo_HasReply.Size(m) -} -func (m *HasReply) XXX_DiscardUnknown() { - xxx_messageInfo_HasReply.DiscardUnknown(m) -} - -var xxx_messageInfo_HasReply proto.InternalMessageInfo - -func (m *HasReply) GetExists() bool { - if m != nil { - return m.Exists - } - return false -} - -func (m *HasReply) GetTransactionError() string { - if m != nil { - return m.TransactionError - } - return "" -} - -type FindRequest struct { - DbID []byte `protobuf:"bytes,1,opt,name=dbID,proto3" json:"dbID,omitempty"` - CollectionName string `protobuf:"bytes,2,opt,name=collectionName,proto3" json:"collectionName,omitempty"` - QueryJSON []byte `protobuf:"bytes,3,opt,name=queryJSON,proto3" json:"queryJSON,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *FindRequest) Reset() { *m = FindRequest{} } -func (m *FindRequest) String() string { return proto.CompactTextString(m) } -func (*FindRequest) ProtoMessage() {} -func (*FindRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f2ba358bb2150022, []int{35} -} - -func (m *FindRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_FindRequest.Unmarshal(m, b) -} -func (m *FindRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_FindRequest.Marshal(b, m, deterministic) -} -func (m *FindRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_FindRequest.Merge(m, src) -} -func (m *FindRequest) XXX_Size() int { - return xxx_messageInfo_FindRequest.Size(m) -} -func (m *FindRequest) XXX_DiscardUnknown() { - xxx_messageInfo_FindRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_FindRequest proto.InternalMessageInfo - -func (m *FindRequest) GetDbID() []byte { - if m != nil { - return m.DbID - } - return nil -} - -func (m *FindRequest) GetCollectionName() string { - if m != nil { - return m.CollectionName - } - return "" -} - -func (m *FindRequest) GetQueryJSON() []byte { - if m != nil { - return m.QueryJSON - } - return nil -} - -type FindReply struct { - Instances [][]byte `protobuf:"bytes,1,rep,name=instances,proto3" json:"instances,omitempty"` - TransactionError string `protobuf:"bytes,2,opt,name=transactionError,proto3" json:"transactionError,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *FindReply) Reset() { *m = FindReply{} } -func (m *FindReply) String() string { return proto.CompactTextString(m) } -func (*FindReply) ProtoMessage() {} -func (*FindReply) Descriptor() ([]byte, []int) { - return fileDescriptor_f2ba358bb2150022, []int{36} -} - -func (m *FindReply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_FindReply.Unmarshal(m, b) -} -func (m *FindReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_FindReply.Marshal(b, m, deterministic) -} -func (m *FindReply) XXX_Merge(src proto.Message) { - xxx_messageInfo_FindReply.Merge(m, src) -} -func (m *FindReply) XXX_Size() int { - return xxx_messageInfo_FindReply.Size(m) -} -func (m *FindReply) XXX_DiscardUnknown() { - xxx_messageInfo_FindReply.DiscardUnknown(m) -} - -var xxx_messageInfo_FindReply proto.InternalMessageInfo - -func (m *FindReply) GetInstances() [][]byte { - if m != nil { - return m.Instances - } - return nil -} - -func (m *FindReply) GetTransactionError() string { - if m != nil { - return m.TransactionError - } - return "" -} - -type FindByIDRequest struct { - DbID []byte `protobuf:"bytes,1,opt,name=dbID,proto3" json:"dbID,omitempty"` - CollectionName string `protobuf:"bytes,2,opt,name=collectionName,proto3" json:"collectionName,omitempty"` - InstanceID string `protobuf:"bytes,3,opt,name=instanceID,proto3" json:"instanceID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *FindByIDRequest) Reset() { *m = FindByIDRequest{} } -func (m *FindByIDRequest) String() string { return proto.CompactTextString(m) } -func (*FindByIDRequest) ProtoMessage() {} -func (*FindByIDRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f2ba358bb2150022, []int{37} -} - -func (m *FindByIDRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_FindByIDRequest.Unmarshal(m, b) -} -func (m *FindByIDRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_FindByIDRequest.Marshal(b, m, deterministic) -} -func (m *FindByIDRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_FindByIDRequest.Merge(m, src) -} -func (m *FindByIDRequest) XXX_Size() int { - return xxx_messageInfo_FindByIDRequest.Size(m) -} -func (m *FindByIDRequest) XXX_DiscardUnknown() { - xxx_messageInfo_FindByIDRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_FindByIDRequest proto.InternalMessageInfo - -func (m *FindByIDRequest) GetDbID() []byte { - if m != nil { - return m.DbID - } - return nil -} - -func (m *FindByIDRequest) GetCollectionName() string { - if m != nil { - return m.CollectionName - } - return "" -} - -func (m *FindByIDRequest) GetInstanceID() string { - if m != nil { - return m.InstanceID - } - return "" -} - -type FindByIDReply struct { - Instance []byte `protobuf:"bytes,1,opt,name=instance,proto3" json:"instance,omitempty"` - TransactionError string `protobuf:"bytes,2,opt,name=transactionError,proto3" json:"transactionError,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *FindByIDReply) Reset() { *m = FindByIDReply{} } -func (m *FindByIDReply) String() string { return proto.CompactTextString(m) } -func (*FindByIDReply) ProtoMessage() {} -func (*FindByIDReply) Descriptor() ([]byte, []int) { - return fileDescriptor_f2ba358bb2150022, []int{38} -} - -func (m *FindByIDReply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_FindByIDReply.Unmarshal(m, b) -} -func (m *FindByIDReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_FindByIDReply.Marshal(b, m, deterministic) -} -func (m *FindByIDReply) XXX_Merge(src proto.Message) { - xxx_messageInfo_FindByIDReply.Merge(m, src) -} -func (m *FindByIDReply) XXX_Size() int { - return xxx_messageInfo_FindByIDReply.Size(m) -} -func (m *FindByIDReply) XXX_DiscardUnknown() { - xxx_messageInfo_FindByIDReply.DiscardUnknown(m) -} - -var xxx_messageInfo_FindByIDReply proto.InternalMessageInfo - -func (m *FindByIDReply) GetInstance() []byte { - if m != nil { - return m.Instance - } - return nil -} - -func (m *FindByIDReply) GetTransactionError() string { - if m != nil { - return m.TransactionError - } - return "" -} - -type DiscardRequest struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DiscardRequest) Reset() { *m = DiscardRequest{} } -func (m *DiscardRequest) String() string { return proto.CompactTextString(m) } -func (*DiscardRequest) ProtoMessage() {} -func (*DiscardRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f2ba358bb2150022, []int{39} -} - -func (m *DiscardRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DiscardRequest.Unmarshal(m, b) -} -func (m *DiscardRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DiscardRequest.Marshal(b, m, deterministic) -} -func (m *DiscardRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DiscardRequest.Merge(m, src) -} -func (m *DiscardRequest) XXX_Size() int { - return xxx_messageInfo_DiscardRequest.Size(m) -} -func (m *DiscardRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DiscardRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DiscardRequest proto.InternalMessageInfo - -type DiscardReply struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DiscardReply) Reset() { *m = DiscardReply{} } -func (m *DiscardReply) String() string { return proto.CompactTextString(m) } -func (*DiscardReply) ProtoMessage() {} -func (*DiscardReply) Descriptor() ([]byte, []int) { - return fileDescriptor_f2ba358bb2150022, []int{40} -} - -func (m *DiscardReply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DiscardReply.Unmarshal(m, b) -} -func (m *DiscardReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DiscardReply.Marshal(b, m, deterministic) -} -func (m *DiscardReply) XXX_Merge(src proto.Message) { - xxx_messageInfo_DiscardReply.Merge(m, src) -} -func (m *DiscardReply) XXX_Size() int { - return xxx_messageInfo_DiscardReply.Size(m) -} -func (m *DiscardReply) XXX_DiscardUnknown() { - xxx_messageInfo_DiscardReply.DiscardUnknown(m) -} - -var xxx_messageInfo_DiscardReply proto.InternalMessageInfo - -type StartTransactionRequest struct { - DbID []byte `protobuf:"bytes,1,opt,name=dbID,proto3" json:"dbID,omitempty"` - CollectionName string `protobuf:"bytes,2,opt,name=collectionName,proto3" json:"collectionName,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *StartTransactionRequest) Reset() { *m = StartTransactionRequest{} } -func (m *StartTransactionRequest) String() string { return proto.CompactTextString(m) } -func (*StartTransactionRequest) ProtoMessage() {} -func (*StartTransactionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f2ba358bb2150022, []int{41} -} - -func (m *StartTransactionRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_StartTransactionRequest.Unmarshal(m, b) -} -func (m *StartTransactionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_StartTransactionRequest.Marshal(b, m, deterministic) -} -func (m *StartTransactionRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_StartTransactionRequest.Merge(m, src) -} -func (m *StartTransactionRequest) XXX_Size() int { - return xxx_messageInfo_StartTransactionRequest.Size(m) -} -func (m *StartTransactionRequest) XXX_DiscardUnknown() { - xxx_messageInfo_StartTransactionRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_StartTransactionRequest proto.InternalMessageInfo - -func (m *StartTransactionRequest) GetDbID() []byte { - if m != nil { - return m.DbID - } - return nil -} - -func (m *StartTransactionRequest) GetCollectionName() string { - if m != nil { - return m.CollectionName - } - return "" -} - -type ReadTransactionRequest struct { - // Types that are valid to be assigned to Option: - // *ReadTransactionRequest_StartTransactionRequest - // *ReadTransactionRequest_HasRequest - // *ReadTransactionRequest_FindRequest - // *ReadTransactionRequest_FindByIDRequest - Option isReadTransactionRequest_Option `protobuf_oneof:"option"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ReadTransactionRequest) Reset() { *m = ReadTransactionRequest{} } -func (m *ReadTransactionRequest) String() string { return proto.CompactTextString(m) } -func (*ReadTransactionRequest) ProtoMessage() {} -func (*ReadTransactionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f2ba358bb2150022, []int{42} -} - -func (m *ReadTransactionRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ReadTransactionRequest.Unmarshal(m, b) -} -func (m *ReadTransactionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ReadTransactionRequest.Marshal(b, m, deterministic) -} -func (m *ReadTransactionRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ReadTransactionRequest.Merge(m, src) -} -func (m *ReadTransactionRequest) XXX_Size() int { - return xxx_messageInfo_ReadTransactionRequest.Size(m) -} -func (m *ReadTransactionRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ReadTransactionRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ReadTransactionRequest proto.InternalMessageInfo - -type isReadTransactionRequest_Option interface { - isReadTransactionRequest_Option() -} - -type ReadTransactionRequest_StartTransactionRequest struct { - StartTransactionRequest *StartTransactionRequest `protobuf:"bytes,1,opt,name=startTransactionRequest,proto3,oneof"` -} - -type ReadTransactionRequest_HasRequest struct { - HasRequest *HasRequest `protobuf:"bytes,2,opt,name=hasRequest,proto3,oneof"` -} - -type ReadTransactionRequest_FindRequest struct { - FindRequest *FindRequest `protobuf:"bytes,3,opt,name=findRequest,proto3,oneof"` -} - -type ReadTransactionRequest_FindByIDRequest struct { - FindByIDRequest *FindByIDRequest `protobuf:"bytes,4,opt,name=findByIDRequest,proto3,oneof"` -} - -func (*ReadTransactionRequest_StartTransactionRequest) isReadTransactionRequest_Option() {} - -func (*ReadTransactionRequest_HasRequest) isReadTransactionRequest_Option() {} - -func (*ReadTransactionRequest_FindRequest) isReadTransactionRequest_Option() {} - -func (*ReadTransactionRequest_FindByIDRequest) isReadTransactionRequest_Option() {} - -func (m *ReadTransactionRequest) GetOption() isReadTransactionRequest_Option { - if m != nil { - return m.Option - } - return nil -} - -func (m *ReadTransactionRequest) GetStartTransactionRequest() *StartTransactionRequest { - if x, ok := m.GetOption().(*ReadTransactionRequest_StartTransactionRequest); ok { - return x.StartTransactionRequest - } - return nil -} - -func (m *ReadTransactionRequest) GetHasRequest() *HasRequest { - if x, ok := m.GetOption().(*ReadTransactionRequest_HasRequest); ok { - return x.HasRequest - } - return nil -} - -func (m *ReadTransactionRequest) GetFindRequest() *FindRequest { - if x, ok := m.GetOption().(*ReadTransactionRequest_FindRequest); ok { - return x.FindRequest - } - return nil -} - -func (m *ReadTransactionRequest) GetFindByIDRequest() *FindByIDRequest { - if x, ok := m.GetOption().(*ReadTransactionRequest_FindByIDRequest); ok { - return x.FindByIDRequest - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*ReadTransactionRequest) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*ReadTransactionRequest_StartTransactionRequest)(nil), - (*ReadTransactionRequest_HasRequest)(nil), - (*ReadTransactionRequest_FindRequest)(nil), - (*ReadTransactionRequest_FindByIDRequest)(nil), - } -} - -type ReadTransactionReply struct { - // Types that are valid to be assigned to Option: - // *ReadTransactionReply_HasReply - // *ReadTransactionReply_FindReply - // *ReadTransactionReply_FindByIDReply - Option isReadTransactionReply_Option `protobuf_oneof:"option"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ReadTransactionReply) Reset() { *m = ReadTransactionReply{} } -func (m *ReadTransactionReply) String() string { return proto.CompactTextString(m) } -func (*ReadTransactionReply) ProtoMessage() {} -func (*ReadTransactionReply) Descriptor() ([]byte, []int) { - return fileDescriptor_f2ba358bb2150022, []int{43} -} - -func (m *ReadTransactionReply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ReadTransactionReply.Unmarshal(m, b) -} -func (m *ReadTransactionReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ReadTransactionReply.Marshal(b, m, deterministic) -} -func (m *ReadTransactionReply) XXX_Merge(src proto.Message) { - xxx_messageInfo_ReadTransactionReply.Merge(m, src) -} -func (m *ReadTransactionReply) XXX_Size() int { - return xxx_messageInfo_ReadTransactionReply.Size(m) -} -func (m *ReadTransactionReply) XXX_DiscardUnknown() { - xxx_messageInfo_ReadTransactionReply.DiscardUnknown(m) -} - -var xxx_messageInfo_ReadTransactionReply proto.InternalMessageInfo - -type isReadTransactionReply_Option interface { - isReadTransactionReply_Option() -} - -type ReadTransactionReply_HasReply struct { - HasReply *HasReply `protobuf:"bytes,1,opt,name=hasReply,proto3,oneof"` -} - -type ReadTransactionReply_FindReply struct { - FindReply *FindReply `protobuf:"bytes,2,opt,name=findReply,proto3,oneof"` -} - -type ReadTransactionReply_FindByIDReply struct { - FindByIDReply *FindByIDReply `protobuf:"bytes,3,opt,name=findByIDReply,proto3,oneof"` -} - -func (*ReadTransactionReply_HasReply) isReadTransactionReply_Option() {} - -func (*ReadTransactionReply_FindReply) isReadTransactionReply_Option() {} - -func (*ReadTransactionReply_FindByIDReply) isReadTransactionReply_Option() {} - -func (m *ReadTransactionReply) GetOption() isReadTransactionReply_Option { - if m != nil { - return m.Option - } - return nil -} - -func (m *ReadTransactionReply) GetHasReply() *HasReply { - if x, ok := m.GetOption().(*ReadTransactionReply_HasReply); ok { - return x.HasReply - } - return nil -} - -func (m *ReadTransactionReply) GetFindReply() *FindReply { - if x, ok := m.GetOption().(*ReadTransactionReply_FindReply); ok { - return x.FindReply - } - return nil -} - -func (m *ReadTransactionReply) GetFindByIDReply() *FindByIDReply { - if x, ok := m.GetOption().(*ReadTransactionReply_FindByIDReply); ok { - return x.FindByIDReply - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*ReadTransactionReply) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*ReadTransactionReply_HasReply)(nil), - (*ReadTransactionReply_FindReply)(nil), - (*ReadTransactionReply_FindByIDReply)(nil), - } -} - -type WriteTransactionRequest struct { - // Types that are valid to be assigned to Option: - // *WriteTransactionRequest_StartTransactionRequest - // *WriteTransactionRequest_CreateRequest - // *WriteTransactionRequest_VerifyRequest - // *WriteTransactionRequest_SaveRequest - // *WriteTransactionRequest_DeleteRequest - // *WriteTransactionRequest_HasRequest - // *WriteTransactionRequest_FindRequest - // *WriteTransactionRequest_FindByIDRequest - // *WriteTransactionRequest_DiscardRequest - Option isWriteTransactionRequest_Option `protobuf_oneof:"option"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *WriteTransactionRequest) Reset() { *m = WriteTransactionRequest{} } -func (m *WriteTransactionRequest) String() string { return proto.CompactTextString(m) } -func (*WriteTransactionRequest) ProtoMessage() {} -func (*WriteTransactionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f2ba358bb2150022, []int{44} -} - -func (m *WriteTransactionRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_WriteTransactionRequest.Unmarshal(m, b) -} -func (m *WriteTransactionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_WriteTransactionRequest.Marshal(b, m, deterministic) -} -func (m *WriteTransactionRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_WriteTransactionRequest.Merge(m, src) -} -func (m *WriteTransactionRequest) XXX_Size() int { - return xxx_messageInfo_WriteTransactionRequest.Size(m) -} -func (m *WriteTransactionRequest) XXX_DiscardUnknown() { - xxx_messageInfo_WriteTransactionRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_WriteTransactionRequest proto.InternalMessageInfo - -type isWriteTransactionRequest_Option interface { - isWriteTransactionRequest_Option() -} - -type WriteTransactionRequest_StartTransactionRequest struct { - StartTransactionRequest *StartTransactionRequest `protobuf:"bytes,1,opt,name=startTransactionRequest,proto3,oneof"` -} - -type WriteTransactionRequest_CreateRequest struct { - CreateRequest *CreateRequest `protobuf:"bytes,2,opt,name=createRequest,proto3,oneof"` -} - -type WriteTransactionRequest_VerifyRequest struct { - VerifyRequest *VerifyRequest `protobuf:"bytes,8,opt,name=verifyRequest,proto3,oneof"` -} - -type WriteTransactionRequest_SaveRequest struct { - SaveRequest *SaveRequest `protobuf:"bytes,3,opt,name=saveRequest,proto3,oneof"` -} - -type WriteTransactionRequest_DeleteRequest struct { - DeleteRequest *DeleteRequest `protobuf:"bytes,4,opt,name=deleteRequest,proto3,oneof"` -} - -type WriteTransactionRequest_HasRequest struct { - HasRequest *HasRequest `protobuf:"bytes,5,opt,name=hasRequest,proto3,oneof"` -} - -type WriteTransactionRequest_FindRequest struct { - FindRequest *FindRequest `protobuf:"bytes,6,opt,name=findRequest,proto3,oneof"` -} - -type WriteTransactionRequest_FindByIDRequest struct { - FindByIDRequest *FindByIDRequest `protobuf:"bytes,7,opt,name=findByIDRequest,proto3,oneof"` -} - -type WriteTransactionRequest_DiscardRequest struct { - DiscardRequest *DiscardRequest `protobuf:"bytes,9,opt,name=discardRequest,proto3,oneof"` -} - -func (*WriteTransactionRequest_StartTransactionRequest) isWriteTransactionRequest_Option() {} - -func (*WriteTransactionRequest_CreateRequest) isWriteTransactionRequest_Option() {} - -func (*WriteTransactionRequest_VerifyRequest) isWriteTransactionRequest_Option() {} - -func (*WriteTransactionRequest_SaveRequest) isWriteTransactionRequest_Option() {} - -func (*WriteTransactionRequest_DeleteRequest) isWriteTransactionRequest_Option() {} - -func (*WriteTransactionRequest_HasRequest) isWriteTransactionRequest_Option() {} - -func (*WriteTransactionRequest_FindRequest) isWriteTransactionRequest_Option() {} - -func (*WriteTransactionRequest_FindByIDRequest) isWriteTransactionRequest_Option() {} - -func (*WriteTransactionRequest_DiscardRequest) isWriteTransactionRequest_Option() {} - -func (m *WriteTransactionRequest) GetOption() isWriteTransactionRequest_Option { - if m != nil { - return m.Option - } - return nil -} - -func (m *WriteTransactionRequest) GetStartTransactionRequest() *StartTransactionRequest { - if x, ok := m.GetOption().(*WriteTransactionRequest_StartTransactionRequest); ok { - return x.StartTransactionRequest - } - return nil -} - -func (m *WriteTransactionRequest) GetCreateRequest() *CreateRequest { - if x, ok := m.GetOption().(*WriteTransactionRequest_CreateRequest); ok { - return x.CreateRequest - } - return nil -} - -func (m *WriteTransactionRequest) GetVerifyRequest() *VerifyRequest { - if x, ok := m.GetOption().(*WriteTransactionRequest_VerifyRequest); ok { - return x.VerifyRequest - } - return nil -} - -func (m *WriteTransactionRequest) GetSaveRequest() *SaveRequest { - if x, ok := m.GetOption().(*WriteTransactionRequest_SaveRequest); ok { - return x.SaveRequest - } - return nil -} - -func (m *WriteTransactionRequest) GetDeleteRequest() *DeleteRequest { - if x, ok := m.GetOption().(*WriteTransactionRequest_DeleteRequest); ok { - return x.DeleteRequest - } - return nil -} - -func (m *WriteTransactionRequest) GetHasRequest() *HasRequest { - if x, ok := m.GetOption().(*WriteTransactionRequest_HasRequest); ok { - return x.HasRequest - } - return nil -} - -func (m *WriteTransactionRequest) GetFindRequest() *FindRequest { - if x, ok := m.GetOption().(*WriteTransactionRequest_FindRequest); ok { - return x.FindRequest - } - return nil -} - -func (m *WriteTransactionRequest) GetFindByIDRequest() *FindByIDRequest { - if x, ok := m.GetOption().(*WriteTransactionRequest_FindByIDRequest); ok { - return x.FindByIDRequest - } - return nil -} - -func (m *WriteTransactionRequest) GetDiscardRequest() *DiscardRequest { - if x, ok := m.GetOption().(*WriteTransactionRequest_DiscardRequest); ok { - return x.DiscardRequest - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*WriteTransactionRequest) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*WriteTransactionRequest_StartTransactionRequest)(nil), - (*WriteTransactionRequest_CreateRequest)(nil), - (*WriteTransactionRequest_VerifyRequest)(nil), - (*WriteTransactionRequest_SaveRequest)(nil), - (*WriteTransactionRequest_DeleteRequest)(nil), - (*WriteTransactionRequest_HasRequest)(nil), - (*WriteTransactionRequest_FindRequest)(nil), - (*WriteTransactionRequest_FindByIDRequest)(nil), - (*WriteTransactionRequest_DiscardRequest)(nil), - } -} - -type WriteTransactionReply struct { - // Types that are valid to be assigned to Option: - // *WriteTransactionReply_CreateReply - // *WriteTransactionReply_VerifyReply - // *WriteTransactionReply_SaveReply - // *WriteTransactionReply_DeleteReply - // *WriteTransactionReply_HasReply - // *WriteTransactionReply_FindReply - // *WriteTransactionReply_FindByIDReply - // *WriteTransactionReply_DiscardReply - Option isWriteTransactionReply_Option `protobuf_oneof:"option"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *WriteTransactionReply) Reset() { *m = WriteTransactionReply{} } -func (m *WriteTransactionReply) String() string { return proto.CompactTextString(m) } -func (*WriteTransactionReply) ProtoMessage() {} -func (*WriteTransactionReply) Descriptor() ([]byte, []int) { - return fileDescriptor_f2ba358bb2150022, []int{45} -} - -func (m *WriteTransactionReply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_WriteTransactionReply.Unmarshal(m, b) -} -func (m *WriteTransactionReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_WriteTransactionReply.Marshal(b, m, deterministic) -} -func (m *WriteTransactionReply) XXX_Merge(src proto.Message) { - xxx_messageInfo_WriteTransactionReply.Merge(m, src) -} -func (m *WriteTransactionReply) XXX_Size() int { - return xxx_messageInfo_WriteTransactionReply.Size(m) -} -func (m *WriteTransactionReply) XXX_DiscardUnknown() { - xxx_messageInfo_WriteTransactionReply.DiscardUnknown(m) -} - -var xxx_messageInfo_WriteTransactionReply proto.InternalMessageInfo - -type isWriteTransactionReply_Option interface { - isWriteTransactionReply_Option() -} - -type WriteTransactionReply_CreateReply struct { - CreateReply *CreateReply `protobuf:"bytes,1,opt,name=createReply,proto3,oneof"` -} - -type WriteTransactionReply_VerifyReply struct { - VerifyReply *VerifyReply `protobuf:"bytes,7,opt,name=verifyReply,proto3,oneof"` -} - -type WriteTransactionReply_SaveReply struct { - SaveReply *SaveReply `protobuf:"bytes,2,opt,name=saveReply,proto3,oneof"` -} - -type WriteTransactionReply_DeleteReply struct { - DeleteReply *DeleteReply `protobuf:"bytes,3,opt,name=deleteReply,proto3,oneof"` -} - -type WriteTransactionReply_HasReply struct { - HasReply *HasReply `protobuf:"bytes,4,opt,name=hasReply,proto3,oneof"` -} - -type WriteTransactionReply_FindReply struct { - FindReply *FindReply `protobuf:"bytes,5,opt,name=findReply,proto3,oneof"` -} - -type WriteTransactionReply_FindByIDReply struct { - FindByIDReply *FindByIDReply `protobuf:"bytes,6,opt,name=findByIDReply,proto3,oneof"` -} - -type WriteTransactionReply_DiscardReply struct { - DiscardReply *DiscardReply `protobuf:"bytes,8,opt,name=discardReply,proto3,oneof"` -} - -func (*WriteTransactionReply_CreateReply) isWriteTransactionReply_Option() {} - -func (*WriteTransactionReply_VerifyReply) isWriteTransactionReply_Option() {} - -func (*WriteTransactionReply_SaveReply) isWriteTransactionReply_Option() {} - -func (*WriteTransactionReply_DeleteReply) isWriteTransactionReply_Option() {} - -func (*WriteTransactionReply_HasReply) isWriteTransactionReply_Option() {} - -func (*WriteTransactionReply_FindReply) isWriteTransactionReply_Option() {} - -func (*WriteTransactionReply_FindByIDReply) isWriteTransactionReply_Option() {} - -func (*WriteTransactionReply_DiscardReply) isWriteTransactionReply_Option() {} - -func (m *WriteTransactionReply) GetOption() isWriteTransactionReply_Option { - if m != nil { - return m.Option - } - return nil -} - -func (m *WriteTransactionReply) GetCreateReply() *CreateReply { - if x, ok := m.GetOption().(*WriteTransactionReply_CreateReply); ok { - return x.CreateReply - } - return nil -} - -func (m *WriteTransactionReply) GetVerifyReply() *VerifyReply { - if x, ok := m.GetOption().(*WriteTransactionReply_VerifyReply); ok { - return x.VerifyReply - } - return nil -} - -func (m *WriteTransactionReply) GetSaveReply() *SaveReply { - if x, ok := m.GetOption().(*WriteTransactionReply_SaveReply); ok { - return x.SaveReply - } - return nil -} - -func (m *WriteTransactionReply) GetDeleteReply() *DeleteReply { - if x, ok := m.GetOption().(*WriteTransactionReply_DeleteReply); ok { - return x.DeleteReply - } - return nil -} - -func (m *WriteTransactionReply) GetHasReply() *HasReply { - if x, ok := m.GetOption().(*WriteTransactionReply_HasReply); ok { - return x.HasReply - } - return nil -} - -func (m *WriteTransactionReply) GetFindReply() *FindReply { - if x, ok := m.GetOption().(*WriteTransactionReply_FindReply); ok { - return x.FindReply - } - return nil -} - -func (m *WriteTransactionReply) GetFindByIDReply() *FindByIDReply { - if x, ok := m.GetOption().(*WriteTransactionReply_FindByIDReply); ok { - return x.FindByIDReply - } - return nil -} - -func (m *WriteTransactionReply) GetDiscardReply() *DiscardReply { - if x, ok := m.GetOption().(*WriteTransactionReply_DiscardReply); ok { - return x.DiscardReply - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*WriteTransactionReply) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*WriteTransactionReply_CreateReply)(nil), - (*WriteTransactionReply_VerifyReply)(nil), - (*WriteTransactionReply_SaveReply)(nil), - (*WriteTransactionReply_DeleteReply)(nil), - (*WriteTransactionReply_HasReply)(nil), - (*WriteTransactionReply_FindReply)(nil), - (*WriteTransactionReply_FindByIDReply)(nil), - (*WriteTransactionReply_DiscardReply)(nil), - } -} - -type ListenRequest struct { - DbID []byte `protobuf:"bytes,1,opt,name=dbID,proto3" json:"dbID,omitempty"` - Filters []*ListenRequest_Filter `protobuf:"bytes,2,rep,name=filters,proto3" json:"filters,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ListenRequest) Reset() { *m = ListenRequest{} } -func (m *ListenRequest) String() string { return proto.CompactTextString(m) } -func (*ListenRequest) ProtoMessage() {} -func (*ListenRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f2ba358bb2150022, []int{46} -} - -func (m *ListenRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ListenRequest.Unmarshal(m, b) -} -func (m *ListenRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ListenRequest.Marshal(b, m, deterministic) -} -func (m *ListenRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListenRequest.Merge(m, src) -} -func (m *ListenRequest) XXX_Size() int { - return xxx_messageInfo_ListenRequest.Size(m) -} -func (m *ListenRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ListenRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ListenRequest proto.InternalMessageInfo - -func (m *ListenRequest) GetDbID() []byte { - if m != nil { - return m.DbID - } - return nil -} - -func (m *ListenRequest) GetFilters() []*ListenRequest_Filter { - if m != nil { - return m.Filters - } - return nil -} - -type ListenRequest_Filter struct { - CollectionName string `protobuf:"bytes,1,opt,name=collectionName,proto3" json:"collectionName,omitempty"` - InstanceID string `protobuf:"bytes,2,opt,name=instanceID,proto3" json:"instanceID,omitempty"` - Action ListenRequest_Filter_Action `protobuf:"varint,3,opt,name=action,proto3,enum=threads.pb.ListenRequest_Filter_Action" json:"action,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ListenRequest_Filter) Reset() { *m = ListenRequest_Filter{} } -func (m *ListenRequest_Filter) String() string { return proto.CompactTextString(m) } -func (*ListenRequest_Filter) ProtoMessage() {} -func (*ListenRequest_Filter) Descriptor() ([]byte, []int) { - return fileDescriptor_f2ba358bb2150022, []int{46, 0} -} - -func (m *ListenRequest_Filter) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ListenRequest_Filter.Unmarshal(m, b) -} -func (m *ListenRequest_Filter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ListenRequest_Filter.Marshal(b, m, deterministic) -} -func (m *ListenRequest_Filter) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListenRequest_Filter.Merge(m, src) -} -func (m *ListenRequest_Filter) XXX_Size() int { - return xxx_messageInfo_ListenRequest_Filter.Size(m) -} -func (m *ListenRequest_Filter) XXX_DiscardUnknown() { - xxx_messageInfo_ListenRequest_Filter.DiscardUnknown(m) -} - -var xxx_messageInfo_ListenRequest_Filter proto.InternalMessageInfo - -func (m *ListenRequest_Filter) GetCollectionName() string { - if m != nil { - return m.CollectionName - } - return "" -} - -func (m *ListenRequest_Filter) GetInstanceID() string { - if m != nil { - return m.InstanceID - } - return "" -} - -func (m *ListenRequest_Filter) GetAction() ListenRequest_Filter_Action { - if m != nil { - return m.Action - } - return ListenRequest_Filter_ALL -} - -type ListenReply struct { - CollectionName string `protobuf:"bytes,1,opt,name=collectionName,proto3" json:"collectionName,omitempty"` - InstanceID string `protobuf:"bytes,2,opt,name=instanceID,proto3" json:"instanceID,omitempty"` - Action ListenReply_Action `protobuf:"varint,3,opt,name=action,proto3,enum=threads.pb.ListenReply_Action" json:"action,omitempty"` - Instance []byte `protobuf:"bytes,4,opt,name=instance,proto3" json:"instance,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ListenReply) Reset() { *m = ListenReply{} } -func (m *ListenReply) String() string { return proto.CompactTextString(m) } -func (*ListenReply) ProtoMessage() {} -func (*ListenReply) Descriptor() ([]byte, []int) { - return fileDescriptor_f2ba358bb2150022, []int{47} -} - -func (m *ListenReply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ListenReply.Unmarshal(m, b) -} -func (m *ListenReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ListenReply.Marshal(b, m, deterministic) -} -func (m *ListenReply) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListenReply.Merge(m, src) -} -func (m *ListenReply) XXX_Size() int { - return xxx_messageInfo_ListenReply.Size(m) -} -func (m *ListenReply) XXX_DiscardUnknown() { - xxx_messageInfo_ListenReply.DiscardUnknown(m) -} - -var xxx_messageInfo_ListenReply proto.InternalMessageInfo - -func (m *ListenReply) GetCollectionName() string { - if m != nil { - return m.CollectionName - } - return "" -} - -func (m *ListenReply) GetInstanceID() string { - if m != nil { - return m.InstanceID - } - return "" -} - -func (m *ListenReply) GetAction() ListenReply_Action { - if m != nil { - return m.Action - } - return ListenReply_CREATE -} - -func (m *ListenReply) GetInstance() []byte { - if m != nil { - return m.Instance - } - return nil -} - -func init() { - proto.RegisterEnum("threads.pb.ListenRequest_Filter_Action", ListenRequest_Filter_Action_name, ListenRequest_Filter_Action_value) - proto.RegisterEnum("threads.pb.ListenReply_Action", ListenReply_Action_name, ListenReply_Action_value) - proto.RegisterType((*GetTokenRequest)(nil), "threads.pb.GetTokenRequest") - proto.RegisterType((*GetTokenReply)(nil), "threads.pb.GetTokenReply") - proto.RegisterType((*NewDBRequest)(nil), "threads.pb.NewDBRequest") - proto.RegisterType((*NewDBFromAddrRequest)(nil), "threads.pb.NewDBFromAddrRequest") - proto.RegisterType((*CollectionConfig)(nil), "threads.pb.CollectionConfig") - proto.RegisterType((*Index)(nil), "threads.pb.Index") - proto.RegisterType((*NewDBReply)(nil), "threads.pb.NewDBReply") - proto.RegisterType((*ListDBsRequest)(nil), "threads.pb.ListDBsRequest") - proto.RegisterType((*ListDBsReply)(nil), "threads.pb.ListDBsReply") - proto.RegisterType((*ListDBsReply_DB)(nil), "threads.pb.ListDBsReply.DB") - proto.RegisterType((*GetDBInfoRequest)(nil), "threads.pb.GetDBInfoRequest") - proto.RegisterType((*GetDBInfoReply)(nil), "threads.pb.GetDBInfoReply") - proto.RegisterType((*DeleteDBRequest)(nil), "threads.pb.DeleteDBRequest") - proto.RegisterType((*DeleteDBReply)(nil), "threads.pb.DeleteDBReply") - proto.RegisterType((*NewCollectionRequest)(nil), "threads.pb.NewCollectionRequest") - proto.RegisterType((*NewCollectionReply)(nil), "threads.pb.NewCollectionReply") - proto.RegisterType((*UpdateCollectionRequest)(nil), "threads.pb.UpdateCollectionRequest") - proto.RegisterType((*UpdateCollectionReply)(nil), "threads.pb.UpdateCollectionReply") - proto.RegisterType((*DeleteCollectionRequest)(nil), "threads.pb.DeleteCollectionRequest") - proto.RegisterType((*DeleteCollectionReply)(nil), "threads.pb.DeleteCollectionReply") - proto.RegisterType((*GetCollectionInfoRequest)(nil), "threads.pb.GetCollectionInfoRequest") - proto.RegisterType((*GetCollectionInfoReply)(nil), "threads.pb.GetCollectionInfoReply") - proto.RegisterType((*GetCollectionIndexesRequest)(nil), "threads.pb.GetCollectionIndexesRequest") - proto.RegisterType((*GetCollectionIndexesReply)(nil), "threads.pb.GetCollectionIndexesReply") - proto.RegisterType((*ListCollectionsRequest)(nil), "threads.pb.ListCollectionsRequest") - proto.RegisterType((*ListCollectionsReply)(nil), "threads.pb.ListCollectionsReply") - proto.RegisterType((*CreateRequest)(nil), "threads.pb.CreateRequest") - proto.RegisterType((*CreateReply)(nil), "threads.pb.CreateReply") - proto.RegisterType((*VerifyRequest)(nil), "threads.pb.VerifyRequest") - proto.RegisterType((*VerifyReply)(nil), "threads.pb.VerifyReply") - proto.RegisterType((*SaveRequest)(nil), "threads.pb.SaveRequest") - proto.RegisterType((*SaveReply)(nil), "threads.pb.SaveReply") - proto.RegisterType((*DeleteRequest)(nil), "threads.pb.DeleteRequest") - proto.RegisterType((*DeleteReply)(nil), "threads.pb.DeleteReply") - proto.RegisterType((*HasRequest)(nil), "threads.pb.HasRequest") - proto.RegisterType((*HasReply)(nil), "threads.pb.HasReply") - proto.RegisterType((*FindRequest)(nil), "threads.pb.FindRequest") - proto.RegisterType((*FindReply)(nil), "threads.pb.FindReply") - proto.RegisterType((*FindByIDRequest)(nil), "threads.pb.FindByIDRequest") - proto.RegisterType((*FindByIDReply)(nil), "threads.pb.FindByIDReply") - proto.RegisterType((*DiscardRequest)(nil), "threads.pb.DiscardRequest") - proto.RegisterType((*DiscardReply)(nil), "threads.pb.DiscardReply") - proto.RegisterType((*StartTransactionRequest)(nil), "threads.pb.StartTransactionRequest") - proto.RegisterType((*ReadTransactionRequest)(nil), "threads.pb.ReadTransactionRequest") - proto.RegisterType((*ReadTransactionReply)(nil), "threads.pb.ReadTransactionReply") - proto.RegisterType((*WriteTransactionRequest)(nil), "threads.pb.WriteTransactionRequest") - proto.RegisterType((*WriteTransactionReply)(nil), "threads.pb.WriteTransactionReply") - proto.RegisterType((*ListenRequest)(nil), "threads.pb.ListenRequest") - proto.RegisterType((*ListenRequest_Filter)(nil), "threads.pb.ListenRequest.Filter") - proto.RegisterType((*ListenReply)(nil), "threads.pb.ListenReply") -} - -func init() { proto.RegisterFile("threads.proto", fileDescriptor_f2ba358bb2150022) } - -var fileDescriptor_f2ba358bb2150022 = []byte{ - // 1867 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x59, 0xcd, 0x6f, 0x23, 0x49, - 0x15, 0xef, 0xb6, 0xe3, 0xaf, 0xe7, 0x8f, 0x78, 0x4b, 0x19, 0xdb, 0xd3, 0x33, 0x8a, 0x4c, 0xc1, - 0xce, 0x46, 0x0b, 0x58, 0xab, 0x0c, 0x0b, 0x0b, 0x91, 0x06, 0xec, 0xd8, 0x13, 0x87, 0x89, 0xc2, - 0xa8, 0x93, 0x99, 0x15, 0x62, 0xd1, 0x6c, 0xc7, 0x5d, 0x4e, 0x9a, 0x38, 0x6e, 0x4f, 0x77, 0x67, - 0x76, 0xfc, 0x17, 0xc0, 0x91, 0x2b, 0x57, 0x4e, 0xdc, 0x39, 0xc1, 0x15, 0x89, 0x23, 0x37, 0xee, - 0xfc, 0x23, 0x48, 0xa8, 0xaa, 0xfa, 0xa3, 0xaa, 0x3f, 0x9c, 0x38, 0x64, 0x17, 0x6e, 0xee, 0xd7, - 0xef, 0xbb, 0x7e, 0xaf, 0xde, 0xeb, 0x67, 0xa8, 0x7b, 0x17, 0x0e, 0x31, 0x4c, 0xb7, 0xb7, 0x70, - 0x6c, 0xcf, 0x46, 0x10, 0x3e, 0x9e, 0xe1, 0x97, 0xb0, 0x79, 0x40, 0xbc, 0x53, 0xfb, 0x92, 0xcc, - 0x75, 0xf2, 0xf6, 0x9a, 0xb8, 0x1e, 0x42, 0x90, 0xbf, 0x24, 0xcb, 0x8e, 0xda, 0x55, 0x77, 0x2a, - 0x63, 0x45, 0xa7, 0x0f, 0x68, 0x1b, 0x2a, 0xae, 0x75, 0x3e, 0x37, 0xbc, 0x6b, 0x87, 0x74, 0x72, - 0x5d, 0x75, 0xa7, 0x36, 0x56, 0xf4, 0x88, 0x34, 0xa8, 0x40, 0x69, 0x61, 0x2c, 0x67, 0xb6, 0x61, - 0x62, 0x1d, 0xea, 0x91, 0xc6, 0xc5, 0x8c, 0xc9, 0x4e, 0x2e, 0x8c, 0xd9, 0x8c, 0xcc, 0xcf, 0x09, - 0xd3, 0xca, 0x64, 0x43, 0x12, 0x6a, 0x41, 0xc1, 0xa3, 0xdc, 0x4c, 0x2f, 0xb5, 0xc8, 0x1f, 0x45, - 0x9d, 0x7f, 0x55, 0xa1, 0x76, 0x4c, 0xbe, 0x1a, 0x0e, 0x22, 0x1f, 0x37, 0xcc, 0xb3, 0xc3, 0x21, - 0x57, 0xa7, 0xb3, 0xdf, 0xa8, 0xc9, 0xfd, 0x2e, 0x32, 0x12, 0xf3, 0xba, 0x05, 0xc5, 0x99, 0x7d, - 0xfe, 0x82, 0x2c, 0x3b, 0x25, 0x46, 0xf4, 0x9f, 0xa8, 0xf4, 0xdc, 0xb8, 0x22, 0x9d, 0x3c, 0x35, - 0xa8, 0xb3, 0xdf, 0xe8, 0x19, 0x54, 0x27, 0xf6, 0x6c, 0x46, 0x26, 0x9e, 0x65, 0xcf, 0xdd, 0x4e, - 0xae, 0x9b, 0xdf, 0xa9, 0xee, 0x3e, 0xee, 0x45, 0xa9, 0xea, 0xed, 0x87, 0xaf, 0xf7, 0xed, 0xf9, - 0xd4, 0x3a, 0xd7, 0x45, 0x01, 0xd4, 0x81, 0xc2, 0xd9, 0xcc, 0x9e, 0x5c, 0x76, 0x0a, 0x5d, 0x75, - 0xa7, 0x3c, 0xc8, 0x75, 0x54, 0x9d, 0x13, 0xf0, 0xbf, 0x54, 0xd8, 0x62, 0xce, 0x3f, 0x77, 0xec, - 0xab, 0xbe, 0x69, 0x3a, 0x42, 0x10, 0x86, 0x69, 0x3a, 0x41, 0x10, 0xf4, 0x77, 0x10, 0x44, 0xee, - 0xf6, 0x41, 0x6c, 0x64, 0x07, 0x91, 0x5f, 0x37, 0x88, 0x2d, 0x29, 0x08, 0x3f, 0x00, 0xd4, 0x85, - 0x0a, 0xd7, 0xf0, 0x22, 0x48, 0x2f, 0x0b, 0x2f, 0x22, 0xe2, 0x3f, 0xab, 0xd0, 0x8c, 0x6b, 0x0e, - 0x1d, 0x54, 0x05, 0x07, 0x5b, 0x50, 0x74, 0x27, 0x17, 0xe4, 0xca, 0xf0, 0x23, 0xf4, 0x9f, 0xd0, - 0x77, 0xa1, 0x64, 0xcd, 0x4d, 0xf2, 0x9e, 0x04, 0x4e, 0x7f, 0x20, 0x3a, 0x7d, 0x48, 0x5f, 0xe9, - 0x01, 0x07, 0x7a, 0x02, 0x8d, 0xaf, 0x1c, 0xcb, 0x23, 0xaf, 0x8d, 0x99, 0x65, 0x1a, 0x9e, 0xed, - 0xf8, 0x39, 0x88, 0x51, 0xd1, 0x36, 0x00, 0x55, 0xf1, 0xdc, 0x9a, 0x79, 0xc4, 0x61, 0x21, 0x55, - 0x74, 0x81, 0x82, 0x9f, 0x42, 0x81, 0x69, 0xa6, 0x9e, 0x2e, 0x0c, 0xef, 0x22, 0xf0, 0x94, 0xfe, - 0xa6, 0x9e, 0x5e, 0xcf, 0xad, 0xb7, 0xd7, 0x1c, 0xee, 0x65, 0xdd, 0x7f, 0xc2, 0x35, 0x00, 0x1f, - 0x89, 0x8b, 0xd9, 0x12, 0x37, 0xa1, 0x71, 0x64, 0xb9, 0xde, 0x70, 0xe0, 0xfa, 0x87, 0x8a, 0x7f, - 0xab, 0x42, 0x2d, 0x24, 0x51, 0xf8, 0x7f, 0x1f, 0xf2, 0xe6, 0x99, 0xdb, 0x51, 0x59, 0x58, 0x8f, - 0xc4, 0xb0, 0x44, 0xb6, 0xde, 0x70, 0xa0, 0x53, 0x3e, 0x6d, 0x0c, 0xb9, 0xe1, 0x20, 0x15, 0xdf, - 0x3d, 0xd8, 0xb0, 0xe6, 0x53, 0x9b, 0xf9, 0x53, 0xdd, 0xd5, 0x44, 0x4d, 0x07, 0xc4, 0x1b, 0x0e, - 0x0e, 0xe7, 0x53, 0x9b, 0xe9, 0xd2, 0x19, 0x1f, 0x7e, 0x02, 0x4d, 0x81, 0x9e, 0x59, 0x37, 0xf8, - 0x08, 0x1a, 0xb2, 0x3c, 0x85, 0x01, 0x05, 0x23, 0x77, 0xba, 0xa6, 0xf3, 0x87, 0x14, 0x68, 0xa6, - 0xd4, 0x11, 0xfe, 0x10, 0x36, 0x87, 0x64, 0x46, 0x3c, 0xb2, 0xb2, 0x58, 0xf1, 0x26, 0xd4, 0x23, - 0x36, 0x9a, 0xc9, 0x2f, 0x59, 0x91, 0x44, 0x20, 0x5a, 0x55, 0xe9, 0x3f, 0x80, 0xe2, 0x84, 0x61, - 0xcc, 0xcf, 0xc5, 0x6a, 0x84, 0xfb, 0xbc, 0x78, 0x0b, 0x50, 0xcc, 0x02, 0xb5, 0x3b, 0x81, 0xf6, - 0xab, 0x85, 0x69, 0x78, 0xe4, 0xeb, 0x34, 0xdd, 0x86, 0x07, 0x49, 0x23, 0xd4, 0x7a, 0x1f, 0xda, - 0x3c, 0x0d, 0xb7, 0xb3, 0x1e, 0x24, 0x3c, 0x27, 0x24, 0xbc, 0x0d, 0x0f, 0x92, 0x2a, 0xa8, 0xee, - 0x01, 0x74, 0x0e, 0x88, 0x17, 0x51, 0x6f, 0xc0, 0x41, 0xaa, 0xf2, 0xbf, 0xa8, 0xd0, 0x4a, 0x51, - 0x42, 0x41, 0xf2, 0x7f, 0x5f, 0xde, 0x23, 0x78, 0x14, 0x73, 0x9d, 0xe9, 0x5f, 0x37, 0x05, 0x63, - 0x78, 0x98, 0xae, 0x86, 0x26, 0x41, 0x08, 0x4c, 0xbd, 0x29, 0x30, 0xfc, 0x3d, 0x68, 0xd1, 0x92, - 0x8f, 0x54, 0xad, 0xf2, 0x05, 0x7f, 0x01, 0x5b, 0x09, 0x6e, 0x6a, 0x72, 0x28, 0xdf, 0xf1, 0xdc, - 0x2c, 0x8e, 0xdd, 0x06, 0x29, 0x07, 0x26, 0xdd, 0xf4, 0xd8, 0x82, 0xfa, 0xbe, 0x43, 0x0c, 0x8f, - 0xac, 0x4a, 0xc7, 0x13, 0x68, 0x44, 0x32, 0xc7, 0x51, 0x62, 0x62, 0x54, 0xf4, 0x18, 0x2a, 0xd6, - 0xdc, 0xf5, 0x8c, 0xf9, 0xc4, 0x3f, 0xe0, 0x9a, 0x1e, 0x11, 0xf0, 0xaf, 0xa0, 0x1a, 0x98, 0xa2, - 0xfe, 0x77, 0xa1, 0x1a, 0xbc, 0x3b, 0x1c, 0x72, 0xff, 0x2b, 0xba, 0x48, 0x42, 0x1f, 0x43, 0xd3, - 0x73, 0x8c, 0xb9, 0x6b, 0x30, 0x0b, 0x23, 0xc7, 0xb1, 0x1d, 0xdf, 0x70, 0x82, 0x4e, 0xe3, 0x78, - 0x4d, 0x1c, 0x6b, 0xba, 0xfc, 0xfa, 0xe3, 0xf8, 0x31, 0x54, 0x03, 0x53, 0x34, 0x8e, 0x34, 0x2f, - 0xd5, 0x0c, 0x2f, 0xcf, 0xa1, 0x7a, 0x62, 0xbc, 0xfb, 0x06, 0x72, 0xfd, 0x23, 0xa8, 0x70, 0x43, - 0xeb, 0x7a, 0x78, 0x15, 0xdc, 0xc7, 0xf7, 0xe1, 0x63, 0xec, 0x88, 0xf3, 0x89, 0x23, 0xa6, 0xb9, - 0x0c, 0xcc, 0xad, 0xeb, 0xe9, 0x6f, 0x00, 0xc6, 0x86, 0xfb, 0xcd, 0xb8, 0x79, 0x0c, 0x65, 0x66, - 0x8b, 0xfa, 0xd8, 0x82, 0x22, 0x79, 0x6f, 0xb9, 0x9e, 0xcb, 0x6c, 0x95, 0x75, 0xff, 0x69, 0x2d, - 0xb4, 0x9e, 0x43, 0xf5, 0xb9, 0x35, 0x37, 0xef, 0x09, 0x07, 0x6f, 0xaf, 0x89, 0xb3, 0xfc, 0xf9, - 0xc9, 0x2f, 0x8e, 0x59, 0x03, 0xae, 0xe9, 0x11, 0x01, 0xbf, 0x82, 0x0a, 0x37, 0x44, 0x3d, 0x97, - 0x20, 0xa3, 0xc6, 0x20, 0xb3, 0x96, 0xff, 0x57, 0xb0, 0x49, 0xd5, 0x0e, 0x96, 0x87, 0xc3, 0xfb, - 0x88, 0x61, 0x1b, 0x20, 0xca, 0xb6, 0x3f, 0x45, 0x08, 0x14, 0xfc, 0x39, 0xd4, 0x23, 0x73, 0x34, - 0x12, 0x0d, 0xca, 0xc1, 0x6b, 0xdf, 0x60, 0xf8, 0xbc, 0x56, 0x1c, 0x4d, 0x68, 0x0c, 0x2d, 0x77, - 0x62, 0x38, 0xc1, 0x51, 0xe0, 0x06, 0xd4, 0x42, 0x0a, 0x6d, 0x9e, 0xaf, 0xa0, 0x7d, 0xe2, 0x19, - 0x8e, 0x77, 0x1a, 0x89, 0xde, 0x43, 0xc4, 0xf8, 0x6f, 0x39, 0x68, 0xe9, 0xc4, 0x30, 0x53, 0xd4, - 0xbe, 0x81, 0xb6, 0x9b, 0x6e, 0x91, 0x59, 0xaa, 0xee, 0x7e, 0x5b, 0xbc, 0xe3, 0x33, 0x9c, 0x1b, - 0x2b, 0x7a, 0x96, 0x16, 0xf4, 0x19, 0xc0, 0x45, 0x58, 0x38, 0xfe, 0xf8, 0xd2, 0x12, 0x75, 0x46, - 0x65, 0x35, 0x56, 0x74, 0x81, 0x17, 0xed, 0x41, 0x75, 0x1a, 0xc1, 0x96, 0x1d, 0x54, 0x75, 0xb7, - 0x2d, 0x8a, 0x0a, 0xa8, 0x1e, 0x2b, 0xba, 0xc8, 0x8d, 0x0e, 0x60, 0x73, 0x2a, 0x63, 0x86, 0xf5, - 0xf3, 0xd8, 0x2c, 0x1c, 0x83, 0xd5, 0x58, 0xd1, 0xe3, 0x52, 0x83, 0x32, 0x14, 0xed, 0x05, 0x0d, - 0x08, 0xff, 0x43, 0x85, 0xad, 0x44, 0x16, 0x29, 0x3e, 0x76, 0xa1, 0x7c, 0xe1, 0xd7, 0xab, 0x9f, - 0xb4, 0xad, 0x44, 0x80, 0x8b, 0xd9, 0x72, 0xac, 0xe8, 0x21, 0x1f, 0xfa, 0x14, 0x2a, 0xd3, 0xa0, - 0x54, 0xfc, 0xac, 0x3c, 0x48, 0x86, 0xc6, 0xa5, 0x22, 0x4e, 0xd4, 0x87, 0xfa, 0x54, 0xc4, 0xa6, - 0x9f, 0x95, 0x87, 0xe9, 0x41, 0x71, 0x71, 0x59, 0x42, 0x08, 0xe8, 0xf7, 0x05, 0x68, 0x7f, 0x4e, - 0xa7, 0x9b, 0xff, 0x05, 0x2e, 0xfa, 0x50, 0x9f, 0x88, 0xa3, 0x80, 0x9f, 0x04, 0x29, 0x12, 0x69, - 0x56, 0xa0, 0x91, 0x48, 0x12, 0x54, 0xc5, 0x3b, 0xb1, 0x0b, 0x77, 0xca, 0x49, 0x15, 0x52, 0x9b, - 0xa6, 0x2a, 0x24, 0x09, 0x8a, 0x31, 0x37, 0x6a, 0x91, 0x69, 0x18, 0x13, 0x3a, 0x28, 0xc5, 0x98, - 0xc0, 0x4d, 0xed, 0x9b, 0x62, 0xf7, 0xf2, 0x11, 0x26, 0xd9, 0x97, 0xda, 0x1b, 0xb5, 0x2f, 0x49, - 0xc4, 0xaa, 0xa3, 0x70, 0xf7, 0xea, 0x28, 0xfe, 0xb7, 0xd5, 0x51, 0xba, 0x4b, 0x75, 0xa0, 0x21, - 0x34, 0x4c, 0xe9, 0x4a, 0xeb, 0x54, 0x92, 0xdf, 0x89, 0xf2, 0xa5, 0x37, 0x56, 0xf4, 0x98, 0x8c, - 0x00, 0xc9, 0x7f, 0xe7, 0xe1, 0x41, 0x12, 0x92, 0x14, 0xf9, 0x7b, 0x50, 0x9d, 0x44, 0xf3, 0x9c, - 0x0f, 0xc2, 0x76, 0x1a, 0x5a, 0x38, 0xea, 0x45, 0x6e, 0x2a, 0xfc, 0x2e, 0x1a, 0xa2, 0xfc, 0x58, - 0xdb, 0x69, 0x38, 0xf1, 0x85, 0x05, 0x6e, 0x5a, 0xaa, 0x6e, 0x30, 0xdd, 0xa4, 0x95, 0x6a, 0x38, - 0xfa, 0xb0, 0xe5, 0x54, 0x38, 0x07, 0xed, 0x41, 0xd5, 0x8c, 0x86, 0x8d, 0x34, 0x68, 0x09, 0xb3, - 0x08, 0xb5, 0x29, 0x70, 0x4b, 0x57, 0xca, 0xc6, 0x5d, 0xae, 0x94, 0xc2, 0xdd, 0xaf, 0x94, 0xe2, - 0xba, 0x57, 0x0a, 0x7a, 0x06, 0x35, 0x53, 0x68, 0x63, 0x7e, 0x1d, 0x76, 0x52, 0x31, 0xc0, 0x15, - 0x48, 0xfc, 0xc2, 0xf9, 0xff, 0x29, 0x07, 0x75, 0xfa, 0xfd, 0x41, 0x56, 0xf6, 0xbd, 0x9f, 0x40, - 0x69, 0xca, 0xbe, 0xb6, 0x82, 0x8d, 0x59, 0x37, 0xbe, 0xe0, 0x08, 0xe5, 0x7b, 0xfc, 0xb3, 0x4c, - 0x0f, 0x04, 0xb4, 0xbf, 0xab, 0x50, 0xe4, 0xb4, 0x94, 0xf6, 0xa9, 0xde, 0x62, 0x60, 0xc8, 0xc5, - 0x07, 0x06, 0xf4, 0x53, 0x28, 0x72, 0xa4, 0xb2, 0x43, 0x6e, 0xec, 0x7e, 0x74, 0x93, 0x37, 0xbd, - 0x3e, 0x07, 0xb6, 0x2f, 0x86, 0x9f, 0x42, 0x91, 0x53, 0x50, 0x09, 0xf2, 0xfd, 0xa3, 0xa3, 0xa6, - 0x82, 0x00, 0x8a, 0xfb, 0xfa, 0xa8, 0x7f, 0x3a, 0x6a, 0xaa, 0xa8, 0x0c, 0x1b, 0x27, 0xfd, 0xd7, - 0xa3, 0x66, 0x8e, 0x52, 0x87, 0xa3, 0xa3, 0xd1, 0xe9, 0xa8, 0x99, 0xc7, 0xff, 0x54, 0xa1, 0x1a, - 0x28, 0xa7, 0x87, 0x70, 0x5f, 0xd1, 0xfc, 0x30, 0x16, 0xcd, 0x76, 0x5a, 0x34, 0x8b, 0xd9, 0x32, - 0x16, 0x84, 0x34, 0x25, 0x6d, 0xc8, 0x53, 0x12, 0xfe, 0x38, 0x0c, 0x30, 0x8a, 0x4b, 0x09, 0xe3, - 0x52, 0x85, 0xb8, 0x72, 0xbb, 0x7f, 0xa8, 0x43, 0xbe, 0xff, 0xf2, 0x10, 0x8d, 0xa1, 0x1c, 0x6c, - 0x74, 0xd1, 0xa3, 0xd8, 0x87, 0xa6, 0xb8, 0x39, 0xd6, 0x1e, 0xa6, 0xbf, 0xa4, 0xf3, 0x94, 0xb2, - 0xa3, 0x7e, 0xa2, 0xa2, 0x3d, 0x28, 0xb0, 0xe5, 0x19, 0x92, 0x10, 0x29, 0x6e, 0x76, 0xb5, 0x56, - 0xca, 0x1b, 0xa6, 0x00, 0xbd, 0x80, 0xba, 0xb4, 0x46, 0x45, 0xdd, 0x04, 0x6b, 0x6c, 0xc3, 0xba, - 0x42, 0x59, 0x1f, 0x4a, 0xfe, 0xfa, 0x0d, 0x69, 0xa9, 0x3b, 0x39, 0xae, 0xa0, 0x93, 0xb5, 0xaf, - 0xc3, 0x0a, 0x3a, 0x80, 0x4a, 0xb8, 0x37, 0x43, 0x8f, 0x33, 0xd6, 0x71, 0x5c, 0xcd, 0x8a, 0x65, - 0x1d, 0x56, 0xd0, 0x10, 0xca, 0xc1, 0x2e, 0x4c, 0xce, 0x6f, 0x6c, 0x91, 0xa6, 0x3d, 0x4c, 0x7f, - 0xc9, 0xb5, 0x9c, 0xb0, 0xf4, 0x44, 0x1f, 0xfe, 0x89, 0xf4, 0x24, 0x56, 0x4c, 0xda, 0xf6, 0x0a, - 0x0e, 0xae, 0xf4, 0x0b, 0x68, 0xc6, 0x17, 0x57, 0x48, 0x9a, 0x37, 0x32, 0x76, 0x67, 0xda, 0xb7, - 0x56, 0x33, 0x85, 0xda, 0xe3, 0xab, 0x2b, 0x59, 0x7b, 0xc6, 0x6e, 0x4c, 0xd6, 0x9e, 0xbe, 0xfd, - 0x52, 0xd0, 0x1b, 0xf8, 0x20, 0xb1, 0x09, 0x41, 0xdf, 0xb9, 0x61, 0x51, 0xc2, 0xf5, 0xdf, 0x62, - 0x9d, 0x82, 0x15, 0x74, 0x09, 0x5b, 0x69, 0x9b, 0x21, 0xf4, 0xd1, 0x0a, 0x69, 0x71, 0x05, 0xa5, - 0x7d, 0x78, 0x33, 0x23, 0xb5, 0x94, 0xff, 0x5d, 0x4e, 0x45, 0xbf, 0x84, 0xcd, 0xd8, 0x3a, 0x08, - 0xe1, 0x38, 0x38, 0x93, 0x9b, 0x25, 0xad, 0xbb, 0x92, 0x87, 0xc7, 0xf1, 0x0c, 0x8a, 0xbc, 0x63, - 0xa3, 0xec, 0x99, 0x4f, 0xcb, 0x6a, 0xf0, 0x5c, 0x9e, 0x37, 0x6d, 0x94, 0x3d, 0xf0, 0x69, 0x59, - 0x3d, 0x1e, 0x2b, 0xe8, 0x33, 0xd8, 0xa0, 0x9d, 0x1b, 0x65, 0x4d, 0x7b, 0x5a, 0x7a, 0x93, 0xe7, - 0x96, 0xf9, 0xe9, 0xa3, 0xec, 0x51, 0x4f, 0xcb, 0xea, 0xf4, 0x58, 0x41, 0x9f, 0x42, 0x7e, 0x6c, - 0xb8, 0x28, 0x63, 0xce, 0xd3, 0x52, 0x3b, 0x3d, 0x77, 0x98, 0xf6, 0x61, 0x94, 0x35, 0xe4, 0x69, - 0xe9, 0xdd, 0x9e, 0x97, 0x7a, 0xd0, 0xc1, 0xd1, 0xaa, 0x09, 0x4f, 0xcb, 0x6e, 0xfa, 0x58, 0x41, - 0xbf, 0x86, 0xcd, 0xd8, 0xe7, 0x8f, 0x8c, 0x85, 0xf4, 0x2f, 0x4c, 0x19, 0x0b, 0x69, 0xdf, 0x4f, - 0xfe, 0x2d, 0xfd, 0x25, 0x34, 0xe3, 0x93, 0x9f, 0x5c, 0x96, 0x19, 0x9f, 0x2a, 0x72, 0x59, 0xa6, - 0x0e, 0x8f, 0xbe, 0x85, 0x9f, 0x41, 0x91, 0xf7, 0x2f, 0xf9, 0xdc, 0xa4, 0x0e, 0x2d, 0x9f, 0x9b, - 0xd0, 0xee, 0xb0, 0xf2, 0x89, 0x3a, 0xe8, 0x41, 0xdb, 0xb2, 0x7b, 0x1e, 0x79, 0xef, 0x59, 0x33, - 0x12, 0x30, 0xbe, 0x39, 0x77, 0x16, 0x93, 0x41, 0xe9, 0x94, 0x3f, 0xbd, 0x54, 0xff, 0x98, 0x2b, - 0x9d, 0x8e, 0xf5, 0x51, 0x7f, 0x78, 0x72, 0x56, 0x64, 0x7f, 0x7d, 0x3e, 0xfd, 0x4f, 0x00, 0x00, - 0x00, 0xff, 0xff, 0xc7, 0x43, 0x37, 0xb9, 0x0b, 0x1d, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// APIClient is the client API for API service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type APIClient interface { - GetToken(ctx context.Context, opts ...grpc.CallOption) (API_GetTokenClient, error) - NewDB(ctx context.Context, in *NewDBRequest, opts ...grpc.CallOption) (*NewDBReply, error) - NewDBFromAddr(ctx context.Context, in *NewDBFromAddrRequest, opts ...grpc.CallOption) (*NewDBReply, error) - ListDBs(ctx context.Context, in *ListDBsRequest, opts ...grpc.CallOption) (*ListDBsReply, error) - GetDBInfo(ctx context.Context, in *GetDBInfoRequest, opts ...grpc.CallOption) (*GetDBInfoReply, error) - DeleteDB(ctx context.Context, in *DeleteDBRequest, opts ...grpc.CallOption) (*DeleteDBReply, error) - NewCollection(ctx context.Context, in *NewCollectionRequest, opts ...grpc.CallOption) (*NewCollectionReply, error) - UpdateCollection(ctx context.Context, in *UpdateCollectionRequest, opts ...grpc.CallOption) (*UpdateCollectionReply, error) - DeleteCollection(ctx context.Context, in *DeleteCollectionRequest, opts ...grpc.CallOption) (*DeleteCollectionReply, error) - GetCollectionInfo(ctx context.Context, in *GetCollectionInfoRequest, opts ...grpc.CallOption) (*GetCollectionInfoReply, error) - GetCollectionIndexes(ctx context.Context, in *GetCollectionIndexesRequest, opts ...grpc.CallOption) (*GetCollectionIndexesReply, error) - ListCollections(ctx context.Context, in *ListCollectionsRequest, opts ...grpc.CallOption) (*ListCollectionsReply, error) - Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateReply, error) - Verify(ctx context.Context, in *VerifyRequest, opts ...grpc.CallOption) (*VerifyReply, error) - Save(ctx context.Context, in *SaveRequest, opts ...grpc.CallOption) (*SaveReply, error) - Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteReply, error) - Has(ctx context.Context, in *HasRequest, opts ...grpc.CallOption) (*HasReply, error) - Find(ctx context.Context, in *FindRequest, opts ...grpc.CallOption) (*FindReply, error) - FindByID(ctx context.Context, in *FindByIDRequest, opts ...grpc.CallOption) (*FindByIDReply, error) - ReadTransaction(ctx context.Context, opts ...grpc.CallOption) (API_ReadTransactionClient, error) - WriteTransaction(ctx context.Context, opts ...grpc.CallOption) (API_WriteTransactionClient, error) - Listen(ctx context.Context, in *ListenRequest, opts ...grpc.CallOption) (API_ListenClient, error) -} - -type aPIClient struct { - cc *grpc.ClientConn -} - -func NewAPIClient(cc *grpc.ClientConn) APIClient { - return &aPIClient{cc} -} - -func (c *aPIClient) GetToken(ctx context.Context, opts ...grpc.CallOption) (API_GetTokenClient, error) { - stream, err := c.cc.NewStream(ctx, &_API_serviceDesc.Streams[0], "/threads.pb.API/GetToken", opts...) - if err != nil { - return nil, err - } - x := &aPIGetTokenClient{stream} - return x, nil -} - -type API_GetTokenClient interface { - Send(*GetTokenRequest) error - Recv() (*GetTokenReply, error) - grpc.ClientStream -} - -type aPIGetTokenClient struct { - grpc.ClientStream -} - -func (x *aPIGetTokenClient) Send(m *GetTokenRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *aPIGetTokenClient) Recv() (*GetTokenReply, error) { - m := new(GetTokenReply) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *aPIClient) NewDB(ctx context.Context, in *NewDBRequest, opts ...grpc.CallOption) (*NewDBReply, error) { - out := new(NewDBReply) - err := c.cc.Invoke(ctx, "/threads.pb.API/NewDB", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aPIClient) NewDBFromAddr(ctx context.Context, in *NewDBFromAddrRequest, opts ...grpc.CallOption) (*NewDBReply, error) { - out := new(NewDBReply) - err := c.cc.Invoke(ctx, "/threads.pb.API/NewDBFromAddr", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aPIClient) ListDBs(ctx context.Context, in *ListDBsRequest, opts ...grpc.CallOption) (*ListDBsReply, error) { - out := new(ListDBsReply) - err := c.cc.Invoke(ctx, "/threads.pb.API/ListDBs", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aPIClient) GetDBInfo(ctx context.Context, in *GetDBInfoRequest, opts ...grpc.CallOption) (*GetDBInfoReply, error) { - out := new(GetDBInfoReply) - err := c.cc.Invoke(ctx, "/threads.pb.API/GetDBInfo", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aPIClient) DeleteDB(ctx context.Context, in *DeleteDBRequest, opts ...grpc.CallOption) (*DeleteDBReply, error) { - out := new(DeleteDBReply) - err := c.cc.Invoke(ctx, "/threads.pb.API/DeleteDB", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aPIClient) NewCollection(ctx context.Context, in *NewCollectionRequest, opts ...grpc.CallOption) (*NewCollectionReply, error) { - out := new(NewCollectionReply) - err := c.cc.Invoke(ctx, "/threads.pb.API/NewCollection", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aPIClient) UpdateCollection(ctx context.Context, in *UpdateCollectionRequest, opts ...grpc.CallOption) (*UpdateCollectionReply, error) { - out := new(UpdateCollectionReply) - err := c.cc.Invoke(ctx, "/threads.pb.API/UpdateCollection", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aPIClient) DeleteCollection(ctx context.Context, in *DeleteCollectionRequest, opts ...grpc.CallOption) (*DeleteCollectionReply, error) { - out := new(DeleteCollectionReply) - err := c.cc.Invoke(ctx, "/threads.pb.API/DeleteCollection", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aPIClient) GetCollectionInfo(ctx context.Context, in *GetCollectionInfoRequest, opts ...grpc.CallOption) (*GetCollectionInfoReply, error) { - out := new(GetCollectionInfoReply) - err := c.cc.Invoke(ctx, "/threads.pb.API/GetCollectionInfo", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// Deprecated: Do not use. -func (c *aPIClient) GetCollectionIndexes(ctx context.Context, in *GetCollectionIndexesRequest, opts ...grpc.CallOption) (*GetCollectionIndexesReply, error) { - out := new(GetCollectionIndexesReply) - err := c.cc.Invoke(ctx, "/threads.pb.API/GetCollectionIndexes", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aPIClient) ListCollections(ctx context.Context, in *ListCollectionsRequest, opts ...grpc.CallOption) (*ListCollectionsReply, error) { - out := new(ListCollectionsReply) - err := c.cc.Invoke(ctx, "/threads.pb.API/ListCollections", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aPIClient) Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateReply, error) { - out := new(CreateReply) - err := c.cc.Invoke(ctx, "/threads.pb.API/Create", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aPIClient) Verify(ctx context.Context, in *VerifyRequest, opts ...grpc.CallOption) (*VerifyReply, error) { - out := new(VerifyReply) - err := c.cc.Invoke(ctx, "/threads.pb.API/Verify", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aPIClient) Save(ctx context.Context, in *SaveRequest, opts ...grpc.CallOption) (*SaveReply, error) { - out := new(SaveReply) - err := c.cc.Invoke(ctx, "/threads.pb.API/Save", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aPIClient) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteReply, error) { - out := new(DeleteReply) - err := c.cc.Invoke(ctx, "/threads.pb.API/Delete", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aPIClient) Has(ctx context.Context, in *HasRequest, opts ...grpc.CallOption) (*HasReply, error) { - out := new(HasReply) - err := c.cc.Invoke(ctx, "/threads.pb.API/Has", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aPIClient) Find(ctx context.Context, in *FindRequest, opts ...grpc.CallOption) (*FindReply, error) { - out := new(FindReply) - err := c.cc.Invoke(ctx, "/threads.pb.API/Find", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aPIClient) FindByID(ctx context.Context, in *FindByIDRequest, opts ...grpc.CallOption) (*FindByIDReply, error) { - out := new(FindByIDReply) - err := c.cc.Invoke(ctx, "/threads.pb.API/FindByID", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aPIClient) ReadTransaction(ctx context.Context, opts ...grpc.CallOption) (API_ReadTransactionClient, error) { - stream, err := c.cc.NewStream(ctx, &_API_serviceDesc.Streams[1], "/threads.pb.API/ReadTransaction", opts...) - if err != nil { - return nil, err - } - x := &aPIReadTransactionClient{stream} - return x, nil -} - -type API_ReadTransactionClient interface { - Send(*ReadTransactionRequest) error - Recv() (*ReadTransactionReply, error) - grpc.ClientStream -} - -type aPIReadTransactionClient struct { - grpc.ClientStream -} - -func (x *aPIReadTransactionClient) Send(m *ReadTransactionRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *aPIReadTransactionClient) Recv() (*ReadTransactionReply, error) { - m := new(ReadTransactionReply) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *aPIClient) WriteTransaction(ctx context.Context, opts ...grpc.CallOption) (API_WriteTransactionClient, error) { - stream, err := c.cc.NewStream(ctx, &_API_serviceDesc.Streams[2], "/threads.pb.API/WriteTransaction", opts...) - if err != nil { - return nil, err - } - x := &aPIWriteTransactionClient{stream} - return x, nil -} - -type API_WriteTransactionClient interface { - Send(*WriteTransactionRequest) error - Recv() (*WriteTransactionReply, error) - grpc.ClientStream -} - -type aPIWriteTransactionClient struct { - grpc.ClientStream -} - -func (x *aPIWriteTransactionClient) Send(m *WriteTransactionRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *aPIWriteTransactionClient) Recv() (*WriteTransactionReply, error) { - m := new(WriteTransactionReply) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *aPIClient) Listen(ctx context.Context, in *ListenRequest, opts ...grpc.CallOption) (API_ListenClient, error) { - stream, err := c.cc.NewStream(ctx, &_API_serviceDesc.Streams[3], "/threads.pb.API/Listen", opts...) - if err != nil { - return nil, err - } - x := &aPIListenClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type API_ListenClient interface { - Recv() (*ListenReply, error) - grpc.ClientStream -} - -type aPIListenClient struct { - grpc.ClientStream -} - -func (x *aPIListenClient) Recv() (*ListenReply, error) { - m := new(ListenReply) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// APIServer is the server API for API service. -type APIServer interface { - GetToken(API_GetTokenServer) error - NewDB(context.Context, *NewDBRequest) (*NewDBReply, error) - NewDBFromAddr(context.Context, *NewDBFromAddrRequest) (*NewDBReply, error) - ListDBs(context.Context, *ListDBsRequest) (*ListDBsReply, error) - GetDBInfo(context.Context, *GetDBInfoRequest) (*GetDBInfoReply, error) - DeleteDB(context.Context, *DeleteDBRequest) (*DeleteDBReply, error) - NewCollection(context.Context, *NewCollectionRequest) (*NewCollectionReply, error) - UpdateCollection(context.Context, *UpdateCollectionRequest) (*UpdateCollectionReply, error) - DeleteCollection(context.Context, *DeleteCollectionRequest) (*DeleteCollectionReply, error) - GetCollectionInfo(context.Context, *GetCollectionInfoRequest) (*GetCollectionInfoReply, error) - GetCollectionIndexes(context.Context, *GetCollectionIndexesRequest) (*GetCollectionIndexesReply, error) - ListCollections(context.Context, *ListCollectionsRequest) (*ListCollectionsReply, error) - Create(context.Context, *CreateRequest) (*CreateReply, error) - Verify(context.Context, *VerifyRequest) (*VerifyReply, error) - Save(context.Context, *SaveRequest) (*SaveReply, error) - Delete(context.Context, *DeleteRequest) (*DeleteReply, error) - Has(context.Context, *HasRequest) (*HasReply, error) - Find(context.Context, *FindRequest) (*FindReply, error) - FindByID(context.Context, *FindByIDRequest) (*FindByIDReply, error) - ReadTransaction(API_ReadTransactionServer) error - WriteTransaction(API_WriteTransactionServer) error - Listen(*ListenRequest, API_ListenServer) error -} - -// UnimplementedAPIServer can be embedded to have forward compatible implementations. -type UnimplementedAPIServer struct { -} - -func (*UnimplementedAPIServer) GetToken(srv API_GetTokenServer) error { - return status.Errorf(codes.Unimplemented, "method GetToken not implemented") -} -func (*UnimplementedAPIServer) NewDB(ctx context.Context, req *NewDBRequest) (*NewDBReply, error) { - return nil, status.Errorf(codes.Unimplemented, "method NewDB not implemented") -} -func (*UnimplementedAPIServer) NewDBFromAddr(ctx context.Context, req *NewDBFromAddrRequest) (*NewDBReply, error) { - return nil, status.Errorf(codes.Unimplemented, "method NewDBFromAddr not implemented") -} -func (*UnimplementedAPIServer) ListDBs(ctx context.Context, req *ListDBsRequest) (*ListDBsReply, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListDBs not implemented") -} -func (*UnimplementedAPIServer) GetDBInfo(ctx context.Context, req *GetDBInfoRequest) (*GetDBInfoReply, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetDBInfo not implemented") -} -func (*UnimplementedAPIServer) DeleteDB(ctx context.Context, req *DeleteDBRequest) (*DeleteDBReply, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteDB not implemented") -} -func (*UnimplementedAPIServer) NewCollection(ctx context.Context, req *NewCollectionRequest) (*NewCollectionReply, error) { - return nil, status.Errorf(codes.Unimplemented, "method NewCollection not implemented") -} -func (*UnimplementedAPIServer) UpdateCollection(ctx context.Context, req *UpdateCollectionRequest) (*UpdateCollectionReply, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateCollection not implemented") -} -func (*UnimplementedAPIServer) DeleteCollection(ctx context.Context, req *DeleteCollectionRequest) (*DeleteCollectionReply, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteCollection not implemented") -} -func (*UnimplementedAPIServer) GetCollectionInfo(ctx context.Context, req *GetCollectionInfoRequest) (*GetCollectionInfoReply, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetCollectionInfo not implemented") -} -func (*UnimplementedAPIServer) GetCollectionIndexes(ctx context.Context, req *GetCollectionIndexesRequest) (*GetCollectionIndexesReply, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetCollectionIndexes not implemented") -} -func (*UnimplementedAPIServer) ListCollections(ctx context.Context, req *ListCollectionsRequest) (*ListCollectionsReply, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListCollections not implemented") -} -func (*UnimplementedAPIServer) Create(ctx context.Context, req *CreateRequest) (*CreateReply, error) { - return nil, status.Errorf(codes.Unimplemented, "method Create not implemented") -} -func (*UnimplementedAPIServer) Verify(ctx context.Context, req *VerifyRequest) (*VerifyReply, error) { - return nil, status.Errorf(codes.Unimplemented, "method Verify not implemented") -} -func (*UnimplementedAPIServer) Save(ctx context.Context, req *SaveRequest) (*SaveReply, error) { - return nil, status.Errorf(codes.Unimplemented, "method Save not implemented") -} -func (*UnimplementedAPIServer) Delete(ctx context.Context, req *DeleteRequest) (*DeleteReply, error) { - return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented") -} -func (*UnimplementedAPIServer) Has(ctx context.Context, req *HasRequest) (*HasReply, error) { - return nil, status.Errorf(codes.Unimplemented, "method Has not implemented") -} -func (*UnimplementedAPIServer) Find(ctx context.Context, req *FindRequest) (*FindReply, error) { - return nil, status.Errorf(codes.Unimplemented, "method Find not implemented") -} -func (*UnimplementedAPIServer) FindByID(ctx context.Context, req *FindByIDRequest) (*FindByIDReply, error) { - return nil, status.Errorf(codes.Unimplemented, "method FindByID not implemented") -} -func (*UnimplementedAPIServer) ReadTransaction(srv API_ReadTransactionServer) error { - return status.Errorf(codes.Unimplemented, "method ReadTransaction not implemented") -} -func (*UnimplementedAPIServer) WriteTransaction(srv API_WriteTransactionServer) error { - return status.Errorf(codes.Unimplemented, "method WriteTransaction not implemented") -} -func (*UnimplementedAPIServer) Listen(req *ListenRequest, srv API_ListenServer) error { - return status.Errorf(codes.Unimplemented, "method Listen not implemented") -} - -func RegisterAPIServer(s *grpc.Server, srv APIServer) { - s.RegisterService(&_API_serviceDesc, srv) -} - -func _API_GetToken_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(APIServer).GetToken(&aPIGetTokenServer{stream}) -} - -type API_GetTokenServer interface { - Send(*GetTokenReply) error - Recv() (*GetTokenRequest, error) - grpc.ServerStream -} - -type aPIGetTokenServer struct { - grpc.ServerStream -} - -func (x *aPIGetTokenServer) Send(m *GetTokenReply) error { - return x.ServerStream.SendMsg(m) -} - -func (x *aPIGetTokenServer) Recv() (*GetTokenRequest, error) { - m := new(GetTokenRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _API_NewDB_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(NewDBRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(APIServer).NewDB(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/threads.pb.API/NewDB", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(APIServer).NewDB(ctx, req.(*NewDBRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _API_NewDBFromAddr_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(NewDBFromAddrRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(APIServer).NewDBFromAddr(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/threads.pb.API/NewDBFromAddr", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(APIServer).NewDBFromAddr(ctx, req.(*NewDBFromAddrRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _API_ListDBs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListDBsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(APIServer).ListDBs(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/threads.pb.API/ListDBs", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(APIServer).ListDBs(ctx, req.(*ListDBsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _API_GetDBInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetDBInfoRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(APIServer).GetDBInfo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/threads.pb.API/GetDBInfo", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(APIServer).GetDBInfo(ctx, req.(*GetDBInfoRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _API_DeleteDB_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteDBRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(APIServer).DeleteDB(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/threads.pb.API/DeleteDB", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(APIServer).DeleteDB(ctx, req.(*DeleteDBRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _API_NewCollection_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(NewCollectionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(APIServer).NewCollection(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/threads.pb.API/NewCollection", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(APIServer).NewCollection(ctx, req.(*NewCollectionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _API_UpdateCollection_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateCollectionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(APIServer).UpdateCollection(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/threads.pb.API/UpdateCollection", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(APIServer).UpdateCollection(ctx, req.(*UpdateCollectionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _API_DeleteCollection_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteCollectionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(APIServer).DeleteCollection(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/threads.pb.API/DeleteCollection", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(APIServer).DeleteCollection(ctx, req.(*DeleteCollectionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _API_GetCollectionInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetCollectionInfoRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(APIServer).GetCollectionInfo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/threads.pb.API/GetCollectionInfo", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(APIServer).GetCollectionInfo(ctx, req.(*GetCollectionInfoRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _API_GetCollectionIndexes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetCollectionIndexesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(APIServer).GetCollectionIndexes(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/threads.pb.API/GetCollectionIndexes", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(APIServer).GetCollectionIndexes(ctx, req.(*GetCollectionIndexesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _API_ListCollections_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListCollectionsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(APIServer).ListCollections(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/threads.pb.API/ListCollections", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(APIServer).ListCollections(ctx, req.(*ListCollectionsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _API_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(APIServer).Create(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/threads.pb.API/Create", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(APIServer).Create(ctx, req.(*CreateRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _API_Verify_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(VerifyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(APIServer).Verify(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/threads.pb.API/Verify", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(APIServer).Verify(ctx, req.(*VerifyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _API_Save_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SaveRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(APIServer).Save(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/threads.pb.API/Save", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(APIServer).Save(ctx, req.(*SaveRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _API_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(APIServer).Delete(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/threads.pb.API/Delete", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(APIServer).Delete(ctx, req.(*DeleteRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _API_Has_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(HasRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(APIServer).Has(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/threads.pb.API/Has", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(APIServer).Has(ctx, req.(*HasRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _API_Find_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(FindRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(APIServer).Find(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/threads.pb.API/Find", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(APIServer).Find(ctx, req.(*FindRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _API_FindByID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(FindByIDRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(APIServer).FindByID(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/threads.pb.API/FindByID", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(APIServer).FindByID(ctx, req.(*FindByIDRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _API_ReadTransaction_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(APIServer).ReadTransaction(&aPIReadTransactionServer{stream}) -} - -type API_ReadTransactionServer interface { - Send(*ReadTransactionReply) error - Recv() (*ReadTransactionRequest, error) - grpc.ServerStream -} - -type aPIReadTransactionServer struct { - grpc.ServerStream -} - -func (x *aPIReadTransactionServer) Send(m *ReadTransactionReply) error { - return x.ServerStream.SendMsg(m) -} - -func (x *aPIReadTransactionServer) Recv() (*ReadTransactionRequest, error) { - m := new(ReadTransactionRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _API_WriteTransaction_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(APIServer).WriteTransaction(&aPIWriteTransactionServer{stream}) -} - -type API_WriteTransactionServer interface { - Send(*WriteTransactionReply) error - Recv() (*WriteTransactionRequest, error) - grpc.ServerStream -} - -type aPIWriteTransactionServer struct { - grpc.ServerStream -} - -func (x *aPIWriteTransactionServer) Send(m *WriteTransactionReply) error { - return x.ServerStream.SendMsg(m) -} - -func (x *aPIWriteTransactionServer) Recv() (*WriteTransactionRequest, error) { - m := new(WriteTransactionRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _API_Listen_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(ListenRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(APIServer).Listen(m, &aPIListenServer{stream}) -} - -type API_ListenServer interface { - Send(*ListenReply) error - grpc.ServerStream -} - -type aPIListenServer struct { - grpc.ServerStream -} - -func (x *aPIListenServer) Send(m *ListenReply) error { - return x.ServerStream.SendMsg(m) -} - -var _API_serviceDesc = grpc.ServiceDesc{ - ServiceName: "threads.pb.API", - HandlerType: (*APIServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "NewDB", - Handler: _API_NewDB_Handler, - }, - { - MethodName: "NewDBFromAddr", - Handler: _API_NewDBFromAddr_Handler, - }, - { - MethodName: "ListDBs", - Handler: _API_ListDBs_Handler, - }, - { - MethodName: "GetDBInfo", - Handler: _API_GetDBInfo_Handler, - }, - { - MethodName: "DeleteDB", - Handler: _API_DeleteDB_Handler, - }, - { - MethodName: "NewCollection", - Handler: _API_NewCollection_Handler, - }, - { - MethodName: "UpdateCollection", - Handler: _API_UpdateCollection_Handler, - }, - { - MethodName: "DeleteCollection", - Handler: _API_DeleteCollection_Handler, - }, - { - MethodName: "GetCollectionInfo", - Handler: _API_GetCollectionInfo_Handler, - }, - { - MethodName: "GetCollectionIndexes", - Handler: _API_GetCollectionIndexes_Handler, - }, - { - MethodName: "ListCollections", - Handler: _API_ListCollections_Handler, - }, - { - MethodName: "Create", - Handler: _API_Create_Handler, - }, - { - MethodName: "Verify", - Handler: _API_Verify_Handler, - }, - { - MethodName: "Save", - Handler: _API_Save_Handler, - }, - { - MethodName: "Delete", - Handler: _API_Delete_Handler, - }, - { - MethodName: "Has", - Handler: _API_Has_Handler, - }, - { - MethodName: "Find", - Handler: _API_Find_Handler, - }, - { - MethodName: "FindByID", - Handler: _API_FindByID_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "GetToken", - Handler: _API_GetToken_Handler, - ServerStreams: true, - ClientStreams: true, - }, - { - StreamName: "ReadTransaction", - Handler: _API_ReadTransaction_Handler, - ServerStreams: true, - ClientStreams: true, - }, - { - StreamName: "WriteTransaction", - Handler: _API_WriteTransaction_Handler, - ServerStreams: true, - ClientStreams: true, - }, - { - StreamName: "Listen", - Handler: _API_Listen_Handler, - ServerStreams: true, - }, - }, - Metadata: "threads.proto", -} diff --git a/api/service.go b/api/service.go index d50af0f9..7cc220a6 100644 --- a/api/service.go +++ b/api/service.go @@ -8,12 +8,13 @@ import ( "io" "github.com/alecthomas/jsonschema" - logging "github.com/ipfs/go-log" + logging "github.com/ipfs/go-log/v2" "github.com/libp2p/go-libp2p-core/crypto" ma "github.com/multiformats/go-multiaddr" pb "github.com/textileio/go-threads/api/pb" "github.com/textileio/go-threads/core/app" core "github.com/textileio/go-threads/core/db" + "github.com/textileio/go-threads/core/did" lstore "github.com/textileio/go-threads/core/logstore" "github.com/textileio/go-threads/core/thread" "github.com/textileio/go-threads/db" @@ -24,7 +25,7 @@ import ( ) var ( - log = logging.Logger("threadsapi") + log = logging.Logger("threads/db/api") ) // Service is a gRPC service for a DB manager. @@ -43,7 +44,7 @@ func NewService(store kt.TxnDatastoreExtended, network app.Net, conf Config) (*S var err error if conf.Debug { err = util.SetLogLevels(map[string]logging.LogLevel{ - "threadsapi": logging.LevelDebug, + "threads/db/api": logging.LevelDebug, }) if err != nil { return nil, err @@ -61,101 +62,8 @@ func (s *Service) Close() error { return s.manager.Close() } -type remoteIdentity struct { - pk thread.PubKey - server pb.API_GetTokenServer -} - -func (i *remoteIdentity) MarshalBinary() ([]byte, error) { - return nil, nil -} - -func (i *remoteIdentity) UnmarshalBinary([]byte) error { - return nil -} - -func (i *remoteIdentity) Sign(ctx context.Context, msg []byte) ([]byte, error) { - if err := i.server.Send(&pb.GetTokenReply{ - Payload: &pb.GetTokenReply_Challenge{ - Challenge: msg, - }, - }); err != nil { - return nil, err - } - - var req *pb.GetTokenRequest - done := make(chan error) - go func() { - defer close(done) - var err error - req, err = i.server.Recv() - if err != nil { - done <- err - return - } - }() - select { - case <-ctx.Done(): - return nil, status.Error(codes.DeadlineExceeded, "Challenge deadline exceeded") - case err, ok := <-done: - if ok { - return nil, err - } - } - - var sig []byte - switch payload := req.Payload.(type) { - case *pb.GetTokenRequest_Signature: - sig = payload.Signature - default: - return nil, status.Error(codes.InvalidArgument, "Signature is required") - } - return sig, nil -} - -func (i *remoteIdentity) GetPublic() thread.PubKey { - return i.pk -} - -func (i *remoteIdentity) Decrypt(context.Context, []byte) ([]byte, error) { - return nil, nil // no-op -} - -func (i *remoteIdentity) Equals(thread.Identity) bool { - return false -} - -func (s *Service) GetToken(server pb.API_GetTokenServer) error { - log.Debugf("received get token request") - - req, err := server.Recv() - if err != nil { - return err - } - key := &thread.Libp2pPubKey{} - switch payload := req.Payload.(type) { - case *pb.GetTokenRequest_Key: - err = key.UnmarshalString(payload.Key) - if err != nil { - return err - } - default: - return status.Error(codes.InvalidArgument, "Key is required") - } - - identity := &remoteIdentity{ - pk: key, - server: server, - } - tok, err := s.manager.GetToken(server.Context(), identity) - if err != nil { - return err - } - return server.Send(&pb.GetTokenReply{ - Payload: &pb.GetTokenReply_Token{ - Token: string(tok), - }, - }) +func (s *Service) Manager() *db.Manager { + return s.manager } func (s *Service) NewDB(ctx context.Context, req *pb.NewDBRequest) (*pb.NewDBReply, error) { @@ -173,7 +81,7 @@ func (s *Service) NewDB(ctx context.Context, req *pb.NewDBRequest) (*pb.NewDBRep } collections[i] = cc } - token, err := thread.NewTokenFromMD(ctx) + token, err := did.NewTokenFromMD(ctx) if err != nil { return nil, err } @@ -221,7 +129,7 @@ func (s *Service) NewDBFromAddr(ctx context.Context, req *pb.NewDBFromAddrReques } collections[i] = cc } - token, err := thread.NewTokenFromMD(ctx) + token, err := did.NewTokenFromMD(ctx) if err != nil { return nil, err } @@ -280,7 +188,7 @@ func collectionConfigFromPb(pbc *pb.CollectionConfig) (db.CollectionConfig, erro } func (s *Service) ListDBs(ctx context.Context, _ *pb.ListDBsRequest) (*pb.ListDBsReply, error) { - token, err := thread.NewTokenFromMD(ctx) + token, err := did.NewTokenFromMD(ctx) if err != nil { return nil, err } @@ -310,7 +218,7 @@ func (s *Service) GetDBInfo(ctx context.Context, req *pb.GetDBInfoRequest) (*pb. if err != nil { return nil, status.Error(codes.InvalidArgument, err.Error()) } - token, err := thread.NewTokenFromMD(ctx) + token, err := did.NewTokenFromMD(ctx) if err != nil { return nil, err } @@ -322,7 +230,7 @@ func (s *Service) GetDBInfo(ctx context.Context, req *pb.GetDBInfoRequest) (*pb. return dBInfoToPb(d, token) } -func dBInfoToPb(d *db.DB, token thread.Token) (*pb.GetDBInfoReply, error) { +func dBInfoToPb(d *db.DB, token did.Token) (*pb.GetDBInfoReply, error) { info, err := d.GetDBInfo(db.WithToken(token)) if err != nil { return nil, err @@ -343,7 +251,7 @@ func (s *Service) DeleteDB(ctx context.Context, req *pb.DeleteDBRequest) (*pb.De if err != nil { return nil, status.Error(codes.InvalidArgument, err.Error()) } - token, err := thread.NewTokenFromMD(ctx) + token, err := did.NewTokenFromMD(ctx) if err != nil { return nil, err } @@ -363,7 +271,7 @@ func (s *Service) NewCollection(ctx context.Context, req *pb.NewCollectionReques if err != nil { return nil, status.Error(codes.InvalidArgument, err.Error()) } - token, err := thread.NewTokenFromMD(ctx) + token, err := did.NewTokenFromMD(ctx) if err != nil { return nil, err } @@ -375,7 +283,7 @@ func (s *Service) NewCollection(ctx context.Context, req *pb.NewCollectionReques if err != nil { return nil, err } - if _, err = d.NewCollection(cc); err != nil { + if _, err = d.NewCollection(cc, db.WithToken(token)); err != nil { return nil, err } return &pb.NewCollectionReply{}, nil @@ -386,7 +294,7 @@ func (s *Service) UpdateCollection(ctx context.Context, req *pb.UpdateCollection if err != nil { return nil, status.Error(codes.InvalidArgument, err.Error()) } - token, err := thread.NewTokenFromMD(ctx) + token, err := did.NewTokenFromMD(ctx) if err != nil { return nil, err } @@ -398,7 +306,7 @@ func (s *Service) UpdateCollection(ctx context.Context, req *pb.UpdateCollection if err != nil { return nil, err } - if _, err = d.UpdateCollection(cc); err != nil { + if _, err = d.UpdateCollection(cc, db.WithToken(token)); err != nil { return nil, err } return &pb.UpdateCollectionReply{}, nil @@ -409,7 +317,7 @@ func (s *Service) DeleteCollection(ctx context.Context, req *pb.DeleteCollection if err != nil { return nil, status.Error(codes.InvalidArgument, err.Error()) } - token, err := thread.NewTokenFromMD(ctx) + token, err := did.NewTokenFromMD(ctx) if err != nil { return nil, err } @@ -417,7 +325,7 @@ func (s *Service) DeleteCollection(ctx context.Context, req *pb.DeleteCollection if err != nil { return nil, err } - if err = d.DeleteCollection(req.Name); err != nil { + if err = d.DeleteCollection(req.Name, db.WithToken(token)); err != nil { return nil, err } return &pb.DeleteCollectionReply{}, nil @@ -428,7 +336,7 @@ func (s *Service) GetCollectionInfo(ctx context.Context, req *pb.GetCollectionIn if err != nil { return nil, status.Error(codes.InvalidArgument, err.Error()) } - token, err := thread.NewTokenFromMD(ctx) + token, err := did.NewTokenFromMD(ctx) if err != nil { return nil, err } @@ -461,7 +369,7 @@ func (s *Service) GetCollectionIndexes(ctx context.Context, req *pb.GetCollectio if err != nil { return nil, status.Error(codes.InvalidArgument, err.Error()) } - token, err := thread.NewTokenFromMD(ctx) + token, err := did.NewTokenFromMD(ctx) if err != nil { return nil, err } @@ -479,7 +387,7 @@ func (s *Service) ListCollections(ctx context.Context, req *pb.ListCollectionsRe if err != nil { return nil, status.Error(codes.InvalidArgument, err.Error()) } - token, err := thread.NewTokenFromMD(ctx) + token, err := did.NewTokenFromMD(ctx) if err != nil { return nil, err } @@ -506,7 +414,7 @@ func (s *Service) Create(ctx context.Context, req *pb.CreateRequest) (*pb.Create if err != nil { return nil, status.Error(codes.InvalidArgument, err.Error()) } - token, err := thread.NewTokenFromMD(ctx) + token, err := did.NewTokenFromMD(ctx) if err != nil { return nil, err } @@ -522,7 +430,7 @@ func (s *Service) Verify(ctx context.Context, req *pb.VerifyRequest) (*pb.Verify if err != nil { return nil, status.Error(codes.InvalidArgument, err.Error()) } - token, err := thread.NewTokenFromMD(ctx) + token, err := did.NewTokenFromMD(ctx) if err != nil { return nil, err } @@ -538,7 +446,7 @@ func (s *Service) Save(ctx context.Context, req *pb.SaveRequest) (*pb.SaveReply, if err != nil { return nil, status.Error(codes.InvalidArgument, err.Error()) } - token, err := thread.NewTokenFromMD(ctx) + token, err := did.NewTokenFromMD(ctx) if err != nil { return nil, err } @@ -554,7 +462,7 @@ func (s *Service) Delete(ctx context.Context, req *pb.DeleteRequest) (*pb.Delete if err != nil { return nil, status.Error(codes.InvalidArgument, err.Error()) } - token, err := thread.NewTokenFromMD(ctx) + token, err := did.NewTokenFromMD(ctx) if err != nil { return nil, err } @@ -570,7 +478,7 @@ func (s *Service) Has(ctx context.Context, req *pb.HasRequest) (*pb.HasReply, er if err != nil { return nil, status.Error(codes.InvalidArgument, err.Error()) } - token, err := thread.NewTokenFromMD(ctx) + token, err := did.NewTokenFromMD(ctx) if err != nil { return nil, err } @@ -586,7 +494,7 @@ func (s *Service) Find(ctx context.Context, req *pb.FindRequest) (*pb.FindReply, if err != nil { return nil, status.Error(codes.InvalidArgument, err.Error()) } - token, err := thread.NewTokenFromMD(ctx) + token, err := did.NewTokenFromMD(ctx) if err != nil { return nil, err } @@ -602,7 +510,7 @@ func (s *Service) FindByID(ctx context.Context, req *pb.FindByIDRequest) (*pb.Fi if err != nil { return nil, status.Error(codes.InvalidArgument, err.Error()) } - token, err := thread.NewTokenFromMD(ctx) + token, err := did.NewTokenFromMD(ctx) if err != nil { return nil, err } @@ -613,7 +521,7 @@ func (s *Service) FindByID(ctx context.Context, req *pb.FindByIDRequest) (*pb.Fi return s.processFindByIDRequest(req, token, collection.FindByID) } -func (s *Service) ReadTransaction(stream pb.API_ReadTransactionServer) error { +func (s *Service) ReadTransaction(stream pb.APIService_ReadTransactionServer) error { firstReq, err := stream.Recv() if err != nil { return err @@ -634,7 +542,7 @@ func (s *Service) ReadTransaction(stream pb.API_ReadTransactionServer) error { return fmt.Errorf("ReadTransactionRequest.Option has unexpected type %T", x) } - token, err := thread.NewTokenFromMD(stream.Context()) + token, err := did.NewTokenFromMD(stream.Context()) if err != nil { return err } @@ -698,7 +606,7 @@ func (s *Service) ReadTransaction(stream pb.API_ReadTransactionServer) error { }, db.WithTxnToken(token)) } -func (s *Service) WriteTransaction(stream pb.API_WriteTransactionServer) error { +func (s *Service) WriteTransaction(stream pb.APIService_WriteTransactionServer) error { firstReq, err := stream.Recv() if err != nil { return err @@ -719,7 +627,7 @@ func (s *Service) WriteTransaction(stream pb.API_WriteTransactionServer) error { return fmt.Errorf("WriteTransactionRequest.Option has unexpected type %T", x) } - token, err := thread.NewTokenFromMD(stream.Context()) + token, err := did.NewTokenFromMD(stream.Context()) if err != nil { return err } @@ -833,12 +741,12 @@ func (s *Service) WriteTransaction(stream pb.API_WriteTransactionServer) error { }, db.WithTxnToken(token)) } -func (s *Service) Listen(req *pb.ListenRequest, server pb.API_ListenServer) error { +func (s *Service) Listen(req *pb.ListenRequest, server pb.APIService_ListenServer) error { id, err := thread.Cast(req.DbID) if err != nil { return status.Error(codes.InvalidArgument, err.Error()) } - token, err := thread.NewTokenFromMD(server.Context()) + token, err := did.NewTokenFromMD(server.Context()) if err != nil { return err } @@ -914,7 +822,7 @@ func (s *Service) Listen(req *pb.ListenRequest, server pb.API_ListenServer) erro } } -func (s *Service) instanceForAction(d *db.DB, action db.Action, token thread.Token) ([]byte, error) { +func (s *Service) instanceForAction(d *db.DB, action db.Action, token did.Token) ([]byte, error) { collection := d.GetCollection(action.Collection, db.WithToken(token)) if collection == nil { return nil, status.Error(codes.NotFound, db.ErrCollectionNotFound.Error()) @@ -926,7 +834,7 @@ func (s *Service) instanceForAction(d *db.DB, action db.Action, token thread.Tok return res, nil } -func (s *Service) processCreateRequest(req *pb.CreateRequest, token thread.Token, createFunc func([][]byte, ...db.TxnOption) ([]core.InstanceID, error)) (*pb.CreateReply, error) { +func (s *Service) processCreateRequest(req *pb.CreateRequest, token did.Token, createFunc func([][]byte, ...db.TxnOption) ([]core.InstanceID, error)) (*pb.CreateReply, error) { res, err := createFunc(req.Instances, db.WithTxnToken(token)) if err != nil { return &pb.CreateReply{}, err @@ -938,17 +846,17 @@ func (s *Service) processCreateRequest(req *pb.CreateRequest, token thread.Token return &pb.CreateReply{InstanceIDs: ids}, nil } -func (s *Service) processVerifyRequest(req *pb.VerifyRequest, token thread.Token, verifyFunc func([][]byte, ...db.TxnOption) error) (*pb.VerifyReply, error) { +func (s *Service) processVerifyRequest(req *pb.VerifyRequest, token did.Token, verifyFunc func([][]byte, ...db.TxnOption) error) (*pb.VerifyReply, error) { err := verifyFunc(req.Instances, db.WithTxnToken(token)) return &pb.VerifyReply{}, err } -func (s *Service) processSaveRequest(req *pb.SaveRequest, token thread.Token, saveFunc func([][]byte, ...db.TxnOption) error) (*pb.SaveReply, error) { +func (s *Service) processSaveRequest(req *pb.SaveRequest, token did.Token, saveFunc func([][]byte, ...db.TxnOption) error) (*pb.SaveReply, error) { err := saveFunc(req.Instances, db.WithTxnToken(token)) return &pb.SaveReply{}, err } -func (s *Service) processDeleteRequest(req *pb.DeleteRequest, token thread.Token, deleteFunc func([]core.InstanceID, ...db.TxnOption) error) (*pb.DeleteReply, error) { +func (s *Service) processDeleteRequest(req *pb.DeleteRequest, token did.Token, deleteFunc func([]core.InstanceID, ...db.TxnOption) error) (*pb.DeleteReply, error) { instanceIDs := make([]core.InstanceID, len(req.InstanceIDs)) for i, ID := range req.InstanceIDs { instanceIDs[i] = core.InstanceID(ID) @@ -957,7 +865,7 @@ func (s *Service) processDeleteRequest(req *pb.DeleteRequest, token thread.Token return &pb.DeleteReply{}, err } -func (s *Service) processHasRequest(req *pb.HasRequest, token thread.Token, hasFunc func([]core.InstanceID, ...db.TxnOption) (bool, error)) (*pb.HasReply, error) { +func (s *Service) processHasRequest(req *pb.HasRequest, token did.Token, hasFunc func([]core.InstanceID, ...db.TxnOption) (bool, error)) (*pb.HasReply, error) { instanceIDs := make([]core.InstanceID, len(req.InstanceIDs)) for i, ID := range req.InstanceIDs { instanceIDs[i] = core.InstanceID(ID) @@ -966,13 +874,13 @@ func (s *Service) processHasRequest(req *pb.HasRequest, token thread.Token, hasF return &pb.HasReply{Exists: exists}, err } -func (s *Service) processFindByIDRequest(req *pb.FindByIDRequest, token thread.Token, findFunc func(id core.InstanceID, opts ...db.TxnOption) ([]byte, error)) (*pb.FindByIDReply, error) { +func (s *Service) processFindByIDRequest(req *pb.FindByIDRequest, token did.Token, findFunc func(id core.InstanceID, opts ...db.TxnOption) ([]byte, error)) (*pb.FindByIDReply, error) { instanceID := core.InstanceID(req.InstanceID) found, err := findFunc(instanceID, db.WithTxnToken(token)) return &pb.FindByIDReply{Instance: found}, err } -func (s *Service) processFindRequest(req *pb.FindRequest, token thread.Token, findFunc func(q *db.Query, opts ...db.TxnOption) (ret [][]byte, err error)) (*pb.FindReply, error) { +func (s *Service) processFindRequest(req *pb.FindRequest, token did.Token, findFunc func(q *db.Query, opts ...db.TxnOption) (ret [][]byte, err error)) (*pb.FindReply, error) { q := &db.Query{} if err := json.Unmarshal(req.QueryJSON, q); err != nil { return &pb.FindReply{}, err @@ -981,7 +889,7 @@ func (s *Service) processFindRequest(req *pb.FindRequest, token thread.Token, fi return &pb.FindReply{Instances: instances}, err } -func (s *Service) getDB(ctx context.Context, id thread.ID, token thread.Token) (*db.DB, error) { +func (s *Service) getDB(ctx context.Context, id thread.ID, token did.Token) (*db.DB, error) { d, err := s.manager.GetDB(ctx, id, db.WithManagedToken(token)) if err != nil { if errors.Is(err, lstore.ErrThreadNotFound) || errors.Is(err, db.ErrDBNotFound) { @@ -993,12 +901,12 @@ func (s *Service) getDB(ctx context.Context, id thread.ID, token thread.Token) ( return d, nil } -func (s *Service) getCollection(ctx context.Context, collectionName string, id thread.ID, token thread.Token) (*db.Collection, error) { +func (s *Service) getCollection(ctx context.Context, collectionName string, id thread.ID, token did.Token) (*db.Collection, error) { d, err := s.getDB(ctx, id, token) if err != nil { return nil, err } - collection := d.GetCollection(collectionName) + collection := d.GetCollection(collectionName, db.WithToken(token)) if collection == nil { return nil, status.Error(codes.NotFound, db.ErrCollectionNotFound.Error()) } diff --git a/buf.yaml b/buf.yaml new file mode 100644 index 00000000..b5b205e8 --- /dev/null +++ b/buf.yaml @@ -0,0 +1,15 @@ +build: + roots: + - . + excludes: + - api/pb/javascript + - net/api/pb/javascript +lint: + use: + - DEFAULT + except: + - PACKAGE_VERSION_SUFFIX +breaking: + use: + - FILE + \ No newline at end of file diff --git a/buildinfo/buildinfo.go b/buildinfo/buildinfo.go new file mode 100644 index 00000000..bb7fc435 --- /dev/null +++ b/buildinfo/buildinfo.go @@ -0,0 +1,31 @@ +package buildinfo + +import "fmt" + +var ( + // GitCommit is set by govvv at build time. + GitCommit = "" + // GitBranch is set by govvv at build time. + GitBranch = "" + // GitState is set by govvv at build time. + GitState = "" + // GitSummary is set by govvv at build time. + GitSummary = "" + // BuildDate is set by govvv at build time. + BuildDate = "" + // Version is set by govvv at build time. + Version = "git" +) + +// Summary prints a summary of all build info. +func Summary() string { + return fmt.Sprintf( + "\tversion:\t%s\n\tbuild date:\t%s\n\tgit summary:\t%s\n\tgit branch:\t%s\n\tgit commit:\t%s\n\tgit state:\t%s", + Version, + BuildDate, + GitSummary, + GitBranch, + GitCommit, + GitState, + ) +} diff --git a/buildtools/install_protoc.bash b/buildtools/install_protoc.bash new file mode 100755 index 00000000..c7146e36 --- /dev/null +++ b/buildtools/install_protoc.bash @@ -0,0 +1,23 @@ +#!/bin/bash +set -eo pipefail + +if [ ! -d ./protoc ]; then + OS=$(uname) + if [ $OS = "Darwin" ]; then + OS="osx" + fi + VERSION=3.13.0 + ZIPNAME=protoc-$VERSION-$OS-x86_64 + DOWNLOADLINK=https://github.com/protocolbuffers/protobuf/releases/download/v$VERSION/$ZIPNAME.zip + curl -LO $DOWNLOADLINK + unzip $ZIPNAME.zip -d protoc + rm $ZIPNAME.zip +fi + +if [ ! -d ./protoc-gen-go ]; then + git clone --single-branch --depth 1 --branch "v1.4.3" https://github.com/golang/protobuf.git + cd protobuf + go build -o ../protoc-gen-go/protoc-gen-go ./protoc-gen-go + cd .. + rm -rf protobuf +fi diff --git a/cmd/threadsd/Dockerfile b/cmd/threadsd/Dockerfile new file mode 100644 index 00000000..d11f786f --- /dev/null +++ b/cmd/threadsd/Dockerfile @@ -0,0 +1,86 @@ +FROM golang:1.16.0-buster +MAINTAINER Textile + +# This is (in large part) copied (with love) from +# https://hub.docker.com/r/ipfs/go-ipfs/dockerfile + +# Install deps +RUN apt-get update && apt-get install -y \ + libssl-dev \ + ca-certificates + +ENV SRC_DIR /go-threads + +# Download packages first so they can be cached. +COPY go.mod go.sum $SRC_DIR/ +RUN cd $SRC_DIR \ + && CGO_ENABLED=0 go mod download + +COPY . $SRC_DIR + +# Build the thing. +RUN cd $SRC_DIR \ + && BIN_BUILD_FLAGS="CGO_ENABLED=0 GOOS=linux" make build-threadsd + +# Get su-exec, a very minimal tool for dropping privileges, +# and tini, a very minimal init daemon for containers +ENV SUEXEC_VERSION v0.2 +ENV TINI_VERSION v0.19.0 +RUN set -eux; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "${dpkgArch##*-}" in \ + "amd64" | "armhf" | "arm64") tiniArch="tini-static-$dpkgArch" ;;\ + *) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;; \ + esac; \ + cd /tmp \ + && git clone https://github.com/ncopa/su-exec.git \ + && cd su-exec \ + && git checkout -q $SUEXEC_VERSION \ + && make su-exec-static \ + && cd /tmp \ + && wget -q -O tini https://github.com/krallin/tini/releases/download/$TINI_VERSION/$tiniArch \ + && chmod +x tini + +# Now comes the actual target image, which aims to be as small as possible. +FROM busybox:1.31.1-glibc +LABEL maintainer="Textile " + +# Get the binary, entrypoint script, and TLS CAs from the build container. +ENV SRC_DIR /go-threads +COPY --from=0 $SRC_DIR/threadsd /usr/local/bin/threadsd +COPY --from=0 /tmp/su-exec/su-exec-static /sbin/su-exec +COPY --from=0 /tmp/tini /sbin/tini +COPY --from=0 /etc/ssl/certs /etc/ssl/certs + +# This shared lib (part of glibc) doesn't seem to be included with busybox. +COPY --from=0 /lib/*-linux-gnu*/libdl.so.2 /lib/ + +# Copy over SSL libraries. +COPY --from=0 /usr/lib/*-linux-gnu*/libssl.so* /usr/lib/ +COPY --from=0 /usr/lib/*-linux-gnu*/libcrypto.so* /usr/lib/ + +# hostAddr; should be exposed to the public +EXPOSE 4006 +# apiAddr; can be exposed to the public +EXPOSE 5000 +# apiProxyAddr; can be exposed to the public +EXPOSE 5050 +# addrGateway; can be exposed to the public. +EXPOSE 8000 + +# Create the repo directory. +ENV THREADS_PATH /data/threads +RUN mkdir -p $THREADS_PATH \ + && adduser -D -h $THREADS_PATH -u 1000 -G users threads \ + && chown threads:users $THREADS_PATH + +# Switch to a non-privileged user. +USER threads + +# Expose the repo as a volume. +# Important this happens after the USER directive so permission are correct. +VOLUME $THREADS_PATH + +ENTRYPOINT ["/sbin/tini", "--", "threadsd"] + +CMD ["--badgerRepo=/data/threads"] diff --git a/cmd/threadsd/Dockerfile.dev b/cmd/threadsd/Dockerfile.dev new file mode 100644 index 00000000..4aafeb68 --- /dev/null +++ b/cmd/threadsd/Dockerfile.dev @@ -0,0 +1,40 @@ +FROM golang:1.16.0-buster + +RUN apt-get update + +RUN go get github.com/go-delve/delve/cmd/dlv + +ENV SRC_DIR /go-threads + +COPY go.mod go.sum $SRC_DIR/ +RUN cd $SRC_DIR \ + && CGO_ENABLED=0 go mod download + +COPY . $SRC_DIR + +RUN cd $SRC_DIR \ + && CGO_ENABLED=0 GOOS=linux go build -gcflags "all=-N -l" -o threadsd cmd/threadsd/main.go + +FROM debian:buster +LABEL maintainer="Textile " + +ENV SRC_DIR /go-threads +COPY --from=0 /go/bin/dlv /usr/local/bin/dlv +COPY --from=0 $SRC_DIR/threadsd /usr/local/bin/threadsd + +EXPOSE 4006 +EXPOSE 5000 +EXPOSE 5050 +EXPOSE 8000 +EXPOSE 40000 + +ENV THREADS_PATH /data/threads +RUN adduser --home $THREADS_PATH --disabled-login --gecos "" --ingroup users threads + +USER threads + +VOLUME $THREADS_PATH + +ENTRYPOINT ["dlv", "--listen=0.0.0.0:40000", "--headless=true", "--accept-multiclient", "--continue", "--api-version=2", "exec", "/usr/local/bin/threadsd"] + +CMD ["--", "--badgerRepo=/data/threads"] diff --git a/cmd/threadsd/docker-compose-dev.yml b/cmd/threadsd/docker-compose-dev.yml new file mode 100644 index 00000000..1755c3e2 --- /dev/null +++ b/cmd/threadsd/docker-compose-dev.yml @@ -0,0 +1,33 @@ +version: "3" +services: + threads: + build: + context: ../../ + dockerfile: ./cmd/threadsd/Dockerfile.dev + volumes: + - "${REPO_PATH}/threads:/data/threads" + environment: + - THREADS_HOSTADDR + - THREADS_APIADDR=/ip4/0.0.0.0/tcp/5000 + - THREADS_APIPROXYADDR=/ip4/0.0.0.0/tcp/5050 + - THREADS_GATEWAYADDR=0.0.0.0:8000 + - THREADS_GATEWAYURL + - THREADS_GATEWAYSUBDOMAINS + - THREADS_CONNLOWWATER + - THREADS_CONNHIGHWATER + - THREADS_CONNGRACEPERIOD + - THREADS_KEEPALIVEINTERVAL + - THREADS_ENABLENETPUBSUB + - THREADS_MONGOURI + - THREADS_MONGODATABASE + - THREADS_DEBUG=true + ports: + - "4006:4006" + - "4006:4006/udp" + - "127.0.0.1:5000:5000" + - "127.0.0.1:5050:5050" + - "127.0.0.1:8000:8000" + security_opt: + - "seccomp:unconfined" + cap_add: + - SYS_PTRACE diff --git a/cmd/threadsd/docker-compose.yml b/cmd/threadsd/docker-compose.yml new file mode 100644 index 00000000..147cb030 --- /dev/null +++ b/cmd/threadsd/docker-compose.yml @@ -0,0 +1,28 @@ +version: "3" +services: + threads: + image: textile/go-threads:latest + restart: always + volumes: + - "${REPO_PATH}/threads:/data/threads" + environment: + - THREADS_HOSTADDR + - THREADS_APIADDR=/ip4/0.0.0.0/tcp/5000 + - THREADS_APIPROXYADDR=/ip4/0.0.0.0/tcp/5050 + - THREADS_GATEWAYADDR=0.0.0.0:8000 + - THREADS_GATEWAYURL + - THREADS_GATEWAYSUBDOMAINS + - THREADS_CONNLOWWATER + - THREADS_CONNHIGHWATER + - THREADS_CONNGRACEPERIOD + - THREADS_KEEPALIVEINTERVAL + - THREADS_ENABLENETPUBSUB + - THREADS_MONGOURI + - THREADS_MONGODATABASE + - THREADS_DEBUG + ports: + - "4006:4006" + - "4006:4006/udp" + - "5000:5000" + - "5050:5050" + - "8000:8000" diff --git a/threadsd/main.go b/cmd/threadsd/main.go similarity index 76% rename from threadsd/main.go rename to cmd/threadsd/main.go index d54824b7..e48b735a 100644 --- a/threadsd/main.go +++ b/cmd/threadsd/main.go @@ -12,7 +12,7 @@ import ( "time" "github.com/improbable-eng/grpc-web/go/grpcweb" - logging "github.com/ipfs/go-log" + logging "github.com/ipfs/go-log/v2" connmgr "github.com/libp2p/go-libp2p-connmgr" ma "github.com/multiformats/go-multiaddr" "github.com/namsral/flag" @@ -21,6 +21,7 @@ import ( pb "github.com/textileio/go-threads/api/pb" "github.com/textileio/go-threads/common" kt "github.com/textileio/go-threads/db/keytransform" + "github.com/textileio/go-threads/gateway" netapi "github.com/textileio/go-threads/net/api" netpb "github.com/textileio/go-threads/net/api/pb" "github.com/textileio/go-threads/util" @@ -30,21 +31,31 @@ import ( var log = logging.Logger("threadsd") func main() { - fs := flag.NewFlagSetWithEnvPrefix(os.Args[0], "THRDS", 0) + fs := flag.NewFlagSetWithEnvPrefix(os.Args[0], "THREADS", 0) - repo := fs.String("repo", ".threads", "Repo location") hostAddrStr := fs.String("hostAddr", "/ip4/0.0.0.0/tcp/4006", "Libp2p host bind address") - apiAddrStr := fs.String("apiAddr", "/ip4/127.0.0.1/tcp/6006", "gRPC API bind address") - apiProxyAddrStr := fs.String("apiProxyAddr", "/ip4/127.0.0.1/tcp/6007", "gRPC API web proxy bind address") + + apiAddrStr := fs.String("apiAddr", "/ip4/127.0.0.1/tcp/5000", "gRPC API bind address") + apiProxyAddrStr := fs.String("apiProxyAddr", "/ip4/127.0.0.1/tcp/5050", "gRPC API web proxy bind address") + + gatewayAddr := fs.String("gatewayAddr", "127.0.0.1:8000", "Gateway bind address") + gatewayUrl := fs.String("gatewayUrl", "http://127.0.0.1:8000", "Gateway bind address") + gatewaySubdomains := fs.Bool("gatewaySubdomains", false, "Enable gateway namespace subdomain redirection") + connLowWater := fs.Int("connLowWater", 100, "Low watermark of libp2p connections that'll be maintained") connHighWater := fs.Int("connHighWater", 400, "High watermark of libp2p connections that'll be maintained") connGracePeriod := fs.Duration("connGracePeriod", time.Second*20, "Duration a new opened connection is not subject to pruning") keepAliveInterval := fs.Duration("keepAliveInterval", time.Second*5, "Websocket keepalive interval (must be >= 1s)") + enableNetPubsub := fs.Bool("enableNetPubsub", false, "Enables thread networking over libp2p pubsub") + + badgerRepo := fs.String("badgerRepo", "${HOME}/.threads", "Badger repo location") mongoUri := fs.String("mongoUri", "", "MongoDB URI (if not provided, an embedded Badger datastore will be used)") mongoDatabase := fs.String("mongoDatabase", "", "MongoDB database name (required with mongoUri") - badgerLowMem := fs.Bool("badgerLowMem", false, "Use Badger's low memory settings") + debug := fs.Bool("debug", false, "Enables debug logging") + logFile := fs.String("log", "", "Write logs to file") + if err := fs.Parse(os.Args[1:]); err != nil { log.Fatal(err) } @@ -71,35 +82,44 @@ func main() { if len(*mongoDatabase) == 0 { log.Fatal("mongoDatabase is required with mongoUri") } - } else { - log.Debugf("badgerLowMem: %v", *badgerLowMem) } - if err := util.SetupDefaultLoggingConfig(*repo); err != nil { + *logFile = os.ExpandEnv(*logFile) + if err := util.SetupDefaultLoggingConfig(*logFile); err != nil { log.Fatal(err) } if *debug { - if err := logging.SetLogLevel("threadsd", "debug"); err != nil { + if err := util.SetLogLevels(map[string]logging.LogLevel{ + "threadsd": logging.LevelDebug, + "threads/registry": logging.LevelDebug, + "threads/gateway": logging.LevelDebug, + }); err != nil { log.Fatal(err) } } - log.Debugf("repo: %v", *repo) log.Debugf("hostAddr: %v", *hostAddrStr) log.Debugf("apiAddr: %v", *apiAddrStr) log.Debugf("apiProxyAddr: %v", *apiProxyAddrStr) + log.Debugf("gatewayAddr: %v", *gatewayAddr) + log.Debugf("gatewayUrl: %v", *gatewayUrl) + log.Debugf("gatewaySubdomains: %v", *gatewaySubdomains) log.Debugf("connLowWater: %v", *connLowWater) log.Debugf("connHighWater: %v", *connHighWater) log.Debugf("connGracePeriod: %v", *connGracePeriod) log.Debugf("keepAliveInterval: %v", *keepAliveInterval) log.Debugf("enableNetPubsub: %v", *enableNetPubsub) - if parsedMongoUri != nil { + if parsedMongoUri == nil { + *badgerRepo = os.ExpandEnv(*badgerRepo) + log.Debugf("badgerRepo: %v", *badgerRepo) + } else { log.Debugf("mongoUri: %v", parsedMongoUri.Redacted()) log.Debugf("mongoDatabase: %v", *mongoDatabase) - } else { - log.Debugf("badgerLowMem: %v", *badgerLowMem) } log.Debugf("debug: %v", *debug) + if *logFile != "" { + log.Debugf("log: %v", *logFile) + } opts := []common.NetOption{ common.WithNetHostAddr(hostAddr), @@ -110,7 +130,7 @@ func main() { if parsedMongoUri != nil { opts = append(opts, common.WithNetMongoPersistence(*mongoUri, *mongoDatabase)) } else { - opts = append(opts, common.WithNetBadgerPersistence(*repo)) + opts = append(opts, common.WithNetBadgerPersistence(*badgerRepo)) } n, err := common.DefaultNetwork(opts...) if err != nil { @@ -125,7 +145,7 @@ func main() { if *mongoUri != "" { store, err = mongods.New(ctx, *mongoUri, *mongoDatabase, mongods.WithCollName("eventstore")) } else { - store, err = util.NewBadgerDatastore(*repo, "eventstore", *badgerLowMem) + store, err = util.NewBadgerDatastore(*badgerRepo, "eventstore") } if err != nil { log.Fatal(err) @@ -158,8 +178,8 @@ func main() { log.Fatal(err) } go func() { - pb.RegisterAPIServer(server, service) - netpb.RegisterAPIServer(server, netService) + pb.RegisterAPIServiceServer(server, service) + netpb.RegisterAPIServiceServer(server, netService) if err := server.Serve(listener); err != nil && !errors.Is(err, grpc.ErrServerStopped) { log.Fatalf("serve error: %v", err) } @@ -190,10 +210,19 @@ func main() { } }() + gw, err := gateway.NewGateway(service.Manager(), *gatewayAddr, *gatewayUrl, *gatewaySubdomains) + if err != nil { + log.Fatal(err) + } + gw.Start() + fmt.Println("Welcome to Threads!") fmt.Println("Your peer ID is " + n.Host().ID().String()) handleInterrupt(func() { + if err := gw.Close(); err != nil { + log.Fatal(err) + } ctx, cancel := context.WithTimeout(context.Background(), time.Second) defer cancel() if err := proxy.Shutdown(ctx); err != nil { diff --git a/common/common.go b/common/common.go index 65392a27..4636617b 100644 --- a/common/common.go +++ b/common/common.go @@ -18,9 +18,11 @@ import ( "github.com/libp2p/go-libp2p-core/peer" "github.com/libp2p/go-libp2p-peerstore/pstoreds" ma "github.com/multiformats/go-multiaddr" + badger "github.com/textileio/go-ds-badger3" mongods "github.com/textileio/go-ds-mongo" "github.com/textileio/go-threads/core/app" core "github.com/textileio/go-threads/core/logstore" + "github.com/textileio/go-threads/did/registry" "github.com/textileio/go-threads/logstore/lstoreds" "github.com/textileio/go-threads/logstore/lstorehybrid" "github.com/textileio/go-threads/logstore/lstoremem" @@ -29,13 +31,13 @@ import ( "google.golang.org/grpc" ) -// DefaultNetwork is a boostrapable default Net with sane defaults. type NetBoostrapper interface { app.Net GetIpfsLite() *ipfslite.Peer Bootstrap(addrs []peer.AddrInfo) } +// DefaultNetwork is a boostrapable default Net with sane defaults. func DefaultNetwork(opts ...NetOption) (NetBoostrapper, error) { var ( config NetConfig @@ -96,8 +98,19 @@ func DefaultNetwork(opts ...NetOption) (NetBoostrapper, error) { return nil, fin.Cleanup(err) } + regcache, err := persistentStore(ctx, config, "registry", fin) + if err != nil { + return nil, fin.Cleanup(err) + } + fin.Add(regcache) + reg, err := registry.NewRegistry(h, tstore, regcache) + if err != nil { + return nil, fin.Cleanup(err) + } + fin.Add(reg) + // Build a network - api, err := net.NewNetwork(ctx, h, lite.BlockStore(), lite, tstore, net.Config{ + api, err := net.NewNetwork(ctx, h, lite.BlockStore(), lite, tstore, reg, net.Config{ Debug: config.Debug, PubSub: config.PubSub, }, config.GRPCServerOptions, config.GRPCDialOptions) @@ -155,7 +168,7 @@ func badgerStore(repoPath string, fin *util.Finalizer) (ds.Batching, error) { return nil, err } - dstore, err := ipfslite.BadgerDatastore(repoPath) + dstore, err := badger.NewDatastore(repoPath, &badger.DefaultOptions) if err != nil { return nil, err } diff --git a/core/app/app.go b/core/app/app.go index 09423983..c739ca5e 100644 --- a/core/app/app.go +++ b/core/app/app.go @@ -8,6 +8,7 @@ import ( format "github.com/ipfs/go-ipld-format" "github.com/textileio/go-threads/broadcast" + "github.com/textileio/go-threads/core/did" "github.com/textileio/go-threads/core/net" "github.com/textileio/go-threads/core/thread" "github.com/textileio/go-threads/util" @@ -29,7 +30,7 @@ type App interface { // ValidateNetRecordBody provides the app an opportunity to validate the contents // of a record before it's committed to a thread log. // identity is the author's public key. - ValidateNetRecordBody(ctx context.Context, body format.Node, identity thread.PubKey) error + ValidateNetRecordBody(ctx context.Context, body format.Node, identity did.DID) error // HandleNetRecord handles an inbound thread record from net. HandleNetRecord(ctx context.Context, rec net.ThreadRecord, key thread.Key) error @@ -75,7 +76,7 @@ func (leb *LocalEventsBus) Discard() { // LocalEvent wraps an IPLD node and auth for delivery to a thread. type LocalEvent struct { Node format.Node - Token thread.Token + Token did.Token } // LocalEventListener notifies about new locally generated events. @@ -101,11 +102,6 @@ type Net interface { // ConnectApp returns an app<->thread connector. ConnectApp(App, thread.ID) (*Connector, error) - - // Validate thread ID and token against the net host. - // If token is present and was issued the net host (is valid), the embedded public key is returned. - // If token is not present, both the returned public key and error will be nil. - Validate(id thread.ID, token thread.Token, readOnly bool) (thread.PubKey, error) } // Connector connects an app to a thread. @@ -146,18 +142,17 @@ func (c *Connector) Token() net.Token { } // CreateNetRecord calls net.CreateRecord while supplying thread ID and API token. -func (c *Connector) CreateNetRecord(ctx context.Context, body format.Node, token thread.Token) (net.ThreadRecord, error) { +func (c *Connector) CreateNetRecord(ctx context.Context, body format.Node, token did.Token) (net.ThreadRecord, error) { return c.Net.CreateRecord(ctx, c.threadID, body, net.WithThreadToken(token), net.WithAPIToken(c.token)) } -// Validate thread token against the net host. -func (c *Connector) Validate(token thread.Token, readOnly bool) error { - _, err := c.Net.Validate(c.threadID, token, readOnly) - return err +// ValidateIdentity an identity token against the net host. +func (c *Connector) ValidateIdentity(token did.Token) (thread.PubKey, did.DID, error) { + return c.Net.ValidateIdentity(context.TODO(), token) } // ValidateNetRecordBody calls the connection app's ValidateNetRecordBody. -func (c *Connector) ValidateNetRecordBody(ctx context.Context, body format.Node, identity thread.PubKey) error { +func (c *Connector) ValidateNetRecordBody(ctx context.Context, body format.Node, identity did.DID) error { return c.app.ValidateNetRecordBody(ctx, body, identity) } diff --git a/core/db/db.go b/core/db/db.go index 2f85931f..03dc1c01 100644 --- a/core/db/db.go +++ b/core/db/db.go @@ -1,12 +1,9 @@ package db import ( - "crypto/rand" - "strings" - ds "github.com/ipfs/go-datastore" - "github.com/ipfs/go-ipld-format" - ulid "github.com/oklog/ulid/v2" + format "github.com/ipfs/go-ipld-format" + "github.com/textileio/go-threads/util" ) const ( @@ -19,8 +16,7 @@ type InstanceID string // NewInstanceID generates a new identity for an instance. func NewInstanceID() InstanceID { - id := ulid.MustNew(ulid.Now(), rand.Reader) - return InstanceID(strings.ToLower(id.String())) + return InstanceID(util.MakeToken()) } func (e InstanceID) String() string { diff --git a/core/did/did.go b/core/did/did.go new file mode 100644 index 00000000..5428ed77 --- /dev/null +++ b/core/did/did.go @@ -0,0 +1,133 @@ +package did + +import ( + "context" + "strings" + + "github.com/grpc-ecosystem/go-grpc-middleware/util/metautils" + "github.com/ockam-network/did" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +// DID is a concrete type for a decentralized identifier. +// See https://www.w3.org/TR/did-core/#dfn-did-schemes. +type DID string + +// NewKeyDID prefixes "did:key:" to an identifier. +func NewKeyDID(id string) DID { + return DID("did:key:" + id) +} + +// Defined returns whether or not the DID is an empty string. +// Note: A DID that is defined may not be valid. Use Decode to determine DID validity. +func (d DID) Defined() bool { + return len(d) != 0 +} + +// Decode returns info about a DID. +func (d DID) Decode() (*did.DID, error) { + return did.Parse(string(d)) +} + +// Document is a DID document that describes a DID subject. +// See https://www.w3.org/TR/did-core/#dfn-did-documents. +type Document struct { + Context []string `json:"@context"` + ID DID `json:"id"` + Conroller []DID `json:"conroller,omitempty"` + Authentication []VerificationMethod `json:"authentication"` + Services []Service `json:"services,omitempty"` +} + +// VerificationMethod describes how to authenticate or authorize interactions with a DID subject. +// See https://www.w3.org/TR/did-core/#dfn-verification-method. +type VerificationMethod struct { + ID DID `json:"id"` + Type string `json:"type"` + Controller DID `json:"controller"` + PublicKeyMultiBase string `json:"publicKeyMultiBase"` +} + +// Service describes a service provided by the DID subject. +// See https://www.w3.org/TR/did-core/#dfn-service. +type Service struct { + ID DID `json:"id"` + Type string `json:"type"` + ServiceEndpoint string `json:"serviceEndpoint"` + ServiceProtocol string `json:"serviceProtocol"` +} + +// VerifiableCredential is a set of claims about a subject. +// See https://www.w3.org/TR/vc-data-model/#dfn-verifiable-credentials. +type VerifiableCredential struct { + Context []string `json:"@context"` + Type []string `json:"type"` + CredentialSubject VerifiableCredentialSubject `json:"credentialSubject"` +} + +// VerifiableCredentialSubject is an entity about which claims are made. +// See https://www.w3.org/TR/vc-data-model/#dfn-subjects. +type VerifiableCredentialSubject struct { + ID DID `json:"id"` + Document Document `json:"document,omitempty"` +} + +// Token is a concrete type for a JWT token string. +type Token string + +// Defined returns true if token is not empty. +func (t Token) Defined() bool { + return len(t) != 0 +} + +// NewTokenFromMD returns Token from the given context, if present. +func NewTokenFromMD(ctx context.Context) (tok Token, err error) { + val := metautils.ExtractIncoming(ctx).Get("authorization") + if val == "" { + return + } + parts := strings.SplitN(val, " ", 2) + if len(parts) < 2 { + return "", status.Error(codes.Unauthenticated, "Bad authorization string") + } + if !strings.EqualFold(parts[0], "bearer") { + return "", status.Errorf(codes.Unauthenticated, "Request unauthenticated with bearer") + } + return Token(parts[1]), nil +} + +type ctxKey string + +// NewTokenContext adds Token to a context. +func NewTokenContext(ctx context.Context, token Token) context.Context { + if token == "" { + return ctx + } + return context.WithValue(ctx, ctxKey("token"), token) +} + +// TokenFromContext returns Token from a context. +func TokenFromContext(ctx context.Context) (Token, bool) { + token, ok := ctx.Value(ctxKey("token")).(Token) + return token, ok +} + +// RPCCredentials implements PerRPCCredentials, allowing context values +// to be included in request metadata. +type RPCCredentials struct { + Secure bool +} + +func (c RPCCredentials) GetRequestMetadata(ctx context.Context, _ ...string) (map[string]string, error) { + md := map[string]string{} + token, ok := TokenFromContext(ctx) + if ok { + md["authorization"] = "bearer " + string(token) + } + return md, nil +} + +func (c RPCCredentials) RequireTransportSecurity() bool { + return c.Secure +} diff --git a/core/net/net.go b/core/net/net.go index 2de57104..cfd78b92 100644 --- a/core/net/net.go +++ b/core/net/net.go @@ -5,12 +5,15 @@ import ( "context" "io" + "github.com/textileio/go-threads/core/did" + "github.com/ipfs/go-cid" - "github.com/ipfs/go-ipld-format" + format "github.com/ipfs/go-ipld-format" "github.com/libp2p/go-libp2p-core/host" "github.com/libp2p/go-libp2p-core/peer" ma "github.com/multiformats/go-multiaddr" "github.com/textileio/go-threads/core/thread" + "github.com/textileio/go-threads/did/registry" ) // Net wraps API with a DAGService and libp2p host. @@ -22,18 +25,22 @@ type Net interface { // Host provides a network identity. Host() host.Host + + // Registry for decentralized thread identifiers (DIDs). + Registry() *registry.Registry } // API is the network interface for thread orchestration. type API interface { io.Closer - // GetHostID returns the host's peer id. - GetHostID(ctx context.Context) (peer.ID, error) + // GetServices returns a did.Document describing the host and its services. + GetServices(ctx context.Context) (did.Document, error) - // GetToken returns a signed token representing an identity that can be used with other API methods, e.g., - // CreateThread, AddThread, etc. - GetToken(ctx context.Context, identity thread.Identity) (thread.Token, error) + // ValidateIdentity validates a self-signed DID token representing an external identity. + // The token subject must the host's DID obtained from GetDID. + // A valid token's claims are returned in the form of a did.Document. + ValidateIdentity(ctx context.Context, identity did.Token) (thread.PubKey, did.DID, error) // CreateThread creates and adds a new thread with id and opts. CreateThread(ctx context.Context, id thread.ID, opts ...NewThreadOption) (thread.Info, error) diff --git a/core/net/options.go b/core/net/options.go index 056f7bf8..3d6b6a19 100644 --- a/core/net/options.go +++ b/core/net/options.go @@ -2,6 +2,7 @@ package net import ( "github.com/libp2p/go-libp2p-core/crypto" + "github.com/textileio/go-threads/core/did" "github.com/textileio/go-threads/core/thread" ) @@ -9,7 +10,7 @@ import ( type NewThreadOptions struct { ThreadKey thread.Key LogKey crypto.Key - Token thread.Token + Token did.Token } // NewThreadOption specifies new thread options. @@ -33,7 +34,7 @@ func WithLogKey(key crypto.Key) NewThreadOption { } // WithNewThreadToken provides authorization for creating a new thread. -func WithNewThreadToken(t thread.Token) NewThreadOption { +func WithNewThreadToken(t did.Token) NewThreadOption { return func(args *NewThreadOptions) { args.Token = t } @@ -41,7 +42,7 @@ func WithNewThreadToken(t thread.Token) NewThreadOption { // ThreadOptions defines options for interacting with a thread. type ThreadOptions struct { - Token thread.Token + Token did.Token APIToken Token } @@ -49,7 +50,7 @@ type ThreadOptions struct { type ThreadOption func(*ThreadOptions) // WithThreadToken provides authorization for interacting with a thread. -func WithThreadToken(t thread.Token) ThreadOption { +func WithThreadToken(t did.Token) ThreadOption { return func(args *ThreadOptions) { args.Token = t } @@ -68,7 +69,7 @@ func WithAPIToken(t Token) ThreadOption { // SubOptions defines options for a thread subscription. type SubOptions struct { ThreadIDs thread.IDSlice - Token thread.Token + Token did.Token } // SubOption is a thread subscription option. @@ -83,7 +84,7 @@ func WithSubFilter(id thread.ID) SubOption { } // WithSubToken provides authorization for a subscription. -func WithSubToken(t thread.Token) SubOption { +func WithSubToken(t did.Token) SubOption { return func(args *SubOptions) { args.Token = t } diff --git a/core/thread/id.go b/core/thread/id.go index 2ca2b10e..961a784f 100644 --- a/core/thread/id.go +++ b/core/thread/id.go @@ -3,88 +3,113 @@ package thread import ( "crypto/rand" "encoding/binary" + "errors" "fmt" + "time" + "github.com/dgrijalva/jwt-go" + "github.com/google/uuid" "github.com/ipfs/go-cid" "github.com/libp2p/go-libp2p-core/crypto" "github.com/libp2p/go-libp2p-core/peer" - ma "github.com/multiformats/go-multiaddr" + maddr "github.com/multiformats/go-multiaddr" mbase "github.com/multiformats/go-multibase" + d "github.com/textileio/go-threads/core/did" + jwted25519 "github.com/textileio/go-threads/jwt" ) var ( - // ErrVarintBuffSmall means that a buffer passed to the ID parser was not - // long enough, or did not contain an invalid ID. - ErrVarintBuffSmall = fmt.Errorf("reading varint: buffer too small") - - // ErrVarintTooBig means that the varint in the given ID was above the - // limit of 2^64. - ErrVarintTooBig = fmt.Errorf("reading varint: varint bigger than 64bits" + - " and not supported") - - // ErrIDTooShort means that the ID passed to decode was not long - // enough to be a valid ID. - ErrIDTooShort = fmt.Errorf("id too short") + // ErrVarintBuffSmall indicates a buffer passed to the ID parser was not + // long enough, or contained an invalid ID. + ErrVarintBuffSmall = errors.New("reading varint: buffer too small") + + // ErrVarintTooBig indicates the varint in the given ID was above the limit of 2^64. + ErrVarintTooBig = errors.New("reading varint: varint bigger than 64bits and not supported") + + // ErrIDTooShort indicates the ID passed to decode was not long enough to be a valid ID. + ErrIDTooShort = errors.New("id too short") + + randomVariantSize = 20 ) -// Versions. +// Version is a type for thread versions. +type Version uint64 + const ( - V1 = 0x01 + // Version1 is the current thread ID version. + Version1 Version = 0x01 ) +func (v Version) String() string { + switch v { + case Version1: + return "1" + default: + panic(fmt.Errorf("version %d is invalid", v)) + } +} + // Variant is a type for thread variants. type Variant uint64 -// Variants. const ( - Raw Variant = 0x55 - AccessControlled Variant = 0x70 // Supports access control lists + // RandomVariant IDs are generated from random bytes. + RandomVariant Variant = 0x55 + // PubKeyVariant IDs are generated from multihash(multibase(key)) + PubKeyVariant Variant = 0x70 ) func (v Variant) String() string { switch v { - case Raw: - return "raw" - case AccessControlled: - return "access_controlled" + case RandomVariant: + return "random" + case PubKeyVariant: + return "pubkey" default: panic(fmt.Errorf("variant %d is invalid", v)) } } -// NewIDV1 returns a new random ID using the given variant. -func NewIDV1(variant Variant, size uint8) ID { - num := make([]byte, size) - _, err := rand.Read(num) +// NewRandomIDV1 returns a new random Version1 ID. +func NewRandomIDV1() ID { + p := make([]byte, randomVariantSize) + if _, err := rand.Read(p); err != nil { + panic(fmt.Errorf("random read: %v", err)) + } + return newID(Version1, RandomVariant, p) +} + +// NewPubKeyIDV1 returns a new pubkey Version1 ID. +func NewPubKeyIDV1(k PubKey) ID { + p, err := k.Hash() if err != nil { - panic("random read failed") + panic(fmt.Errorf("getting key hash: %v", err)) } + return newID(Version1, PubKeyVariant, p) +} - numlen := len(num) +func newID(version Version, variant Variant, payload []byte) ID { + l := len(payload) // two 8 bytes (max) numbers plus num - buf := make([]byte, 2*binary.MaxVarintLen64+numlen) - n := binary.PutUvarint(buf, V1) + buf := make([]byte, 2*binary.MaxVarintLen64+l) + n := binary.PutUvarint(buf, uint64(version)) n += binary.PutUvarint(buf[n:], uint64(variant)) - cn := copy(buf[n:], num) - if cn != numlen { - panic("copy length is inconsistent") + c := copy(buf[n:], payload) + if c != l { + panic(errors.New("copy length is inconsistent")) } - - return ID(buf[:n+numlen]) + return ID(buf[:n+l]) } // ID represents a self-describing thread identifier. -// It is formed by a Version, a Variant, and a random number -// of a given length. +// It is formed by a Version, a Variant, and a random number of a given length. type ID string -// Undef can be used to represent a nil or undefined Cid, using Cid{} -// directly is also acceptable. +// Undef can be used to represent a nil or undefined Cid, using Cid{} directly is also acceptable. var Undef = ID("") // Defined returns true if an ID is defined. -// Calling any other methods on an undefined ID will result in -// undefined behavior. +// Calling any other methods on an undefined ID will result in undefined behavior. func (i ID) Defined() bool { return i != Undef } @@ -110,8 +135,16 @@ func Decode(v string) (ID, error) { return Cast(data) } -// ExtractEncoding from an ID. If Decode on the same string did -// not return an error neither will this function. +// MustDecode panics if ID is not decodable. +func MustDecode(v string) ID { + id, err := Decode(v) + if err != nil { + panic(errors.New("could not decode thread id")) + } + return id +} + +// ExtractEncoding from an ID. If Decode on the same string did not return an error neither will this function. func ExtractEncoding(v string) (mbase.Encoding, error) { if len(v) < 2 { return -1, ErrIDTooShort @@ -143,21 +176,21 @@ func Cast(data []byte) (ID, error) { } // FromAddr returns ID from a multiaddress if present. -func FromAddr(addr ma.Multiaddr) (ID, error) { - idstr, err := addr.ValueForProtocol(Code) +func FromAddr(addr maddr.Multiaddr) (ID, error) { + idstr, err := addr.ValueForProtocol(ProtocolCode) if err != nil { return Undef, err } return Decode(idstr) } -// ToAddr returns ID wrapped as a multiaddress. -func ToAddr(id ID) ma.Multiaddr { - addr, err := ma.NewMultiaddr("/" + Name + "/ " + string(id)) +// FromDID returns ID from a DID. +func FromDID(did d.DID) (ID, error) { + decoded, err := did.Decode() if err != nil { - panic(err) // This should not happen + return Undef, err } - return addr + return Decode(decoded.ID) } func uvError(read int) error { @@ -177,12 +210,19 @@ func (i ID) Validate() error { return validateIDData(data) } -func getVersion(data []byte) (uint64, int, error) { +// MustValidate panics if ID is not valid. +func (i ID) MustValidate() { + if err := i.Validate(); err != nil { + panic(errors.New("invalid thread id")) + } +} + +func getVersion(data []byte) (Version, int, error) { vers, n := binary.Uvarint(data) if err := uvError(n); err != nil { return 0, 0, err } - return vers, n, nil + return Version(vers), n, nil } func validateIDData(data []byte) error { @@ -191,7 +231,7 @@ func validateIDData(data []byte) error { return err } - if vers != V1 { + if vers != Version1 { return fmt.Errorf("expected 1 as the id version number, got: %d", vers) } @@ -200,8 +240,8 @@ func validateIDData(data []byte) error { return err } - if variant != uint64(Raw) && variant != uint64(AccessControlled) { - return fmt.Errorf("expected Raw or AccessControlled as the id variant, got: %d", variant) + if variant != uint64(RandomVariant) && variant != uint64(PubKeyVariant) { + return fmt.Errorf("expected RandomVariant or PubKeyVariant as the id variant, got: %d", variant) } id := data[n+cn:] @@ -212,8 +252,7 @@ func validateIDData(data []byte) error { return nil } -// UnmarshalBinary is equivalent to Cast(). It implements the -// encoding.BinaryUnmarshaler interface. +// UnmarshalBinary is equivalent to Cast(). It implements the encoding.BinaryUnmarshaler interface. func (i *ID) UnmarshalBinary(data []byte) error { id, err := Cast(data) if err != nil { @@ -223,8 +262,7 @@ func (i *ID) UnmarshalBinary(data []byte) error { return nil } -// UnmarshalText is equivalent to Decode(). It implements the -// encoding.TextUnmarshaler interface. +// UnmarshalText is equivalent to Decode(). It implements the encoding.TextUnmarshaler interface. func (i *ID) UnmarshalText(text []byte) error { id, err := Decode(string(text)) if err != nil { @@ -235,10 +273,10 @@ func (i *ID) UnmarshalText(text []byte) error { } // Version returns the ID version. -func (i ID) Version() uint64 { +func (i ID) Version() Version { version, _, err := getVersion(i.Bytes()) if err != nil { - panic("error getting version: " + err.Error()) + panic(fmt.Errorf("getting version: %v", err)) } return version } @@ -253,70 +291,62 @@ func (i ID) Variant() Variant { // String returns the default string representation of an ID. // Currently, Base32 is used as the encoding for the multibase string. func (i ID) String() string { - if err := i.Validate(); err != nil { - panic("invalid thread id") - } + i.MustValidate() switch i.Version() { - case V1: + case Version1: b := []byte(i) mbstr, err := mbase.Encode(mbase.Base32, b) if err != nil { - panic("should not error with hardcoded mbase: " + err.Error()) + panic(fmt.Errorf("should not error with hardcoded mbase: %v", err)) } return mbstr default: - panic("unknown thread id version") + panic(errors.New("unknown thread id version")) } } -// StringOfBase returns the string representation of an ID -// encoded is selected base. +// StringOfBase returns the string representation of an ID encoded is selected base. func (i ID) StringOfBase(base mbase.Encoding) (string, error) { - if err := i.Validate(); err != nil { - panic("invalid thread id") - } + i.MustValidate() switch i.Version() { - case V1: + case Version1: return mbase.Encode(base, i.Bytes()) default: - panic("unknown thread id version") + panic(errors.New("unknown thread id version")) } } -// Encode return the string representation of an ID in a given base -// when applicable. +// Encode return the string representation of an ID in a given base when applicable. func (i ID) Encode(base mbase.Encoder) string { - if err := i.Validate(); err != nil { - panic("invalid thread id") - } + i.MustValidate() switch i.Version() { - case V1: + case Version1: return base.Encode(i.Bytes()) default: - panic("unknown thread id version") + panic(errors.New("unknown thread id version")) } } +// DID returns a decentralized identifier in the form of did:thread:string(id). +func (i ID) DID() d.DID { + return d.DID("did:thread:" + i.String()) +} + // Bytes returns the byte representation of an ID. -// The output of bytes can be parsed back into an ID -// with Cast(). +// The output of bytes can be parsed back into an ID with Cast(). func (i ID) Bytes() []byte { return []byte(i) } -// MarshalBinary is equivalent to Bytes(). It implements the -// encoding.BinaryMarshaler interface. +// MarshalBinary is equivalent to Bytes(). It implements the encoding.BinaryMarshaler interface. func (i ID) MarshalBinary() ([]byte, error) { return i.Bytes(), nil } -// MarshalText is equivalent to String(). It implements the -// encoding.TextMarshaler interface. +// MarshalText is equivalent to String(). It implements the encoding.TextMarshaler interface. func (i ID) MarshalText() ([]byte, error) { - if err := i.Validate(); err != nil { - panic("invalid thread id") - } + i.MustValidate() return []byte(i.String()), nil } @@ -331,7 +361,7 @@ func (i ID) KeyString() string { } // Loggable returns a Loggable (as defined by -// https://godoc.org/github.com/ipfs/go-log). +// https://godoc.org/github.com/ipfs/go-log/v2). func (i ID) Loggable() map[string]interface{} { return map[string]interface{}{ "id": i, @@ -347,10 +377,84 @@ func (s IDSlice) Less(i, j int) bool { return s[i] < s[j] } // Info holds thread logs, keys and addresses. type Info struct { - ID ID - Key Key - Logs []LogInfo - Addrs []ma.Multiaddr + // ID is the thread's unique identifier. + ID ID + // Key wraps the thread's encryption keys. + Key Key + // Logs are the thread's currently known single-writer logs. + Logs []LogInfo + // Addrs are full addresses where the thread can be found without interacting with the peer DHT, e.g., + // /ip4//tcp//p2p//thread/ + // /dnsaddr//p2p//thread/ + Addrs []maddr.Multiaddr +} + +// Token returns a JWT-encoded verifiable claim representing thread info. +func (i Info) Token(issuer Identity, aud d.DID, dur time.Duration) (d.Token, error) { + id := i.ID.DID() + iss, err := issuer.GetPublic().DID() + if err != nil { + return "", err + } + services := make([]d.Service, len(i.Addrs)) + for i, a := range i.Addrs { + p, err := a.ValueForProtocol(maddr.P_P2P) + if err != nil { + return "", err + } + services[i] = d.Service{ + ID: d.DID(string(id) + "#" + p), + Type: "ThreadService", + ServiceEndpoint: a.String(), + ServiceProtocol: string(Protocol), + } + } + claims := IdentityClaims{ + StandardClaims: jwt.StandardClaims{ + Id: uuid.New().URN(), + Subject: string(id), + Issuer: string(iss), + Audience: string(aud), + ExpiresAt: time.Now().Add(dur).Unix(), + IssuedAt: time.Now().Unix(), + NotBefore: time.Now().Unix(), + }, + VerifiableCredential: d.VerifiableCredential{ + Context: []string{ + "https://www.w3.org/2018/credentials/v1", + }, + Type: []string{ + "VerifiableCredential", + }, + CredentialSubject: d.VerifiableCredentialSubject{ + ID: id, + Document: d.Document{ + Context: []string{ + "https://www.w3.org/ns/did/v1", + }, + ID: id, + Conroller: []d.DID{ + iss, + }, + Authentication: []d.VerificationMethod{ + { + ID: iss + "#keys-1", + Type: "Ed25519VerificationKey2018", + Controller: iss, + PublicKeyMultiBase: issuer.GetPublic().String(), + }, + }, + Services: services, + }, + }, + }, + } + t, err := jwt.NewWithClaims(jwted25519.SigningMethodEd25519i, claims). + SignedString(issuer.(*Libp2pIdentity).PrivKey) + if err != nil { + return "", err + } + return d.Token(t), nil } // GetFirstPrivKeyLog returns the first log found with a private key. @@ -373,8 +477,10 @@ type LogInfo struct { PubKey crypto.PubKey // PrivKey is the log's private key. PrivKey crypto.PrivKey - // Addrs are the addresses associated with the given log. - Addrs []ma.Multiaddr + // Addrs are the peer addresses associated with the given log, e.g., + // /p2p/ + // /p2p/ + Addrs []maddr.Multiaddr // Head is the log's current head. Head cid.Cid // Managed logs are any logs directly added/created by the host, and/or logs for which we have the private key diff --git a/core/thread/id_test.go b/core/thread/id_test.go index 235a22df..6a1fbb68 100644 --- a/core/thread/id_test.go +++ b/core/thread/id_test.go @@ -2,117 +2,126 @@ package thread import ( "crypto/rand" - "encoding/binary" + "fmt" "testing" mbase "github.com/multiformats/go-multibase" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) -func TestCast(t *testing.T) { - i := NewIDV1(Raw, 32) - j, err := Cast(i.Bytes()) - if err != nil { - t.Errorf("failed to cast ID %s: %s", i.String(), err) - } - if i != j { - t.Errorf("id %v not equal to id %v", i.String(), j.String()) - } +func TestNewRandomIDV1(t *testing.T) { + } -func TestDecode(t *testing.T) { - i := NewIDV1(Raw, 32) - t.Logf("New ID: %s", i.String()) +func TestNewPubKeyIDV1(t *testing.T) { - j, err := Decode(i.String()) - if err != nil { - t.Errorf("failed to decode ID %s: %s", i.String(), err) - } +} - t.Logf("Decoded ID: %s", j.String()) +func TestDecode(t *testing.T) { + id := NewRandomIDV1() + decoded, err := Decode(id.String()) + require.NoError(t, err) + assert.True(t, decoded.Equals(id)) } func TestExtractEncoding(t *testing.T) { - i := NewIDV1(Raw, 16) + e, err := ExtractEncoding(NewRandomIDV1().String()) + require.NoError(t, err) + assert.Equal(t, mbase.Base32, int32(e)) +} - e, err := ExtractEncoding(i.String()) - if err != nil { - t.Errorf("failed to extract encoding from %s: %s", i.String(), err) - } +func TestCast(t *testing.T) { + id := NewRandomIDV1() + casted, err := Cast(id.Bytes()) + require.NoError(t, err) + assert.True(t, casted.Equals(id)) +} + +func TestFromAddr(t *testing.T) { - t.Logf("Encoding: %s", mbase.EncodingToStr[e]) } -func TestID_Version(t *testing.T) { - i := NewIDV1(Raw, 16) +func TestToAddr(t *testing.T) { + +} + +func TestID_Defined(t *testing.T) { + +} + +func TestID_Validate(t *testing.T) { + require.NoError(t, NewRandomIDV1().Validate()) + require.NoError(t, NewPubKeyIDV1(makeLibp2pIdentity(t).GetPublic()).Validate()) + require.Error(t, newID(Version(5), RandomVariant, randBytes(t, 16)).Validate()) + require.Error(t, newID(Version1, Variant(50), randBytes(t, 16)).Validate()) + require.Error(t, newID(Version1, RandomVariant, randBytes(t, 0)).Validate()) +} + +func TestID_UnmarshalBinary(t *testing.T) { + +} - v := i.Version() - if v != V1 { - t.Errorf("got wrong version from %s: %d", i.String(), v) - } +func TestID_UnmarshalText(t *testing.T) { - t.Logf("Version: %d", v) +} + +func TestID_Version(t *testing.T) { + assert.Equal(t, Version1, NewRandomIDV1().Version()) + assert.Equal(t, Version1, NewPubKeyIDV1(makeLibp2pIdentity(t).GetPublic()).Version()) } func TestID_Variant(t *testing.T) { - i := NewIDV1(Raw, 16) + assert.Equal(t, RandomVariant, NewRandomIDV1().Variant()) + assert.Equal(t, PubKeyVariant, NewPubKeyIDV1(makeLibp2pIdentity(t).GetPublic()).Variant()) +} - v := i.Variant() - if v != Raw { - t.Errorf("got wrong variant from %s: %d", i.String(), v) - } +func TestID_String(t *testing.T) { - t.Logf("Variant: %s", v) +} - i = NewIDV1(AccessControlled, 32) +func TestID_StringOfBase(t *testing.T) { - v = i.Variant() - if v != AccessControlled { - t.Errorf("got wrong variant from %s: %d", i.String(), v) - } +} - t.Logf("Variant: %s", v) +func TestID_DID(t *testing.T) { + fmt.Println(NewRandomIDV1().DID()) + fmt.Println(NewPubKeyIDV1(makeLibp2pIdentity(t).GetPublic()).DID()) + assert.NotEmpty(t, NewRandomIDV1().DID()) + assert.NotEmpty(t, NewPubKeyIDV1(makeLibp2pIdentity(t).GetPublic()).DID()) } -func TestID_Valid(t *testing.T) { - i := NewIDV1(Raw, 16) - if err := i.Validate(); err != nil { - t.Errorf("id %s is invalid", i.String()) - } +func TestID_Encode(t *testing.T) { + } -func TestID_Invalid(t *testing.T) { - i := makeID(t, 5, int64(Raw), 16) - if err := i.Validate(); err == nil { - t.Errorf("id %s is valid but it has an invalid version", i.String()) - } +func TestID_Bytes(t *testing.T) { - i = makeID(t, V1, 50, 16) - if err := i.Validate(); err == nil { - t.Errorf("id %s is valid but it has an invalid variant", i.String()) - } +} + +func TestID_MarshalBinary(t *testing.T) { - i = makeID(t, V1, int64(Raw), 0) - if err := i.Validate(); err == nil { - t.Errorf("id %s is valid but it has no random bytes", i.String()) - } } -func makeID(t *testing.T, version uint64, variant int64, size uint8) ID { - num := make([]byte, size) - _, err := rand.Read(num) - if err != nil { - t.Errorf("failed to generate random data: %v", err) - } +func TestID_MarshalText(t *testing.T) { - numlen := len(num) - // two 8 bytes (max) numbers plus num - buf := make([]byte, 2*binary.MaxVarintLen64+numlen) - n := binary.PutUvarint(buf, version) - n += binary.PutUvarint(buf[n:], uint64(variant)) - cn := copy(buf[n:], num) - if cn != numlen { - t.Errorf("copy length is inconsistent") - } +} + +func TestID_Equals(t *testing.T) { + +} + +func TestID_KeyString(t *testing.T) { + +} + +func TestID_Loggable(t *testing.T) { + +} - return ID(buf[:n+numlen]) +func randBytes(t *testing.T, size uint8) []byte { + bytes := make([]byte, size) + _, err := rand.Read(bytes) + require.NoError(t, err) + return bytes } diff --git a/core/thread/identity.go b/core/thread/identity.go index a9b78266..4a48777c 100644 --- a/core/thread/identity.go +++ b/core/thread/identity.go @@ -3,19 +3,19 @@ package thread import ( "context" "encoding" + "errors" "fmt" - "log" - "strings" "time" "github.com/dgrijalva/jwt-go" - "github.com/gogo/status" - "github.com/grpc-ecosystem/go-grpc-middleware/util/metautils" + "github.com/google/uuid" "github.com/libp2p/go-libp2p-core/crypto" + "github.com/libp2p/go-libp2p-core/peer" mbase "github.com/multiformats/go-multibase" + mhash "github.com/multiformats/go-multihash" + "github.com/textileio/go-threads/core/did" "github.com/textileio/go-threads/crypto/asymmetric" jwted25519 "github.com/textileio/go-threads/jwt" - "google.golang.org/grpc/codes" ) // Identity represents an entity capable of signing a message @@ -26,16 +26,28 @@ type Identity interface { encoding.BinaryMarshaler encoding.BinaryUnmarshaler + // Stringer encodes the private key into a base32 string. + fmt.Stringer + // UnmarshalString decodes the private key from a base32 string. + UnmarshalString(string) error // Sign the given bytes cryptographically. Sign(context.Context, []byte) ([]byte, error) // GetPublic returns the public key paired with this identity. GetPublic() PubKey // Decrypt returns decrypted data. Decrypt(context.Context, []byte) ([]byte, error) + // Token returns a JWT-encoded verifiable claim to identity. + Token(aud did.DID, dur time.Duration) (did.Token, error) // Equals returns true if the identities are equal. Equals(Identity) bool } +// IdentityClaims defines a verifiable claim to an identity. +type IdentityClaims struct { + jwt.StandardClaims + VerifiableCredential did.VerifiableCredential `json:"vc"` +} + // Libp2pIdentity wraps crypto.PrivKey, overwriting GetPublic with thread.PubKey. type Libp2pIdentity struct { crypto.PrivKey @@ -46,48 +58,117 @@ func NewLibp2pIdentity(key crypto.PrivKey) Identity { return &Libp2pIdentity{PrivKey: key} } -func (p *Libp2pIdentity) MarshalBinary() ([]byte, error) { - return crypto.MarshalPrivateKey(p.PrivKey) +func (i *Libp2pIdentity) MarshalBinary() ([]byte, error) { + return crypto.MarshalPrivateKey(i.PrivKey) +} + +func (i *Libp2pIdentity) UnmarshalBinary(bytes []byte) (err error) { + i.PrivKey, err = crypto.UnmarshalPrivateKey(bytes) + if err != nil { + return err + } + return err } -func (p *Libp2pIdentity) UnmarshalBinary(bytes []byte) (err error) { - p.PrivKey, err = crypto.UnmarshalPrivateKey(bytes) +func (i *Libp2pIdentity) String() string { + bytes, err := crypto.MarshalPrivateKey(i.PrivKey) + if err != nil { + panic(fmt.Errorf("marshal privkey: %v", err)) + } + str, err := mbase.Encode(mbase.Base32, bytes) + if err != nil { + panic(fmt.Errorf("multibase encoding privkey: %v", err)) + } + return str +} + +func (i *Libp2pIdentity) UnmarshalString(str string) error { + _, bytes, err := mbase.Decode(str) if err != nil { return err } + i.PrivKey, err = crypto.UnmarshalPrivateKey(bytes) return err } -func (p *Libp2pIdentity) Sign(_ context.Context, msg []byte) ([]byte, error) { - return p.PrivKey.Sign(msg) +func (i *Libp2pIdentity) Sign(_ context.Context, msg []byte) ([]byte, error) { + return i.PrivKey.Sign(msg) } -func (p *Libp2pIdentity) GetPublic() PubKey { - return NewLibp2pPubKey(p.PrivKey.GetPublic()) +func (i *Libp2pIdentity) GetPublic() PubKey { + return NewLibp2pPubKey(i.PrivKey.GetPublic()) } -func (p *Libp2pIdentity) Decrypt(_ context.Context, data []byte) ([]byte, error) { - dk, err := asymmetric.FromPrivKey(p.PrivKey) +func (i *Libp2pIdentity) Decrypt(_ context.Context, data []byte) ([]byte, error) { + dk, err := asymmetric.FromPrivKey(i.PrivKey) if err != nil { return nil, err } return dk.Decrypt(data) } -func (p *Libp2pIdentity) Equals(i Identity) bool { - li, ok := i.(*Libp2pIdentity) +func (i *Libp2pIdentity) Token(aud did.DID, dur time.Duration) (did.Token, error) { + id, err := i.GetPublic().DID() + if err != nil { + return "", err + } + claims := IdentityClaims{ + StandardClaims: jwt.StandardClaims{ + Id: uuid.New().URN(), + Subject: string(id), + Issuer: string(id), + Audience: string(aud), + ExpiresAt: time.Now().Add(dur).Unix(), + IssuedAt: time.Now().Unix(), + NotBefore: time.Now().Unix(), + }, + VerifiableCredential: did.VerifiableCredential{ + Context: []string{ + "https://www.w3.org/2018/credentials/v1", + }, + Type: []string{ + "VerifiableCredential", + }, + CredentialSubject: did.VerifiableCredentialSubject{ + ID: id, + Document: did.Document{ + Context: []string{ + "https://www.w3.org/ns/did/v1", + }, + ID: id, + Authentication: []did.VerificationMethod{ + { + ID: id + "#keys-1", + Type: "Ed25519VerificationKey2018", + Controller: id, + PublicKeyMultiBase: i.GetPublic().String(), + }, + }, + }, + }, + }, + } + t, err := jwt.NewWithClaims(jwted25519.SigningMethodEd25519i, claims).SignedString(i.PrivKey) + if err != nil { + return "", err + } + return did.Token(t), nil +} + +func (i *Libp2pIdentity) Equals(id Identity) bool { + i2, ok := id.(*Libp2pIdentity) if !ok { return false } - return p.PrivKey.Equals(li.PrivKey) + return i.PrivKey.Equals(i2.PrivKey) } -// Pubkey can be anything that provides a verify method. +// PubKey can be anything that provides a verify method. type PubKey interface { encoding.BinaryMarshaler encoding.BinaryUnmarshaler - // String encodes the public key into a base32 string. + // Stringer encodes the public key into a base32 string. fmt.Stringer // UnmarshalString decodes the public key from a base32 string. UnmarshalString(string) error @@ -95,6 +176,12 @@ type PubKey interface { Verify(data []byte, sig []byte) (bool, error) // Encrypt data with the public key. Encrypt([]byte) ([]byte, error) + // Hash returns a multihash of the key. + Hash() ([]byte, error) + // DID returns a decentralized identifier in the form of did:key:multibase(key). + DID() (did.DID, error) + // Validate parses and validates an identity token and returns the associated key. + Validate(identity did.Token) (PubKey, did.Document, error) // Equals returns true if the keys are equal. Equals(PubKey) bool } @@ -109,192 +196,119 @@ func NewLibp2pPubKey(key crypto.PubKey) PubKey { return &Libp2pPubKey{PubKey: key} } -func (p *Libp2pPubKey) MarshalBinary() ([]byte, error) { - return crypto.MarshalPublicKey(p.PubKey) +func (k *Libp2pPubKey) MarshalBinary() ([]byte, error) { + return crypto.MarshalPublicKey(k.PubKey) } -func (p *Libp2pPubKey) UnmarshalBinary(bytes []byte) (err error) { - p.PubKey, err = crypto.UnmarshalPublicKey(bytes) +func (k *Libp2pPubKey) UnmarshalBinary(bytes []byte) (err error) { + k.PubKey, err = crypto.UnmarshalPublicKey(bytes) if err != nil { return err } return err } -func (p *Libp2pPubKey) String() string { - bytes, err := crypto.MarshalPublicKey(p.PubKey) +func (k *Libp2pPubKey) String() string { + bytes, err := crypto.MarshalPublicKey(k.PubKey) if err != nil { - panic(err) + panic(fmt.Errorf("marshal pubkey: %v", err)) } str, err := mbase.Encode(mbase.Base32, bytes) if err != nil { - panic(err) + panic(fmt.Errorf("multibase encoding pubkey: %v", err)) } return str } -func (p *Libp2pPubKey) UnmarshalString(str string) error { +func (k *Libp2pPubKey) UnmarshalString(str string) error { _, bytes, err := mbase.Decode(str) if err != nil { return err } - p.PubKey, err = crypto.UnmarshalPublicKey(bytes) + k.PubKey, err = crypto.UnmarshalPublicKey(bytes) return err } -func (p *Libp2pPubKey) Encrypt(data []byte) ([]byte, error) { - ek, err := asymmetric.FromPubKey(p.PubKey) +func (k *Libp2pPubKey) Encrypt(data []byte) ([]byte, error) { + ek, err := asymmetric.FromPubKey(k.PubKey) if err != nil { return nil, err } return ek.Encrypt(data) } -func (p *Libp2pPubKey) Equals(k PubKey) bool { - lk, ok := k.(*Libp2pPubKey) - if !ok { - return false - } - return p.PubKey.Equals(lk.PubKey) -} - -// Token is a concrete type for a JWT token string, which provides -// a claim to an identity. -type Token string - -// ErrTokenNotFound indicates the token was not found in the context. -var ErrTokenNotFound = fmt.Errorf("thread token not found") - -// ErrInvalidToken indicates the token is invalid. -var ErrInvalidToken = fmt.Errorf("invalid thread token") - -// NewToken issues a new JWT token from issuer for the given pubic key. -func NewToken(issuer crypto.PrivKey, key PubKey) (tok Token, err error) { - var ok bool - issuer, ok = issuer.(*crypto.Ed25519PrivateKey) - if !ok { - log.Fatal("issuer must be an Ed25519PrivateKey") - } - claims := jwt.StandardClaims{ - Subject: key.String(), - Issuer: NewLibp2pIdentity(issuer).GetPublic().String(), - IssuedAt: time.Now().Unix(), - } - str, err := jwt.NewWithClaims(jwted25519.SigningMethodEd25519i, claims).SignedString(issuer) +func (k *Libp2pPubKey) Hash() ([]byte, error) { + bytes, err := k.MarshalBinary() if err != nil { - return - } - return Token(str), nil -} - -// PubKey returns the public key encoded in the token. -// Note: This does NOT verify the token. -func (t Token) PubKey() (PubKey, error) { - if t == "" { - return nil, nil + return nil, err } - var claims jwt.StandardClaims - tok, _, err := new(jwt.Parser).ParseUnverified(string(t), &claims) + hash, err := mhash.Encode(bytes, mhash.SHA3_256) if err != nil { - if tok == nil { - return nil, ErrTokenNotFound - } else { - return nil, ErrInvalidToken - } - } - key := &Libp2pPubKey{} - if err = key.UnmarshalString(claims.Subject); err != nil { return nil, err } - return key, nil + if len(hash) > 20 { + hash = hash[len(hash)-20:] + } + return hash, nil } -// Validate token against an issuer. -// If token is present and was issued by issuer (is valid), the embedded public key is returned. -// If token is not present, both the returned public key and error will be nil. -func (t Token) Validate(issuer crypto.PrivKey) (PubKey, error) { - if issuer == nil { - return nil, fmt.Errorf("cannot validate with nil issuer") - } - var ok bool - issuer, ok = issuer.(*crypto.Ed25519PrivateKey) - if !ok { - log.Fatal("issuer must be an Ed25519PrivateKey") - } - if t == "" { - return nil, nil - } - keyfunc := func(*jwt.Token) (interface{}, error) { - return issuer.GetPublic(), nil - } - var claims jwt.StandardClaims - tok, err := jwt.ParseWithClaims(string(t), &claims, keyfunc) +func (k *Libp2pPubKey) DID() (did.DID, error) { + id, err := peer.IDFromPublicKey(k.PubKey) if err != nil { - if tok == nil { - return nil, ErrTokenNotFound - } else { - return nil, ErrInvalidToken - } - } - key := &Libp2pPubKey{} - if err = key.UnmarshalString(claims.Subject); err != nil { - return nil, err + return "", err } - return key, nil + return did.NewKeyDID(id.String()), nil } -// Defined returns true if token is not empty. -func (t Token) Defined() bool { - return t != "" +func (k *Libp2pPubKey) Validate(identity did.Token) (PubKey, did.Document, error) { + return Validate(identity, k) } -// NewTokenFromMD returns Token from the given context, if present. -func NewTokenFromMD(ctx context.Context) (tok Token, err error) { - val := metautils.ExtractIncoming(ctx).Get("authorization") - if val == "" { - return - } - parts := strings.SplitN(val, " ", 2) - if len(parts) < 2 { - return "", status.Error(codes.Unauthenticated, "Bad authorization string") - } - if !strings.EqualFold(parts[0], "bearer") { - return "", status.Errorf(codes.Unauthenticated, "Request unauthenticated with bearer") +func (k *Libp2pPubKey) Equals(pk PubKey) bool { + k2, ok := pk.(*Libp2pPubKey) + if !ok { + return false } - return Token(parts[1]), nil + return k.PubKey.Equals(k2.PubKey) } -type ctxKey string - -// NewTokenContext adds Token to a context. -func NewTokenContext(ctx context.Context, token Token) context.Context { - if token == "" { - return ctx +// Validate parses and validates an identity token and returns the associated key. +func Validate(identity did.Token, aud *Libp2pPubKey) (PubKey, did.Document, error) { + var ( + doc did.Document + claims IdentityClaims + ) + _, _, err := new(jwt.Parser).ParseUnverified(string(identity), &claims) + if err != nil { + return nil, doc, fmt.Errorf("parsing token: %v", err) } - return context.WithValue(ctx, ctxKey("token"), token) -} - -// TokenFromContext returns Token from a context. -func TokenFromContext(ctx context.Context) (Token, bool) { - token, ok := ctx.Value(ctxKey("token")).(Token) - return token, ok -} + doc = claims.VerifiableCredential.CredentialSubject.Document -// Credentials implements PerRPCCredentials, allowing context values -// to be included in request metadata. -type Credentials struct { - Secure bool -} + // todo: check jti is uuid urn + // todo: parse issuer, subject, audience as dids + // todo: check issuer is subject + // todo: check audience is this + // todo: check credential subject id is sub + // todo: check document id is credential subject id -func (c Credentials) GetRequestMetadata(ctx context.Context, _ ...string) (map[string]string, error) { - md := map[string]string{} - token, ok := TokenFromContext(ctx) - if ok { - md["authorization"] = "bearer " + string(token) + key := &Libp2pPubKey{} + keyfunc := func(*jwt.Token) (interface{}, error) { + if len(doc.Authentication) == 0 { + return nil, errors.New("authentication not found") + } + // todo: get auth method that matches kid? + _, bytes, err := mbase.Decode(doc.Authentication[0].PublicKeyMultiBase) + if err != nil { + return nil, fmt.Errorf("decoding key: %v", err) + } + if err := key.UnmarshalBinary(bytes); err != nil { + return nil, fmt.Errorf("unmarshalling key: %v", err) + } + // todo: ckeck that key.DID() equals subject + return key.PubKey, nil } - return md, nil -} - -func (c Credentials) RequireTransportSecurity() bool { - return c.Secure + if _, err := jwt.Parse(string(identity), keyfunc); err != nil { + return nil, doc, fmt.Errorf("parsing token: %v", err) + } + return key, doc, nil } diff --git a/core/thread/identity_test.go b/core/thread/identity_test.go new file mode 100644 index 00000000..cd1cb317 --- /dev/null +++ b/core/thread/identity_test.go @@ -0,0 +1,105 @@ +package thread + +import ( + "crypto/rand" + "testing" + "time" + + "github.com/libp2p/go-libp2p-core/crypto" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestNewLibp2pIdentity(t *testing.T) { + +} + +func TestLibp2pIdentity_MarshalBinary(t *testing.T) { + +} + +func TestLibp2pIdentity_UnmarshalBinary(t *testing.T) { + +} + +func TestLibp2pIdentity_Sign(t *testing.T) { + +} + +func TestLibp2pIdentity_GetPublic(t *testing.T) { + +} + +func TestLibp2pIdentity_Decrypt(t *testing.T) { + +} + +func TestLibp2pIdentity_Token(t *testing.T) { + aud, err := makeLibp2pIdentity(t).GetPublic().DID() + require.NoError(t, err) + tk, err := makeLibp2pIdentity(t).Token(aud, time.Minute) + require.NoError(t, err) + assert.NotEmpty(t, tk) +} + +func TestLibp2pPubKey_Validate(t *testing.T) { + i1 := makeLibp2pIdentity(t).GetPublic() // The key receiving the token, i.e., the audience + aud, err := i1.DID() + require.NoError(t, err) + i2 := makeLibp2pIdentity(t) // The identity that will be validated by the audience + tk, err := i2.Token(aud, time.Minute) + require.NoError(t, err) + k, doc, err := i1.Validate(tk) + require.NoError(t, err) + assert.True(t, k.Equals(i2.GetPublic())) + assert.NotEmpty(t, doc) +} + +func TestLibp2pIdentity_Equals(t *testing.T) { + +} + +func TestNewLibp2pPubKey(t *testing.T) { + +} + +func TestLibp2pPubKey_MarshalBinary(t *testing.T) { + +} + +func TestLibp2pPubKey_UnmarshalBinary(t *testing.T) { + +} + +func TestLibp2pPubKey_String(t *testing.T) { + +} + +func TestLibp2pPubKey_UnmarshalString(t *testing.T) { + +} + +func TestLibp2pPubKey_Encrypt(t *testing.T) { + +} + +func TestLibp2pPubKey_Hash(t *testing.T) { + +} + +func TestLibp2pPubKey_DID(t *testing.T) { + i := makeLibp2pIdentity(t) + id, err := i.GetPublic().DID() + require.NoError(t, err) + assert.NotEmpty(t, id) +} + +func TestLibp2pPubKey_Equals(t *testing.T) { + +} + +func makeLibp2pIdentity(t *testing.T) Identity { + sk, _, err := crypto.GenerateEd25519Key(rand.Reader) + require.NoError(t, err) + return NewLibp2pIdentity(sk) +} diff --git a/core/thread/key.go b/core/thread/key.go index eb96d26e..84150e09 100644 --- a/core/thread/key.go +++ b/core/thread/key.go @@ -1,7 +1,7 @@ package thread import ( - "fmt" + "errors" mbase "github.com/multiformats/go-multibase" sym "github.com/textileio/go-threads/crypto/symmetric" @@ -9,7 +9,7 @@ import ( var ( // ErrInvalidKey indicates an invalid byte slice was given to KeyFromBytes. - ErrInvalidKey = fmt.Errorf("invalid key") + ErrInvalidKey = errors.New("invalid key") ) // Key is a thread encryption key with two components. diff --git a/core/thread/protocol.go b/core/thread/protocol.go index 6ec5006c..807e3973 100644 --- a/core/thread/protocol.go +++ b/core/thread/protocol.go @@ -9,20 +9,20 @@ import ( ) const ( - // Name is the protocol slug. - Name = "thread" - // Code is the protocol code. - Code = 406 - // Version is the current protocol version. - Version = "0.0.1" + // ProtocolName is the protocol slug. + ProtocolName = "thread" + // ProtocolCode is the protocol code. + ProtocolCode = 406 + // ProtocolVersion is the current protocol version. + ProtocolVersion = "0.0.1" // Protocol is the threads protocol tag. - Protocol protocol.ID = "/" + Name + "/" + Version + Protocol protocol.ID = "/" + ProtocolName + "/" + ProtocolVersion ) var addrProtocol = ma.Protocol{ - Name: Name, - Code: Code, - VCode: ma.CodeToVarint(Code), + Name: ProtocolName, + Code: ProtocolCode, + VCode: ma.CodeToVarint(ProtocolCode), Size: ma.LengthPrefixedVarSize, Transcoder: ma.NewTranscoderFromFunctions(threadStB, threadBtS, threadVal), } diff --git a/db/bench_test.go b/db/bench_test.go index 0ba9f85f..f19de2ea 100644 --- a/db/bench_test.go +++ b/db/bench_test.go @@ -10,6 +10,7 @@ import ( "github.com/textileio/go-threads/common" "github.com/textileio/go-threads/core/thread" + dutil "github.com/textileio/go-threads/db/util" "github.com/textileio/go-threads/util" "github.com/tidwall/sjson" ) @@ -66,9 +67,9 @@ func createBenchDB(b *testing.B, opts ...NewOption) (*DB, func()) { common.WithNetDebug(true), ) checkBenchErr(b, err) - store, err := util.NewBadgerDatastore(dir, "eventstore", false) + store, err := util.NewBadgerDatastore(dir, "eventstore") checkBenchErr(b, err) - d, err := NewDB(context.Background(), store, n, thread.NewIDV1(thread.Raw, 32), opts...) + d, err := NewDB(context.Background(), store, n, thread.NewRandomIDV1(), opts...) checkBenchErr(b, err) return d, func() { if err := n.Close(); err != nil { @@ -84,7 +85,7 @@ func createBenchDB(b *testing.B, opts ...NewOption) (*DB, func()) { func BenchmarkNoIndexCreate(b *testing.B) { db, clean := createBenchDB(b) defer clean() - collection, err := db.NewCollection(CollectionConfig{Name: "Dog", Schema: util.SchemaFromSchemaString(testBenchSchema)}) + collection, err := db.NewCollection(CollectionConfig{Name: "Dog", Schema: dutil.SchemaFromSchemaString(testBenchSchema)}) checkBenchErr(b, err) b.ResetTimer() @@ -103,7 +104,7 @@ func BenchmarkIndexCreate(b *testing.B) { defer clean() collection, err := db.NewCollection(CollectionConfig{ Name: "Dog", - Schema: util.SchemaFromSchemaString(testBenchSchema), + Schema: dutil.SchemaFromSchemaString(testBenchSchema), Indexes: []Index{{ Path: "Name", Unique: false, @@ -125,7 +126,7 @@ func BenchmarkIndexCreate(b *testing.B) { func BenchmarkNoIndexSave(b *testing.B) { db, clean := createBenchDB(b) defer clean() - collection, err := db.NewCollection(CollectionConfig{Name: "Dog", Schema: util.SchemaFromSchemaString(testBenchSchema)}) + collection, err := db.NewCollection(CollectionConfig{Name: "Dog", Schema: dutil.SchemaFromSchemaString(testBenchSchema)}) checkBenchErr(b, err) var benchItem = []byte(`{"_id": "", "Name": "Lucas", "Age": 7}`) @@ -155,7 +156,7 @@ func BenchmarkIndexSave(b *testing.B) { defer clean() collection, err := db.NewCollection(CollectionConfig{ Name: "Dog", - Schema: util.SchemaFromSchemaString(testBenchSchema), + Schema: dutil.SchemaFromSchemaString(testBenchSchema), Indexes: []Index{{ Path: "Age", Unique: false, @@ -188,7 +189,7 @@ func BenchmarkIndexSave(b *testing.B) { func BenchmarkNoIndexFind(b *testing.B) { db, clean := createBenchDB(b) defer clean() - collection, err := db.NewCollection(CollectionConfig{Name: "Dog", Schema: util.SchemaFromSchemaString(testBenchSchema)}) + collection, err := db.NewCollection(CollectionConfig{Name: "Dog", Schema: dutil.SchemaFromSchemaString(testBenchSchema)}) checkBenchErr(b, err) for j := 0; j < 10; j++ { @@ -223,7 +224,7 @@ func BenchmarkIndexFind(b *testing.B) { defer clean() collection, err := db.NewCollection(CollectionConfig{ Name: "Dog", - Schema: util.SchemaFromSchemaString(testBenchSchema), + Schema: dutil.SchemaFromSchemaString(testBenchSchema), Indexes: []Index{{ Path: "Name", Unique: false, diff --git a/db/collection.go b/db/collection.go index 3b5b67a7..507e8645 100644 --- a/db/collection.go +++ b/db/collection.go @@ -18,7 +18,7 @@ import ( format "github.com/ipfs/go-ipld-format" "github.com/textileio/go-threads/core/app" core "github.com/textileio/go-threads/core/db" - "github.com/textileio/go-threads/core/thread" + "github.com/textileio/go-threads/core/did" "github.com/xeipuuv/gojsonschema" ) @@ -310,7 +310,7 @@ func (c *Collection) validInstance(v []byte) error { } // validWrite validates new events against the identity and user-defined write validator function. -func (c *Collection) validWrite(identity thread.PubKey, e core.Event) error { +func (c *Collection) validWrite(identity did.DID, e core.Event) error { c.Lock() defer c.Unlock() if c.writeValidator == nil { @@ -358,7 +358,7 @@ func (c *Collection) validWrite(identity thread.PubKey, e core.Event) error { } // filterRead filters an instance against the identity and user-defined read filter function. -func (c *Collection) filterRead(identity thread.PubKey, instance []byte) ([]byte, error) { +func (c *Collection) filterRead(identity did.DID, instance []byte) ([]byte, error) { c.Lock() defer c.Unlock() if c.readFilter == nil { @@ -389,7 +389,7 @@ func (c *Collection) filterRead(identity thread.PubKey, instance []byte) ([]byte // serializable isolation level within the db. type Txn struct { collection *Collection - token thread.Token + token did.Token discarded bool committed bool readonly bool @@ -449,7 +449,7 @@ func (t *Txn) Create(new ...[]byte) ([]core.InstanceID, error) { // Verify verifies updated instances but does not save them. func (t *Txn) Verify(updated ...[]byte) error { - identity, err := t.token.PubKey() + _, identity, err := t.collection.db.connector.ValidateIdentity(t.token) if err != nil { return err } @@ -473,9 +473,9 @@ func (t *Txn) Verify(updated ...[]byte) error { return nil } -// Save saves an instance changes to be committed when the current transaction commits. +// Save saves instance changes to be committed when the current transaction commits. func (t *Txn) Save(updated ...[]byte) error { - identity, err := t.token.PubKey() + _, identity, err := t.collection.db.connector.ValidateIdentity(t.token) if err != nil { return err } @@ -488,7 +488,7 @@ func (t *Txn) Save(updated ...[]byte) error { return nil } -func (t *Txn) createSaveActions(identity thread.PubKey, updated ...[]byte) ([]core.Action, error) { +func (t *Txn) createSaveActions(identity did.DID, updated ...[]byte) ([]core.Action, error) { var actions []core.Action for i := range updated { if t.readonly { @@ -566,10 +566,7 @@ func (t *Txn) Delete(ids ...core.InstanceID) error { // Has returns true if all IDs exists in the collection, false otherwise. func (t *Txn) Has(ids ...core.InstanceID) (bool, error) { - if err := t.collection.db.connector.Validate(t.token, true); err != nil { - return false, err - } - pk, err := t.token.PubKey() + _, identity, err := t.collection.db.connector.ValidateIdentity(t.token) if err != nil { return false, err } @@ -587,7 +584,7 @@ func (t *Txn) Has(ids ...core.InstanceID) (bool, error) { if err != nil { return false, err } - bytes, err = t.collection.filterRead(pk, bytes) + bytes, err = t.collection.filterRead(identity, bytes) if err != nil { return false, err } @@ -603,7 +600,8 @@ func (t *Txn) Has(ids ...core.InstanceID) (bool, error) { // FindByID gets an instance by ID in the current txn scope. func (t *Txn) FindByID(id core.InstanceID) ([]byte, error) { - if err := t.collection.db.connector.Validate(t.token, true); err != nil { + _, identity, err := t.collection.db.connector.ValidateIdentity(t.token) + if err != nil { return nil, err } key := baseKey.ChildString(t.collection.name).ChildString(id.String()) @@ -614,11 +612,7 @@ func (t *Txn) FindByID(id core.InstanceID) ([]byte, error) { if err != nil { return nil, err } - pk, err := t.token.PubKey() - if err != nil { - return nil, err - } - bytes, err = t.collection.filterRead(pk, bytes) + bytes, err = t.collection.filterRead(identity, bytes) if err != nil { return nil, err } @@ -776,9 +770,9 @@ func loadJSFunc(vm *goja.Runtime, name string, obj []byte) (goja.Callable, error return fn, nil } -func loadJSIdentity(vm *goja.Runtime, identity thread.PubKey) (goja.Value, error) { - if identity == nil { +func loadJSIdentity(vm *goja.Runtime, identity did.DID) (goja.Value, error) { + if len(identity) == 0 { return nil, nil } - return vm.RunString(fmt.Sprintf("'%s'", identity.String())) + return vm.RunString(fmt.Sprintf("'%s'", identity)) } diff --git a/db/collection_test.go b/db/collection_test.go index 2a36694b..ed75f4fb 100644 --- a/db/collection_test.go +++ b/db/collection_test.go @@ -9,9 +9,9 @@ import ( "testing" "time" - logging "github.com/ipfs/go-log" + logging "github.com/ipfs/go-log/v2" core "github.com/textileio/go-threads/core/db" - "github.com/textileio/go-threads/util" + "github.com/textileio/go-threads/db/util" "github.com/xeipuuv/gojsonschema" ) diff --git a/db/common.go b/db/common.go index 74b5d770..41304b0c 100644 --- a/db/common.go +++ b/db/common.go @@ -7,12 +7,13 @@ import ( ds "github.com/ipfs/go-datastore" "github.com/ipfs/go-datastore/query" + dssync "github.com/ipfs/go-datastore/sync" dse "github.com/textileio/go-datastore-extensions" core "github.com/textileio/go-threads/core/db" ) type TxnMapDatastore struct { - *ds.MapDatastore + *dssync.MutexDatastore lock sync.RWMutex } @@ -20,7 +21,7 @@ var _ dse.DatastoreExtensions = (*TxnMapDatastore)(nil) func NewTxMapDatastore() *TxnMapDatastore { return &TxnMapDatastore{ - MapDatastore: ds.NewMapDatastore(), + MutexDatastore: dssync.MutexWrap(ds.NewMapDatastore()), } } diff --git a/db/db.go b/db/db.go index c28e63a2..1d55797f 100644 --- a/db/db.go +++ b/db/db.go @@ -17,11 +17,12 @@ import ( ds "github.com/ipfs/go-datastore" "github.com/ipfs/go-datastore/query" format "github.com/ipfs/go-ipld-format" - logging "github.com/ipfs/go-log" + logging "github.com/ipfs/go-log/v2" ma "github.com/multiformats/go-multiaddr" threadcbor "github.com/textileio/go-threads/cbor" "github.com/textileio/go-threads/core/app" core "github.com/textileio/go-threads/core/db" + "github.com/textileio/go-threads/core/did" lstore "github.com/textileio/go-threads/core/logstore" "github.com/textileio/go-threads/core/net" "github.com/textileio/go-threads/core/thread" @@ -39,7 +40,7 @@ const ( ) var ( - log = logging.Logger("db") + log = logging.Logger("threads/db") // ErrThreadReadKeyRequired indicates the provided thread key does not contain a read key. ErrThreadReadKeyRequired = errors.New("thread read key is required") @@ -106,7 +107,7 @@ func NewDB( } if args.Debug { if err := util.SetLogLevels(map[string]logging.LogLevel{ - "db": logging.LevelDebug, + "threads/db": logging.LevelDebug, }); err != nil { return nil, err } @@ -144,7 +145,7 @@ func NewDBFromAddr( } if args.Debug { if err := util.SetLogLevels(map[string]logging.LogLevel{ - "db": logging.LevelDebug, + "threads/db": logging.LevelDebug, }); err != nil { return nil, err } @@ -367,7 +368,7 @@ func (d *DB) NewCollection(config CollectionConfig, opts ...Option) (*Collection for _, opt := range opts { opt(args) } - if err := d.connector.Validate(args.Token, false); err != nil { + if _, _, err := d.connector.ValidateIdentity(args.Token); err != nil { return nil, err } if _, ok := d.collections[config.Name]; ok { @@ -396,7 +397,7 @@ func (d *DB) UpdateCollection(config CollectionConfig, opts ...Option) (*Collect for _, opt := range opts { opt(args) } - if err := d.connector.Validate(args.Token, false); err != nil { + if _, _, err := d.connector.ValidateIdentity(args.Token); err != nil { return nil, err } xc, ok := d.collections[config.Name] @@ -464,7 +465,7 @@ func (d *DB) GetCollection(name string, opts ...Option) *Collection { for _, opt := range opts { opt(args) } - if err := d.connector.Validate(args.Token, true); err != nil { + if _, _, err := d.connector.ValidateIdentity(args.Token); err != nil { return nil } return d.collections[name] @@ -478,7 +479,7 @@ func (d *DB) ListCollections(opts ...Option) []*Collection { for _, opt := range opts { opt(args) } - if err := d.connector.Validate(args.Token, true); err != nil { + if _, _, err := d.connector.ValidateIdentity(args.Token); err != nil { return nil } list := make([]*Collection, len(d.collections)) @@ -498,7 +499,7 @@ func (d *DB) DeleteCollection(name string, opts ...Option) error { for _, opt := range opts { opt(args) } - if err := d.connector.Validate(args.Token, false); err != nil { + if _, _, err := d.connector.ValidateIdentity(args.Token); err != nil { return err } c, ok := d.collections[name] @@ -569,7 +570,9 @@ func (d *DB) Reduce(events []core.Event) error { func defaultIndexFunc(d *DB) func(collection string, key ds.Key, oldData, newData []byte, txn ds.Txn) error { return func(collection string, key ds.Key, oldData, newData []byte, txn ds.Txn) error { - c := d.GetCollection(collection) + d.lock.Lock() + c := d.collections[collection] + d.lock.Unlock() if c == nil { return fmt.Errorf("collection (%s) not found", collection) } @@ -583,7 +586,7 @@ func defaultIndexFunc(d *DB) func(collection string, key ds.Key, oldData, newDat } } -func (d *DB) ValidateNetRecordBody(_ context.Context, body format.Node, identity thread.PubKey) error { +func (d *DB) ValidateNetRecordBody(_ context.Context, body format.Node, identity did.DID) error { events, err := d.eventcodec.EventsFromBytes(body.RawData()) if err != nil { return err diff --git a/db/db_test.go b/db/db_test.go index ed8be29b..843af605 100644 --- a/db/db_test.go +++ b/db/db_test.go @@ -18,7 +18,8 @@ import ( "github.com/textileio/go-threads/core/app" core "github.com/textileio/go-threads/core/db" "github.com/textileio/go-threads/core/thread" - "github.com/textileio/go-threads/util" + util "github.com/textileio/go-threads/db/util" + tutil "github.com/textileio/go-threads/util" ) func TestE2EWithThreads(t *testing.T) { @@ -31,17 +32,17 @@ func TestE2EWithThreads(t *testing.T) { n1, err := common.DefaultNetwork( common.WithNetBadgerPersistence(tmpDir1), - common.WithNetHostAddr(util.FreeLocalAddr()), + common.WithNetHostAddr(tutil.FreeLocalAddr()), common.WithNetDebug(true), ) checkErr(t, err) defer n1.Close() - store, err := util.NewBadgerDatastore(tmpDir1, "eventstore", false) + store, err := tutil.NewBadgerDatastore(tmpDir1, "eventstore") checkErr(t, err) defer store.Close() - id1 := thread.NewIDV1(thread.Raw, 32) + id1 := thread.NewRandomIDV1() d1, err := NewDB(context.Background(), store, n1, id1) checkErr(t, err) defer d1.Close() @@ -79,7 +80,7 @@ func TestE2EWithThreads(t *testing.T) { defer os.RemoveAll(tmpDir2) n2, err := common.DefaultNetwork( common.WithNetBadgerPersistence(tmpDir2), - common.WithNetHostAddr(util.FreeLocalAddr()), + common.WithNetHostAddr(tutil.FreeLocalAddr()), common.WithNetDebug(true), ) checkErr(t, err) @@ -92,7 +93,7 @@ func TestE2EWithThreads(t *testing.T) { Schema: util.SchemaFromInstance(&dummy{}, false), } - store2, err := util.NewBadgerDatastore(tmpDir2, "eventstore", false) + store2, err := tutil.NewBadgerDatastore(tmpDir2, "eventstore") checkErr(t, err) defer store2.Close() @@ -133,17 +134,17 @@ func TestMissingCollection(t *testing.T) { n, err := common.DefaultNetwork( common.WithNetBadgerPersistence(tmpDir), - common.WithNetHostAddr(util.FreeLocalAddr()), + common.WithNetHostAddr(tutil.FreeLocalAddr()), common.WithNetDebug(true), ) checkErr(t, err) defer n.Close() - store, err := util.NewBadgerDatastore(tmpDir, "eventstore", false) + store, err := tutil.NewBadgerDatastore(tmpDir, "eventstore") checkErr(t, err) defer store.Close() - id := thread.NewIDV1(thread.Raw, 32) + id := thread.NewRandomIDV1() db, err := NewDB(context.Background(), store, n, id) checkErr(t, err) defer db.Close() @@ -170,17 +171,17 @@ func TestWithNewName(t *testing.T) { n, err := common.DefaultNetwork( common.WithNetBadgerPersistence(tmpDir), - common.WithNetHostAddr(util.FreeLocalAddr()), + common.WithNetHostAddr(tutil.FreeLocalAddr()), common.WithNetDebug(true), ) checkErr(t, err) - store, err := util.NewBadgerDatastore(tmpDir, "eventstore", false) + store, err := tutil.NewBadgerDatastore(tmpDir, "eventstore") checkErr(t, err) defer store.Close() name := "my-db" - id := thread.NewIDV1(thread.Raw, 32) + id := thread.NewRandomIDV1() d, err := NewDB(context.Background(), store, n, id, WithNewName(name)) checkErr(t, err) if d.name != name { @@ -197,14 +198,14 @@ func TestWithNewName(t *testing.T) { time.Sleep(time.Second * 3) n, err = common.DefaultNetwork( common.WithNetBadgerPersistence(tmpDir), - common.WithNetHostAddr(util.FreeLocalAddr()), + common.WithNetHostAddr(tutil.FreeLocalAddr()), common.WithNetDebug(true), ) checkErr(t, err) defer n.Close() - defer d.Close() d, err = NewDB(context.Background(), store, n, id, WithNewKey(info.Key)) checkErr(t, err) + defer d.Close() if d.name != name { t.Fatalf("expected name %s, got %s", name, d.name) } @@ -218,17 +219,17 @@ func TestWithNewEventCodec(t *testing.T) { n, err := common.DefaultNetwork( common.WithNetBadgerPersistence(tmpDir), - common.WithNetHostAddr(util.FreeLocalAddr()), + common.WithNetHostAddr(tutil.FreeLocalAddr()), common.WithNetDebug(true), ) checkErr(t, err) - store, err := util.NewBadgerDatastore(tmpDir, "eventstore", false) + store, err := tutil.NewBadgerDatastore(tmpDir, "eventstore") checkErr(t, err) defer store.Close() ec := &mockEventCodec{} - id := thread.NewIDV1(thread.Raw, 32) + id := thread.NewRandomIDV1() d, err := NewDB(context.Background(), store, n, id, WithNewEventCodec(ec)) checkErr(t, err) @@ -254,7 +255,7 @@ func TestWithNewEventCodec(t *testing.T) { time.Sleep(time.Second * 3) n, err = common.DefaultNetwork( common.WithNetBadgerPersistence(tmpDir), - common.WithNetHostAddr(util.FreeLocalAddr()), + common.WithNetHostAddr(tutil.FreeLocalAddr()), common.WithNetDebug(true), ) checkErr(t, err) diff --git a/db/listeners.go b/db/listeners.go index 0be1ddd6..5b2d6c9d 100644 --- a/db/listeners.go +++ b/db/listeners.go @@ -7,7 +7,7 @@ import ( format "github.com/ipfs/go-ipld-format" "github.com/textileio/go-threads/core/app" core "github.com/textileio/go-threads/core/db" - "github.com/textileio/go-threads/core/thread" + "github.com/textileio/go-threads/core/did" ) // Listen returns a Listener which notifies about actions applying the @@ -33,7 +33,7 @@ func (d *DB) notifyStateChanged(actions []Action) { d.stateChangedNotifee.notify(actions) } -func (d *DB) notifyTxnEvents(node format.Node, token thread.Token) error { +func (d *DB) notifyTxnEvents(node format.Node, token did.Token) error { return d.localEventsBus.Send(&app.LocalEvent{ Node: node, Token: token, diff --git a/db/manager.go b/db/manager.go index 4c1b48d1..a253e069 100644 --- a/db/manager.go +++ b/db/manager.go @@ -9,7 +9,7 @@ import ( ds "github.com/ipfs/go-datastore" "github.com/ipfs/go-datastore/keytransform" "github.com/ipfs/go-datastore/query" - logging "github.com/ipfs/go-log" + logging "github.com/ipfs/go-log/v2" ma "github.com/multiformats/go-multiaddr" "github.com/textileio/go-threads/core/app" "github.com/textileio/go-threads/core/net" @@ -46,7 +46,7 @@ func NewManager(store kt.TxnDatastoreExtended, network app.Net, opts ...NewOptio if args.Debug { if err := util.SetLogLevels(map[string]logging.LogLevel{ - "db": logging.LevelDebug, + "threads/db": logging.LevelDebug, }); err != nil { return nil, err } @@ -108,11 +108,6 @@ func NewManager(store kt.TxnDatastoreExtended, network app.Net, opts ...NewOptio return m, nil } -// GetToken provides access to thread network tokens. -func (m *Manager) GetToken(ctx context.Context, identity thread.Identity) (thread.Token, error) { - return m.network.GetToken(ctx, identity) -} - // NewDB creates a new db and prefixes its datastore with base key. func (m *Manager) NewDB(ctx context.Context, id thread.ID, opts ...NewManagedOption) (*DB, error) { if _, ok := m.dbs[id]; ok { diff --git a/db/manager_test.go b/db/manager_test.go index 8524874f..0e445300 100644 --- a/db/manager_test.go +++ b/db/manager_test.go @@ -2,17 +2,16 @@ package db import ( "context" - "crypto/rand" "errors" "io/ioutil" "os" "testing" "time" - "github.com/libp2p/go-libp2p-core/crypto" "github.com/textileio/go-threads/common" lstore "github.com/textileio/go-threads/core/logstore" "github.com/textileio/go-threads/core/thread" + dutil "github.com/textileio/go-threads/db/util" "github.com/textileio/go-threads/util" ) @@ -45,21 +44,6 @@ var ( }` ) -func TestManager_GetToken(t *testing.T) { - t.Parallel() - ctx := context.Background() - man, clean := createTestManager(t) - defer clean() - - sk, _, err := crypto.GenerateEd25519Key(rand.Reader) - checkErr(t, err) - tok, err := man.GetToken(ctx, thread.NewLibp2pIdentity(sk)) - checkErr(t, err) - if tok == "" { - t.Fatal("bad token") - } -} - func TestManager_NewDB(t *testing.T) { t.Parallel() ctx := context.Background() @@ -67,21 +51,22 @@ func TestManager_NewDB(t *testing.T) { t.Parallel() man, clean := createTestManager(t) defer clean() - _, err := man.NewDB(ctx, thread.NewIDV1(thread.Raw, 32)) + _, err := man.NewDB(ctx, thread.NewRandomIDV1()) checkErr(t, err) }) t.Run("test multiple new dbs", func(t *testing.T) { t.Parallel() man, clean := createTestManager(t) defer clean() - _, err := man.NewDB(ctx, thread.NewIDV1(thread.Raw, 32)) + _, err := man.NewDB(ctx, thread.NewRandomIDV1()) checkErr(t, err) // NewDB with token - sk, _, err := crypto.GenerateEd25519Key(rand.Reader) - checkErr(t, err) - tok, err := man.GetToken(ctx, thread.NewLibp2pIdentity(sk)) - checkErr(t, err) - _, err = man.NewDB(ctx, thread.NewIDV1(thread.Raw, 32), WithNewManagedToken(tok)) + //sk, _, err := crypto.GenerateEd25519Key(rand.Reader) + //checkErr(t, err) + //tok, err := man.GetToken(ctx, thread.NewLibp2pIdentity(sk)) + //checkErr(t, err) + //_, err = man.NewDB(ctx, thread.NewRandomIDV1(), WithNewManagedToken(tok)) + _, err = man.NewDB(ctx, thread.NewRandomIDV1()) checkErr(t, err) }) t.Run("test new db with bad name", func(t *testing.T) { @@ -89,7 +74,7 @@ func TestManager_NewDB(t *testing.T) { man, clean := createTestManager(t) defer clean() name := "my db" - _, err := man.NewDB(ctx, thread.NewIDV1(thread.Raw, 32), WithNewManagedName(name)) + _, err := man.NewDB(ctx, thread.NewRandomIDV1(), WithNewManagedName(name)) if err == nil { t.Fatal("new db with bad name should fail") } @@ -99,7 +84,7 @@ func TestManager_NewDB(t *testing.T) { man, clean := createTestManager(t) defer clean() name := "my-db" - d, err := man.NewDB(ctx, thread.NewIDV1(thread.Raw, 32), WithNewManagedName(name)) + d, err := man.NewDB(ctx, thread.NewRandomIDV1(), WithNewManagedName(name)) checkErr(t, err) if d.name != name { t.Fatalf("expected name %s, got %s", name, d.name) @@ -119,7 +104,7 @@ func TestManager_GetDB(t *testing.T) { common.WithNetDebug(true), ) checkErr(t, err) - store, err := util.NewBadgerDatastore(dir, "eventstore", false) + store, err := util.NewBadgerDatastore(dir, "eventstore") checkErr(t, err) man, err := NewManager(store, n, WithNewDebug(true)) checkErr(t, err) @@ -128,7 +113,7 @@ func TestManager_GetDB(t *testing.T) { _ = os.RemoveAll(dir) }() - id := thread.NewIDV1(thread.Raw, 32) + id := thread.NewRandomIDV1() _, err = man.GetDB(ctx, id) if !errors.Is(err, lstore.ErrThreadNotFound) { t.Fatal("should be not found error") @@ -143,7 +128,7 @@ func TestManager_GetDB(t *testing.T) { } // Register a schema and create an instance - collection, err := db.NewCollection(CollectionConfig{Name: "Person", Schema: util.SchemaFromSchemaString(jsonSchema)}) + collection, err := db.NewCollection(CollectionConfig{Name: "Person", Schema: dutil.SchemaFromSchemaString(jsonSchema)}) checkErr(t, err) person1 := []byte(`{"_id": "", "name": "foo", "age": 21}`) _, err = collection.Create(person1) @@ -225,12 +210,12 @@ func TestManager_DeleteDB(t *testing.T) { man, clean := createTestManager(t) defer clean() - id := thread.NewIDV1(thread.Raw, 32) + id := thread.NewRandomIDV1() db, err := man.NewDB(ctx, id) checkErr(t, err) // Register a schema and create an instance - collection, err := db.NewCollection(CollectionConfig{Name: "Person", Schema: util.SchemaFromSchemaString(jsonSchema)}) + collection, err := db.NewCollection(CollectionConfig{Name: "Person", Schema: dutil.SchemaFromSchemaString(jsonSchema)}) checkErr(t, err) person1 := []byte(`{"_id": "", "name": "foo", "age": 21}`) _, err = collection.Create(person1) @@ -256,7 +241,7 @@ func createTestManager(t *testing.T) (*Manager, func()) { common.WithNetDebug(true), ) checkErr(t, err) - store, err := util.NewBadgerDatastore(dir, "eventstore", false) + store, err := util.NewBadgerDatastore(dir, "eventstore") checkErr(t, err) m, err := NewManager(store, n, WithNewDebug(true)) checkErr(t, err) diff --git a/db/options.go b/db/options.go index b9103f4c..f7970b62 100644 --- a/db/options.go +++ b/db/options.go @@ -3,6 +3,7 @@ package db import ( "github.com/libp2p/go-libp2p-core/crypto" core "github.com/textileio/go-threads/core/db" + "github.com/textileio/go-threads/core/did" "github.com/textileio/go-threads/core/thread" "github.com/textileio/go-threads/jsonpatcher" ) @@ -19,7 +20,7 @@ type NewOptions struct { Collections []CollectionConfig Block bool EventCodec core.EventCodec - Token thread.Token + Token did.Token Debug bool } @@ -77,7 +78,7 @@ func WithNewEventCodec(ec core.EventCodec) NewOption { } // WithNewToken provides authorization for interacting with a db. -func WithNewToken(t thread.Token) NewOption { +func WithNewToken(t did.Token) NewOption { return func(o *NewOptions) { o.Token = t } @@ -92,14 +93,14 @@ func WithNewDebug(enable bool) NewOption { // Options defines options for interacting with a db. type Options struct { - Token thread.Token + Token did.Token } // Option specifies a db option. type Option func(*Options) // WithToken provides authorization for interacting with a db. -func WithToken(t thread.Token) Option { +func WithToken(t did.Token) Option { return func(o *Options) { o.Token = t } @@ -107,14 +108,14 @@ func WithToken(t thread.Token) Option { // TxnOptions defines options for a transaction. type TxnOptions struct { - Token thread.Token + Token did.Token } // TxnOption specifies a transaction option. type TxnOption func(*TxnOptions) // WithTxnToken provides authorization for the transaction. -func WithTxnToken(t thread.Token) TxnOption { +func WithTxnToken(t did.Token) TxnOption { return func(o *TxnOptions) { o.Token = t } @@ -125,7 +126,7 @@ type NewManagedOptions struct { Name string Key thread.Key LogKey crypto.Key - Token thread.Token + Token did.Token Collections []CollectionConfig Block bool } @@ -141,7 +142,7 @@ func WithNewManagedName(name string) NewManagedOption { } // WithNewManagedToken provides authorization for creating a new managed db. -func WithNewManagedToken(t thread.Token) NewManagedOption { +func WithNewManagedToken(t did.Token) NewManagedOption { return func(o *NewManagedOptions) { o.Token = t } @@ -184,14 +185,14 @@ func WithNewManagedBackfillBlock(block bool) NewManagedOption { // ManagedOptions defines options for interacting with a managed db. type ManagedOptions struct { - Token thread.Token + Token did.Token } // ManagedOption specifies a managed db option. type ManagedOption func(*ManagedOptions) // WithManagedToken provides authorization for interacting with a managed db. -func WithManagedToken(t thread.Token) ManagedOption { +func WithManagedToken(t did.Token) ManagedOption { return func(o *ManagedOptions) { o.Token = t } diff --git a/db/query.go b/db/query.go index 66e1ea9e..e111d552 100644 --- a/db/query.go +++ b/db/query.go @@ -292,7 +292,8 @@ func (c *Criterion) createcriterion(op Operation, value interface{}) *Query { // Find queries for instances by Query. func (t *Txn) Find(q *Query) ([][]byte, error) { - if err := t.collection.db.connector.Validate(t.token, true); err != nil { + _, identity, err := t.collection.db.connector.ValidateIdentity(t.token) + if err != nil { return nil, err } if q == nil { @@ -309,10 +310,6 @@ func (t *Txn) Find(q *Query) ([][]byte, error) { iter := newIterator(txn, t.collection.baseKey(), q) defer iter.Close() - pk, err := t.token.PubKey() - if err != nil { - return nil, err - } var values []MarshaledResult // Use count to track real count of returned values taking into account // read filter and any indexes etc in the query @@ -322,7 +319,7 @@ func (t *Txn) Find(q *Query) ([][]byte, error) { if !ok { break } - res.Value, err = t.collection.filterRead(pk, res.Value) + res.Value, err = t.collection.filterRead(identity, res.Value) if err != nil { return nil, err } diff --git a/db/query_more_test.go b/db/query_more_test.go index 5c54e05d..f9f523f4 100644 --- a/db/query_more_test.go +++ b/db/query_more_test.go @@ -8,7 +8,7 @@ import ( "testing" core "github.com/textileio/go-threads/core/db" - "github.com/textileio/go-threads/util" + "github.com/textileio/go-threads/db/util" ) type book struct { diff --git a/db/query_test.go b/db/query_test.go index 963e688c..ef88e756 100644 --- a/db/query_test.go +++ b/db/query_test.go @@ -6,9 +6,9 @@ import ( "strings" "testing" - logging "github.com/ipfs/go-log" + logging "github.com/ipfs/go-log/v2" "github.com/textileio/go-threads/core/db" - "github.com/textileio/go-threads/util" + "github.com/textileio/go-threads/db/util" ) type Meta struct { diff --git a/db/testutils_test.go b/db/testutils_test.go index b4a0c883..f1c3d69d 100644 --- a/db/testutils_test.go +++ b/db/testutils_test.go @@ -28,9 +28,9 @@ func createTestDB(t *testing.T, opts ...NewOption) (*DB, func()) { common.WithNetDebug(true), ) checkErr(t, err) - store, err := util.NewBadgerDatastore(dir, "eventstore", false) + store, err := util.NewBadgerDatastore(dir, "eventstore") checkErr(t, err) - d, err := NewDB(context.Background(), store, n, thread.NewIDV1(thread.Raw, 32), opts...) + d, err := NewDB(context.Background(), store, n, thread.NewRandomIDV1(), opts...) checkErr(t, err) return d, func() { time.Sleep(time.Second) // Give threads a chance to finish work diff --git a/db/util/util.go b/db/util/util.go new file mode 100644 index 00000000..da294150 --- /dev/null +++ b/db/util/util.go @@ -0,0 +1,49 @@ +package util + +import ( + "encoding/json" + + "github.com/alecthomas/jsonschema" + core "github.com/textileio/go-threads/core/db" + "github.com/tidwall/sjson" +) + +func SchemaFromInstance(i interface{}, expandedStruct bool) *jsonschema.Schema { + reflector := jsonschema.Reflector{ExpandedStruct: expandedStruct} + return reflector.Reflect(i) +} + +func SchemaFromSchemaString(s string) *jsonschema.Schema { + schemaBytes := []byte(s) + schema := &jsonschema.Schema{} + if err := json.Unmarshal(schemaBytes, schema); err != nil { + panic(err) + } + return schema +} + +func JSONFromInstance(i interface{}) []byte { + JSON, err := json.Marshal(i) + if err != nil { + panic(err) + } + return JSON +} + +func InstanceFromJSON(b []byte, i interface{}) { + if err := json.Unmarshal(b, i); err != nil { + panic(err) + } +} + +func SetJSONProperty(name string, value interface{}, json []byte) []byte { + updated, err := sjson.SetBytes(json, name, value) + if err != nil { + panic(err) + } + return updated +} + +func SetJSONID(id core.InstanceID, json []byte) []byte { + return SetJSONProperty("_id", id.String(), json) +} diff --git a/did/cache/cache.go b/did/cache/cache.go new file mode 100644 index 00000000..f151b45e --- /dev/null +++ b/did/cache/cache.go @@ -0,0 +1,39 @@ +package cache + +import ( + "encoding/json" + + ds "github.com/ipfs/go-datastore" + "github.com/textileio/go-threads/core/did" +) + +type TokenCache struct { + s ds.Datastore +} + +func NewTokenCache(store ds.Datastore) *TokenCache { + return &TokenCache{s: store} +} + +func (s *TokenCache) Put(did did.DID, document did.Document) error { + v, err := json.Marshal(document) + if err != nil { + return err + } + return s.s.Put(ds.NewKey(string(did)), v) +} + +func (s *TokenCache) Get(did did.DID) (doc did.Document, err error) { + v, err := s.s.Get(ds.NewKey(string(did))) + if err != nil { + return doc, err + } + if err := json.Unmarshal(v, &doc); err != nil { + return doc, err + } + return doc, err +} + +func (s *TokenCache) Delete(did did.DID) error { + return s.s.Delete(ds.NewKey(string(did))) +} diff --git a/did/registry/options.go b/did/registry/options.go new file mode 100644 index 00000000..ecfaf920 --- /dev/null +++ b/did/registry/options.go @@ -0,0 +1,20 @@ +package registry + +import ( + "time" +) + +// Options defines options for interacting with the registry. +type Options struct { + Timeout time.Duration +} + +// Option specifies registry options. +type Option func(*Options) + +//// WithThreadToken provides authorization for interacting with a thread. +//func WithTimeout(duration time.Duration) ThreadOption { +// return func(args *ThreadOptions) { +// args.Token = t +// } +//} diff --git a/did/registry/registry.go b/did/registry/registry.go new file mode 100644 index 00000000..938de92e --- /dev/null +++ b/did/registry/registry.go @@ -0,0 +1,250 @@ +package registry + +import ( + "context" + "errors" + "fmt" + "sync" + "time" + + ds "github.com/ipfs/go-datastore" + logging "github.com/ipfs/go-log/v2" + "github.com/libp2p/go-libp2p-core/host" + "github.com/libp2p/go-libp2p-core/peer" + libpubsub "github.com/libp2p/go-libp2p-pubsub" + maddr "github.com/multiformats/go-multiaddr" + d "github.com/textileio/go-threads/core/did" + "github.com/textileio/go-threads/core/logstore" + "github.com/textileio/go-threads/core/thread" + "github.com/textileio/go-threads/did/cache" + "github.com/textileio/go-threads/net/util" + "github.com/textileio/go-threads/pubsub" +) + +var log = logging.Logger("threads/registry") + +type Registry struct { + host host.Host + id thread.Identity + did d.DID + ps *libpubsub.PubSub + + topic *pubsub.Topic + logs logstore.Logstore + cache *cache.TokenCache + reqs map[d.DID]chan d.Document + + ctx context.Context + cancel context.CancelFunc + + semaphores *util.SemaphorePool + lk sync.Mutex +} + +// NewRegistry returns a new pubsub DID registry. +func NewRegistry(host host.Host, logs logstore.Logstore, store ds.Datastore) (*Registry, error) { + sk := host.Peerstore().PrivKey(host.ID()) + if sk == nil { + return nil, errors.New("host key not found") + } + id := thread.NewLibp2pIdentity(sk) + self, err := id.GetPublic().DID() + if err != nil { + return nil, fmt.Errorf("getting host did: %v", err) + } + + ctx, cancel := context.WithCancel(context.Background()) + ps, err := libpubsub.NewGossipSub(ctx, host) + if err != nil { + cancel() + return nil, fmt.Errorf("starting libp2p pubsub: %v", err) + } + + topic, err := pubsub.NewTopic(ctx, ps, host.ID(), string(thread.Protocol), true) + if err != nil { + cancel() + return nil, fmt.Errorf("creating registry topic: %v", err) + } + + r := &Registry{ + host: host, + id: thread.NewLibp2pIdentity(sk), + did: self, + ps: ps, + topic: topic, + logs: logs, + cache: cache.NewTokenCache(store), + reqs: make(map[d.DID]chan d.Document), + ctx: ctx, + cancel: cancel, + semaphores: util.NewSemaphorePool(1), + } + + topic.SetEventHandler(r.eventHandler) + topic.SetMessageHandler(r.messageHandler) + return r, nil +} + +// Close the registry. +func (r *Registry) Close() error { + r.lk.Lock() + defer r.lk.Unlock() + r.topic.Close() + r.cancel() + return nil +} + +//func (r *Registry) Register(did d.DID, doc d.Document) error { +// return r.store.Put(did, doc) +//} + +func (r *Registry) Resolve(ctx context.Context, did d.DID) (doc d.Document, err error) { + if _, err := thread.FromDID(did); err != nil { + return doc, fmt.Errorf("decoding did: %v", err) + } + + r.lk.Lock() + if _, ok := r.reqs[did]; ok { + r.lk.Unlock() + return doc, fmt.Errorf("request for %s already in flight", did) + } + resCh := make(chan d.Document) + r.reqs[did] = resCh + r.lk.Unlock() + defer func() { + r.lk.Lock() + delete(r.reqs, did) + r.lk.Unlock() + }() + + // First, check if we have it locally. + //doc, err = r.cache.Get(did) + //if err != nil && !errors.Is(err, ds.ErrNotFound) { + // return doc, err + //} + + // Subscribe to response topic. + res, err := pubsub.NewTopic(ctx, r.ps, r.host.ID(), string(did), true) + if err != nil { + return doc, fmt.Errorf("creating results topic %s: %v", did, err) + } + defer res.Close() + res.SetEventHandler(r.eventHandler) + res.SetMessageHandler(r.messageHandler) + + // Request it from the network. + if err := r.topic.Publish(ctx, []byte(did)); err != nil { + return doc, err + } + for { + select { + case <-r.ctx.Done(): + return doc, logstore.ErrThreadNotFound + case <-ctx.Done(): + return doc, logstore.ErrThreadNotFound + case doc, ok := <-resCh: + if ok { + return doc, nil + } + } + } +} + +//func (r *Registry) Revoke(did d.DID) error { +// return r.store.Delete(did) +//} + +func (r *Registry) eventHandler(from peer.ID, topic, msg string) { + log.Debugf("%s peer event: %s %s", topic, from, msg) +} + +func (r *Registry) messageHandler(from peer.ID, topic, msg string) { + log.Debugf("%s received message from %s", topic, from) + + // See if this message is a DID request. + id, err := thread.FromDID(d.DID(msg)) + if err == nil { + if err := r.handleRequest(id, from); err != nil { + log.Debug(err) + return + } + } else { + // Not a DID. Treat the message as a token response. + if err := r.handleResponse(d.Token(msg), from); err != nil { + log.Debug(err) + return + } + } +} + +func (r *Registry) handleRequest(id thread.ID, from peer.ID) error { + tk, err := r.getToken(id, d.NewKeyDID(from.String())) + if err != nil { + return fmt.Errorf("getting token for %s: %v", id, err) + } + + // Subscribe to response topic. + res, err := pubsub.NewTopic(r.ctx, r.ps, r.host.ID(), string(id.DID()), false) + if err != nil { + return fmt.Errorf("creating results topic %s: %v", id.DID(), err) + } + defer res.Close() + res.SetEventHandler(r.eventHandler) + + // Publish token. + if err := res.Publish(r.ctx, []byte(tk)); err != nil { + return fmt.Errorf("publishing response to topic %s: %v", id.DID(), err) + } + return nil +} + +func (r *Registry) getToken(id thread.ID, aud d.DID) (d.Token, error) { + // Build a token from local thread info. + info, err := r.logs.GetThread(id) + if err != nil { + return "", err + } + pc, err := maddr.NewComponent(maddr.ProtocolWithCode(maddr.P_P2P).Name, r.host.ID().String()) + if err != nil { + return "", nil + } + tc, err := maddr.NewComponent(thread.ProtocolName, info.ID.String()) + if err != nil { + return "", nil + } + addrs := r.host.Addrs() + res := make([]maddr.Multiaddr, len(addrs)) + for i := range addrs { + res[i] = addrs[i].Encapsulate(pc).Encapsulate(tc) + } + info.Addrs = res + return info.Token(r.id, aud, time.Minute) +} + +func (r *Registry) handleResponse(token d.Token, from peer.ID) error { + // Validate token. + k, doc, err := r.id.GetPublic().Validate(token) + if err != nil { + return fmt.Errorf("validating token: %v", err) + } + pk, ok := k.(*thread.Libp2pPubKey) + if !ok { + return fmt.Errorf("token issuer must be a Libp2pPubKey") + } + if !from.MatchesPublicKey(pk.PubKey) { + return fmt.Errorf("token issuer does not match sender: %v", err) + } + + // Send to results channel. + r.lk.Lock() + defer r.lk.Unlock() + ch, ok := r.reqs[doc.ID] + if ok { + select { + case ch <- doc: + default: + log.Warnf("slow document receiver for %s", doc.ID) + } + } + return nil +} diff --git a/did/registry/registry_test.go b/did/registry/registry_test.go new file mode 100644 index 00000000..354c49fa --- /dev/null +++ b/did/registry/registry_test.go @@ -0,0 +1,96 @@ +package registry + +import ( + "context" + "crypto/rand" + "os" + "testing" + "time" + + ds "github.com/ipfs/go-datastore" + logging "github.com/ipfs/go-log/v2" + "github.com/libp2p/go-libp2p" + "github.com/libp2p/go-libp2p-core/crypto" + "github.com/libp2p/go-libp2p-core/peer" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/textileio/go-threads/core/thread" + "github.com/textileio/go-threads/logstore/lstoremem" +) + +func TestMain(m *testing.M) { + _ = logging.SetLogLevel("registry", "debug") + os.Exit(m.Run()) +} + +func TestRegistry_Resolve(t *testing.T) { + r := setupN(t, 2) + + // Resolve invalid thread DID + _, err := r[0].Resolve(context.Background(), "did:thread:123") + require.Error(t, err) + + // Resolve non-existent DID + ctx, cancel := context.WithTimeout(context.Background(), time.Second) + defer cancel() + _, err = r[0].Resolve(ctx, thread.NewRandomIDV1().DID()) + require.Error(t, err) + + // Add a thread to peer 1 + info := thread.Info{ + ID: thread.NewRandomIDV1(), + Key: thread.NewRandomKey(), + } + err = r[1].logs.AddThread(info) + require.NoError(t, err) + + // Resolve it from peer 0 + ctx2, cancel2 := context.WithTimeout(context.Background(), time.Second) + defer cancel2() + doc, err := r[0].Resolve(ctx2, info.ID.DID()) + require.NoError(t, err) + assert.Equal(t, info.ID.DID(), doc.ID) + assert.NotEmpty(t, doc.Services) +} + +func setup(t *testing.T) *Registry { + ctx, cancel := context.WithCancel(context.Background()) + t.Cleanup(cancel) + + // Build a libp2p host. + sk, _, err := crypto.GenerateEd25519Key(rand.Reader) + require.NoError(t, err) + host, err := libp2p.New(ctx, libp2p.Identity(sk)) + require.NoError(t, err) + t.Cleanup(func() { + require.NoError(t, host.Close()) + }) + + // Create registry. + r, err := NewRegistry(host, lstoremem.NewLogstore(), ds.NewMapDatastore()) + require.NoError(t, err) + t.Cleanup(func() { + require.NoError(t, r.Close()) + }) + return r +} + +func setupN(t *testing.T, n int) []*Registry { + rs := make([]*Registry, n) + for i := range rs { + r := setup(t) + j := 0 + for j < i { + // Direct connect to the other registries. + err := r.host.Connect(context.Background(), peer.AddrInfo{ + ID: rs[j].host.ID(), + Addrs: rs[j].host.Addrs(), + }) + require.NoError(t, err) + j++ + } + rs[i] = r + } + time.Sleep(time.Second) + return rs +} diff --git a/dist/README.md b/dist/README.md deleted file mode 100644 index f5ef7d56..00000000 --- a/dist/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# `threadsd` - -This is the [ThreadDB](https://github.com/textileio/go-threads/tree/master/threadsd) daemon. - -## Install - -To install it, move the binary somewhere in your `$PATH`: - -```sh -sudo mv threadsd /usr/local/bin/threadsd -``` - -Or run `sudo ./install` which does this for you. - -## Usage - -```sh -threadsd --help -``` \ No newline at end of file diff --git a/dist/install b/dist/install.tmpl similarity index 80% rename from dist/install rename to dist/install.tmpl index 3232dd8a..051b3614 100755 --- a/dist/install +++ b/dist/install.tmpl @@ -8,7 +8,7 @@ set -Eeuo pipefail INSTALL_DIR="$(dirname "$0")" -threadsd="$INSTALL_DIR/threadsd" +file="$INSTALL_DIR/{{ .Env.BIN_FILE }}" binpaths="/usr/local/bin /usr/bin" # This variable contains a nonzero length string in case the script fails @@ -16,8 +16,8 @@ binpaths="/usr/local/bin /usr/bin" is_write_perm_missing="" for binpath in $binpaths; do - if mv "$threadsd" "$binpath/$threadsd" 2>/dev/null; then - echo "Moved $threadsd to $binpath" + if mv "$file" "$binpath/$file" 2>/dev/null; then + echo "Moved $file to $binpath" exit 0 else if test -d "$binpath" && ! test -w "$binpath"; then @@ -26,7 +26,7 @@ for binpath in $binpaths; do fi done -echo "We cannot install $threadsd in one of the directories $binpaths" +echo "We cannot install $file in one of the directories $binpaths" if test -n "$is_write_perm_missing"; then echo "It seems that we do not have the necessary write permissions." diff --git a/docker-compose-dev.yml b/docker-compose-dev.yml deleted file mode 100644 index f7ac4a5a..00000000 --- a/docker-compose-dev.yml +++ /dev/null @@ -1,35 +0,0 @@ -version: "3" -services: - threaddb: - build: - context: . - environment: - - THRDS_REPO - - THRDS_HOSTADDR - - THRDS_APIADDR=/ip4/0.0.0.0/tcp/6006 - - THRDS_APIPROXYADDR=/ip4/0.0.0.0/tcp/6007 - - THRDS_CONNLOWWATER - - THRDS_CONNHIGHWATER - - THRDS_CONNGRACEPERIOD - - THRDS_KEEPALIVEINTERVAL - - THRDS_ENABLENETPUBSUB - - THRDS_MONGOURI=mongodb://mongo:27017 - - THRDS_MONGODATABASE=threaddb - - THRDS_DEBUG=true - ports: - - "4006:4006" - - "127.0.0.1:6006:6006" - - "127.0.0.1:6007:6007" - depends_on: - - mongo - mongo: - image: mongo:latest - ports: - - "127.0.0.1:27017:27017" - command: - - /bin/bash - - -c - - | - /usr/bin/mongod --fork --logpath /var/log/mongod.log --bind_ip_all --replSet rs0 - mongo --eval 'rs.initiate({_id: "rs0", version: 1, members: [{ _id: 0, host: "mongo:27017" }]})' - tail -f /var/log/mongod.log diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index 9118ae04..00000000 --- a/docker-compose.yml +++ /dev/null @@ -1,40 +0,0 @@ -version: "3" -services: - threads: - image: textile/go-threads:latest - restart: always - volumes: - - "${THRDS_REPO}/threaddb:/data/threaddb" - environment: - - THRDS_REPO - - THRDS_HOSTADDR - - THRDS_APIADDR=/ip4/0.0.0.0/tcp/6006 - - THRDS_APIPROXYADDR=/ip4/0.0.0.0/tcp/6007 - - THRDS_CONNLOWWATER - - THRDS_CONNHIGHWATER - - THRDS_CONNGRACEPERIOD - - THRDS_KEEPALIVEINTERVAL - - THRDS_ENABLENETPUBSUB - - THRDS_MONGOURI=mongodb://mongo:27017 - - THRDS_MONGODATABASE=threaddb - - THRDS_DEBUG - ports: - - "4006:4006" - - "127.0.0.1:6006:6006" - - "127.0.0.1:6007:6007" - depends_on: - - mongo - mongo: - image: mongo:latest - restart: always - volumes: - - "${THRDS_REPO}/mongodb:/data/mongodb" - ports: - - "127.0.0.1:27017:27017" - command: - - /bin/bash - - -c - - | - /usr/bin/mongod --fork --logpath /var/log/mongod.log --bind_ip_all --replSet rs0 - mongo --eval 'rs.initiate({_id: "rs0", version: 1, members: [{ _id: 0, host: "mongo:27017" }]})' - tail -f /var/log/mongod.log diff --git a/gateway/gateway.go b/gateway/gateway.go new file mode 100644 index 00000000..191c5e29 --- /dev/null +++ b/gateway/gateway.go @@ -0,0 +1,323 @@ +package gateway + +import ( + "bytes" + "context" + "errors" + "fmt" + "net/http" + "net/url" + "strings" + "time" + + "github.com/gin-contrib/location" + "github.com/gin-gonic/gin" + "github.com/gin-gonic/gin/render" + "github.com/ipfs/go-cid" + logging "github.com/ipfs/go-log/v2" + mbase "github.com/multiformats/go-multibase" + "github.com/rs/cors" + gincors "github.com/rs/cors/wrapper/gin" + coredb "github.com/textileio/go-threads/core/db" + "github.com/textileio/go-threads/core/did" + core "github.com/textileio/go-threads/core/thread" + "github.com/textileio/go-threads/db" +) + +var log = logging.Logger("threads/gateway") + +const handlerTimeout = time.Minute + +func init() { + gin.SetMode(gin.ReleaseMode) +} + +// Gateway provides HTTP-based access to buckets. +type Gateway struct { + db *db.Manager + server *http.Server + + addr string + url string + subdomains bool +} + +// NewGateway returns a new gateway. +func NewGateway(db *db.Manager, addr, url string, subdomains bool) (*Gateway, error) { + return &Gateway{ + db: db, + addr: addr, + url: url, + subdomains: subdomains, + }, nil +} + +// Start the gateway. +func (g *Gateway) Start() { + router := gin.Default() + + router.Use(location.Default()) + router.Use(gincors.New(cors.Options{})) + + router.GET("/health", func(c *gin.Context) { + c.Writer.WriteHeader(http.StatusNoContent) + }) + + router.GET("/thread/:thread/:collection", g.subdomainOptionHandler, g.collectionHandler) + router.GET("/thread/:thread/:collection/:id", g.subdomainOptionHandler, g.instanceHandler) + + router.NoRoute(render404) + + g.server = &http.Server{ + Addr: g.addr, + Handler: router, + } + go func() { + if err := g.server.ListenAndServe(); err != nil && err != http.ErrServerClosed { + log.Errorf("gateway error: %s", err) + } + }() + log.Infof("gateway listening at %s", g.server.Addr) +} + +// Addr returns the gateway's address. +func (g *Gateway) Addr() string { + return g.server.Addr +} + +// Close the gateway. +func (g *Gateway) Close() error { + ctx, cancel := context.WithTimeout(context.Background(), time.Second) + defer cancel() + if err := g.server.Shutdown(ctx); err != nil { + return fmt.Errorf("shutting down server: %v", err) + } + return nil +} + +// render404 renders a JSON 404 message. +// @todo: Use this +func render404(c *gin.Context) { + renderError(c, http.StatusNotFound, nil) +} + +// renderError renders a JSON error message. +func renderError(c *gin.Context, code int, err error) { + if err == nil { + err = errors.New(http.StatusText(code)) + } + c.JSON(code, gin.H{"code": code, "message": err.Error()}) +} + +// collectionHandler handles collection requests. +func (g *Gateway) collectionHandler(c *gin.Context) { + thread, err := core.Decode(c.Param("thread")) + if err != nil { + renderError(c, http.StatusBadRequest, errors.New("invalid thread ID")) + return + } + g.renderCollection(c, thread, c.Param("collection")) +} + +// renderCollection renders all instances in a collection. +func (g *Gateway) renderCollection(c *gin.Context, thread core.ID, collection string) { + token := did.Token(c.Query("token")) + + ctx, cancel := context.WithTimeout(context.Background(), handlerTimeout) + defer cancel() + d, err := g.db.GetDB(ctx, thread, db.WithManagedToken(token)) + if err != nil { + render404(c) + return + } + col := d.GetCollection(collection, db.WithToken(token)) + if c == nil { + render404(c) + return + } + res, err := col.Find(&db.Query{}, db.WithTxnToken(token)) + if err != nil { + render404(c) + return + } + var buf bytes.Buffer + buf.WriteByte('[') + for i, r := range res { + if _, err := buf.Write(r); err != nil { + renderError(c, http.StatusInternalServerError, fmt.Errorf("writing response: %v", err)) + return + } + if i != len(res)-1 { + buf.WriteByte(',') + } + } + buf.WriteByte(']') + c.Render(200, render.Data{Data: buf.Bytes(), ContentType: "application/json"}) +} + +// instanceHandler handles collection instance requests. +func (g *Gateway) instanceHandler(c *gin.Context) { + thread, err := core.Decode(c.Param("thread")) + if err != nil { + renderError(c, http.StatusBadRequest, errors.New("invalid thread ID")) + return + } + g.renderInstance(c, thread, c.Param("collection"), c.Param("id")) +} + +// renderInstance renders an instance in a collection. +func (g *Gateway) renderInstance(c *gin.Context, thread core.ID, collection, id string) { + token := did.Token(c.Query("token")) + + ctx, cancel := context.WithTimeout(context.Background(), handlerTimeout) + defer cancel() + d, err := g.db.GetDB(ctx, thread, db.WithManagedToken(token)) + if err != nil { + render404(c) + return + } + col := d.GetCollection(collection, db.WithToken(token)) + if c == nil { + render404(c) + return + } + res, err := col.FindByID(coredb.InstanceID(id), db.WithTxnToken(token)) + if err != nil { + render404(c) + return + } + c.Render(200, render.Data{Data: res, ContentType: "application/json"}) +} + +// subdomainOptionHandler redirects valid namespaces to subdomains if the option is enabled. +func (g *Gateway) subdomainOptionHandler(c *gin.Context) { + if !g.subdomains { + return + } + loc, ok := g.toSubdomainURL(c.Request) + if !ok { + render404(c) + return + } + + // See security note: + // https://github.com/ipfs/go-ipfs/blob/dbfa7bf2b216bad9bec1ff66b1f3814f4faac31e/core/corehttp/hostname.go#L105 + c.Request.Header.Set("Clear-Site-Data", "\"cookies\", \"storage\"") + + c.Redirect(http.StatusPermanentRedirect, loc) +} + +// subdomainHandler handles requests by parsing the request subdomain. +func (g *Gateway) subdomainHandler(c *gin.Context) { + c.Status(200) + + parts := strings.Split(c.Request.Host, ".") + key := parts[0] + + if len(parts) < 3 { + render404(c) + return + } + ns := parts[1] + if !isSubdomainNamespace(ns) { + render404(c) + return + } + switch ns { + case "thread": + thread, err := core.Decode(key) + if err != nil { + renderError(c, http.StatusBadRequest, errors.New("invalid thread ID")) + return + } + parts := strings.SplitN(strings.TrimSuffix(c.Request.URL.Path, "/"), "/", 3) + switch len(parts) { + case 1: + // @todo: Render something at the thread root + render404(c) + case 2: + if parts[1] != "" { + g.renderCollection(c, thread, parts[1]) + } else { + render404(c) + } + case 3: + g.renderInstance(c, thread, parts[1], parts[2]) + default: + render404(c) + } + default: + render404(c) + } +} + +// Modified from: +// https://github.com/ipfs/go-ipfs/blob/dbfa7bf2b216bad9bec1ff66b1f3814f4faac31e/core/corehttp/hostname.go#L251 +func isSubdomainNamespace(ns string) bool { + switch ns { + case "thread": + return true + default: + return false + } +} + +// Converts a hostname/path to a subdomain-based URL, if applicable. +// Modified from: +// https://github.com/ipfs/go-ipfs/blob/dbfa7bf2b216bad9bec1ff66b1f3814f4faac31e/core/corehttp/hostname.go#L270 +func (g *Gateway) toSubdomainURL(r *http.Request) (redirURL string, ok bool) { + var ns, rootID, rest string + + query := r.URL.RawQuery + parts := strings.SplitN(r.URL.Path, "/", 4) + safeRedirectURL := func(in string) (out string, ok bool) { + safeURI, err := url.ParseRequestURI(in) + if err != nil { + return "", false + } + return safeURI.String(), true + } + + switch len(parts) { + case 4: + rest = parts[3] + fallthrough + case 3: + ns = parts[1] + rootID = parts[2] + default: + return "", false + } + + if !isSubdomainNamespace(ns) { + return "", false + } + + // add prefix if query is present + if query != "" { + query = "?" + query + } + + // If rootID is a CID, ensure it uses DNS-friendly text representation + if rootCid, err := cid.Decode(rootID); err == nil { + multicodec := rootCid.Type() + + // if object turns out to be a valid CID, + // ensure text representation used in subdomain is CIDv1 in Base32 + // https://github.com/ipfs/in-web-browsers/issues/89 + rootID, err = cid.NewCidV1(multicodec, rootCid.Hash()).StringOfBase(mbase.Base32) + if err != nil { + // should not error, but if it does, its clealy not possible to + // produce a subdomain URL + return "", false + } + } + + urlparts := strings.Split(g.url, "://") + if len(urlparts) < 2 { + return "", false + } + scheme := urlparts[0] + host := urlparts[1] + return safeRedirectURL(fmt.Sprintf("%s://%s.%s.%s/%s%s", scheme, rootID, ns, host, rest, query)) +} diff --git a/go.mod b/go.mod index 84ed0d50..6d5932b0 100644 --- a/go.mod +++ b/go.mod @@ -7,17 +7,19 @@ require ( github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412 github.com/alecthomas/jsonschema v0.0.0-20191017121752-4bb6e3fae4f2 github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect - github.com/dgraph-io/badger v1.6.2 github.com/dgrijalva/jwt-go v3.2.0+incompatible github.com/dlclark/regexp2 v1.2.0 // indirect github.com/dop251/goja v0.0.0-20200721192441-a695b0cdd498 github.com/evanphx/json-patch v4.5.0+incompatible - github.com/fsnotify/fsnotify v1.4.7 + github.com/fsnotify/fsnotify v1.4.9 + github.com/gin-contrib/location v0.0.2 + github.com/gin-gonic/gin v1.6.3 github.com/go-sourcemap/sourcemap v2.1.3+incompatible // indirect github.com/gogo/googleapis v1.3.1 // indirect - github.com/gogo/protobuf v1.3.1 + github.com/gogo/protobuf v1.3.2 github.com/gogo/status v1.1.0 github.com/golang/protobuf v1.4.3 + github.com/google/uuid v1.2.0 github.com/grpc-ecosystem/go-grpc-middleware v1.2.1 github.com/hashicorp/go-multierror v1.1.0 github.com/hashicorp/golang-lru v0.5.4 @@ -33,7 +35,6 @@ require ( github.com/ipfs/go-ipfs-util v0.0.2 github.com/ipfs/go-ipld-cbor v0.0.5 github.com/ipfs/go-ipld-format v0.2.0 - github.com/ipfs/go-log v1.0.4 github.com/ipfs/go-log/v2 v2.1.1 github.com/ipfs/go-merkledag v0.3.2 github.com/libp2p/go-libp2p v0.12.0 @@ -47,29 +48,37 @@ require ( github.com/libp2p/go-libp2p-yamux v0.4.1 // indirect github.com/libp2p/go-netroute v0.1.4 // indirect github.com/libp2p/go-sockaddr v0.1.0 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.1 // indirect github.com/multiformats/go-multiaddr v0.3.1 github.com/multiformats/go-multibase v0.0.3 github.com/multiformats/go-multihash v0.0.14 github.com/multiformats/go-varint v0.0.6 github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect github.com/namsral/flag v1.7.4-pre + github.com/ockam-network/did v0.1.3 github.com/oklog/ulid/v2 v2.0.2 github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2 github.com/polydawn/refmt v0.0.0-20190807091052-3d65705ee9f1 // indirect - github.com/rs/cors v1.7.0 // indirect + github.com/rs/cors v1.7.0 github.com/smartystreets/goconvey v0.0.0-20190710185942-9d28bd7c0945 // indirect + github.com/stretchr/testify v1.7.0 github.com/textileio/go-datastore-extensions v1.0.1 - github.com/textileio/go-ds-badger v0.2.7-0.20201204225019-4ee78c4a40e2 + github.com/textileio/go-ds-badger3 v0.0.0-20210324034212-7b7fb3be3d1c github.com/textileio/go-ds-mongo v0.1.4 github.com/tidwall/gjson v1.3.5 github.com/tidwall/sjson v1.0.4 github.com/whyrusleeping/base32 v0.0.0-20170828182744-c30ac30633cc github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect github.com/xeipuuv/gojsonschema v1.2.0 + go.uber.org/goleak v1.1.10 // indirect go.uber.org/zap v1.16.0 golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5 - golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a + golang.org/x/mod v0.4.1 // indirect + golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9 google.golang.org/grpc v1.31.1 - google.golang.org/protobuf v1.25.0 // indirect + google.golang.org/protobuf v1.25.0 ) + +//replace github.com/textileio/go-ds-badger3 => ../go-ds-badger3 diff --git a/go.sum b/go.sum index f534a0e1..df5b043a 100644 --- a/go.sum +++ b/go.sum @@ -1,14 +1,14 @@ -cloud.google.com/go v0.26.0 h1:e0WKqKTd5BnrG8aKH3J3h+QvEIQtSUcf2n5UZ5ZgLtQ= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/AndreasBriese/bbloom v0.0.0-20180913140656-343706a395b7/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= -github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9 h1:HD8gA2tkByhMAwYaFAX9w2l7vxvBQ5NMoxDrkhqhtn4= github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96 h1:cTp8I5+VIoKjsnZuH8vjyaysT/ses3EvZeaV/1UkF2M= github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/DataDog/zstd v1.4.1 h1:3oxKN3wbHibqx897utPC2LTQU4J+IHWWJO+glkAkpFM= +github.com/DataDog/zstd v1.4.1/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= github.com/Kubuxu/go-os-helper v0.0.1/go.mod h1:N8B+I7vPCT80IcP58r50u4+gEEcsZETFUpAzWW2ep1Y= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -23,14 +23,12 @@ github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5 github.com/awalterschulze/gographviz v0.0.0-20190522210029-fa59802746ab/go.mod h1:GEV5wmg4YquNw7v1kkyoX9etIk8yVmXj+AkDHuuETHs= github.com/aws/aws-sdk-go v1.29.15 h1:0ms/213murpsujhsnxnNKNeVouW60aJqSd992Ks3mxs= github.com/aws/aws-sdk-go v1.29.15/go.mod h1:1KvfttTE3SPKMpo8g2c6jL3ZKfXtFvKscTgahTma5Xg= -github.com/benbjohnson/clock v1.0.2 h1:Z0CN0Yb4ig9sGPXkvAQcGJfnrrMQ5QYLCMPRi9iD7YE= github.com/benbjohnson/clock v1.0.2/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= github.com/benbjohnson/clock v1.0.3 h1:vkLuvpK4fmtSCuo60+yC63p7y0BmQ8gm5ZXGuBCJyXg= github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= github.com/btcsuite/btcd v0.0.0-20190213025234-306aecffea32/go.mod h1:DrZx5ec/dmnfpw9KyYoQyYo7d0KEvTkk/5M/vbZjAr8= github.com/btcsuite/btcd v0.0.0-20190523000118-16327141da8c/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI= github.com/btcsuite/btcd v0.0.0-20190605094302-a0d1e3e36d50/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI= -github.com/btcsuite/btcd v0.0.0-20190824003749-130ea5bddde3 h1:A/EVblehb75cUgXA5njHPn0kLAsykn6mJGz7rnmW5W0= github.com/btcsuite/btcd v0.0.0-20190824003749-130ea5bddde3/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI= github.com/btcsuite/btcd v0.20.1-beta h1:Ik4hyJqN8Jfyv3S4AGBOmyouMsYE3EdYODkMbQjwPGw= github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= @@ -55,9 +53,11 @@ github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3Ee github.com/coreos/go-semver v0.2.1-0.20180108230905-e214231b295a/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/cosiner/argv v0.1.0/go.mod h1:EusR6TucWKX+zFgtdUsKT2Cvg45K5rtpCcWz4hK06d8= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/crackcomm/go-gitignore v0.0.0-20170627025303-887ab5e44cc3 h1:HVTnpeuvF6Owjd5mniCL8DEXo7uYXdQEmOP4FJbV5tg= github.com/crackcomm/go-gitignore v0.0.0-20170627025303-887ab5e44cc3/go.mod h1:p1d6YEZWvFzEh4KLyvBcVSnrfNDDvK2zfK/4x2v/4pE= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cskr/pubsub v1.0.2 h1:vlOzMhl6PFn60gRlTQQsIfVwaPB/B/8MziK8FhEPt/0= github.com/cskr/pubsub v1.0.2/go.mod h1:/8MzYXk/NJAz782G8RPkFzXTZVu63VotefPnR9TIRis= github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -69,16 +69,16 @@ github.com/davidlazar/go-crypto v0.0.0-20170701192655-dcfb0a7ac018/go.mod h1:rQY github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= github.com/dgraph-io/badger v1.5.5-0.20190226225317-8115aed38f8f/go.mod h1:VZxzAIRPHRVNRKRo6AXrX9BJegn6il06VMTZVJYCIjQ= -github.com/dgraph-io/badger v1.6.0-rc1 h1:JphPpoBZJ3WHha133BGYlQqltSGIhV+VsEID0++nN9A= github.com/dgraph-io/badger v1.6.0-rc1/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= -github.com/dgraph-io/badger v1.6.0 h1:DshxFxZWXUcO0xX476VJC07Xsr6ZCBVRHKZ93Oh7Evo= github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= -github.com/dgraph-io/badger v1.6.1 h1:w9pSFNSdq/JPM1N12Fz/F/bzo993Is1W+Q7HjPzi7yg= github.com/dgraph-io/badger v1.6.1/go.mod h1:FRmFw3uxvcpa8zG3Rxs0th+hCLIuaQg8HlNV5bjgnuU= github.com/dgraph-io/badger v1.6.2 h1:mNw0qs90GVgGGWylh0umH5iag1j6n/PeJtNvL6KY/x8= github.com/dgraph-io/badger v1.6.2/go.mod h1:JW2yswe3V058sS0kZ2h/AXeDSqFjxnZcRrVH//y2UQE= -github.com/dgraph-io/ristretto v0.0.2 h1:a5WaUrDa0qm0YrAAS1tUykT5El3kt62KNZZeMxQn3po= +github.com/dgraph-io/badger/v3 v3.2011.1 h1:Hmyof0WMEF/QtutX5SQHzIMnJQxb/IrSzhjckV2SD6g= +github.com/dgraph-io/badger/v3 v3.2011.1/go.mod h1:0rLLrQpKVQAL0or/lBLMQznhr6dWWX7h5AKnmnqx268= github.com/dgraph-io/ristretto v0.0.2/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= +github.com/dgraph-io/ristretto v0.0.4-0.20210122082011-bb5d392ed82d h1:eQYOG6A4td1tht0NdJB9Ls6DsXRGb2Ft6X9REU/MbbE= +github.com/dgraph-io/ristretto v0.0.4-0.20210122082011-bb5d392ed82d/go.mod h1:tv2ec8nA7vRpSYX7/MbP52ihrUMXIHit54CQMq8npXQ= github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-farm v0.0.0-20190104051053-3adb47b1fb0f/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= @@ -96,17 +96,31 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/evanphx/json-patch v4.5.0+incompatible h1:ouOWdg56aJriqS0huScTkVXPC5IcNrDCXZ6OoTAWu7M= github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d5 h1:BBso6MBKW8ncyZLv37o+KNyy0HrrHgfnOaGQC2qvN+A= github.com/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d5/go.mod h1:JpoxHjuQauoxiFMl1ie8Xc/7TfLuMZ5eOCONd1sUBHg= github.com/flynn/noise v0.0.0-20180327030543-2492fe189ae6 h1:u/UEqS66A5ckRmS4yNpjmVH56sVtS/RfclBAYocb4as= github.com/flynn/noise v0.0.0-20180327030543-2492fe189ae6/go.mod h1:1i71OnUq3iUe1ma7Lr6yG6/rjvM3emb6yoL7xLFzcVQ= -github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/go-check/check v0.0.0-20180628173108-788fd7840127 h1:0gkP6mzaMqkmpcJYCFOLkIBwI7xFExG03bbkOkCvUPI= +github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/gin-contrib/location v0.0.2 h1:QZKh1+K/LLR4KG/61eIO3b7MLuKi8tytQhV6texLgP4= +github.com/gin-contrib/location v0.0.2/go.mod h1:NGoidiRlf0BlA/VKSVp+g3cuSMeTmip/63PhEjRhUAc= +github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= +github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= +github.com/gin-gonic/gin v1.6.3 h1:ahKqKTFpO5KTPHxWZjEdPScmYaGtLo8Y4DMHoEsnp14= +github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= +github.com/go-delve/delve v1.5.0/go.mod h1:c6b3a1Gry6x8a4LGCe/CWzrocrfaHvkUxCj3k4bvSUQ= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= +github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= +github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= +github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= +github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= +github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= +github.com/go-playground/validator/v10 v10.2.0 h1:KgJ0snyC2R9VXYN2rneOtQcw5aHQB1Vv0sFl1UcHBOY= +github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= github.com/go-sourcemap/sourcemap v2.1.3+incompatible h1:W1iEw64niKVGogNgBN3ePyLFfuisuzeidWPMPWmECqU= github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= @@ -136,30 +150,25 @@ github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWe github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= -github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a h1:dR8+Q0uO5S2ZBcs2IH6VBKYwSxPo2vYCYq0ot0mu7xA= github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/googleapis v1.3.1 h1:CzMaKrvF6Qa7XtRii064vKBQiyvmY8H8vG1xa1/W1JA= github.com/gogo/googleapis v1.3.1/go.mod h1:d+q1s/xVJxZGKWwC/6UfPIF33J+G1Tq4GYv9Y+Tg/EU= github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/gogo/protobuf v1.3.0 h1:G8O7TerXerS4F6sx9OV7/nRfJdnXgHZu/S/7F2SN+UE= github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/gogo/status v1.1.0 h1:+eIkrewn5q6b30y+g/BJINVVdi2xH7je5MPJ3ZPK3JA= github.com/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 h1:ZgQEtGgCBiWRM39fZuwSd1LwSqqSW0hOdXCYYDX0R3I= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= -github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= @@ -169,33 +178,31 @@ github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvq github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db h1:woRePGFeVFfLKN/pOkfl+p/TAqKOfFu+7KPlMVpok/w= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/flatbuffers v1.12.0 h1:/PtAHvnBY4Kqnx/xCQ3OIV9uYcSFGScBsWI3Oogeh6w= +github.com/google/flatbuffers v1.12.0/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0 h1:/QaMHBdZ26BB3SSst0Iwl10Epc+xhTquomWX0oZEB6w= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/gopacket v1.1.17 h1:rMrlX2ZY2UbvT+sdz3+6J+pp2z+msCq9MxTU6ymxbBY= +github.com/google/go-dap v0.2.0/go.mod h1:5q8aYQFnHOAZEMP+6vmq25HKYAEwE+LF5yh7JKrrhSQ= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gopacket v1.1.17/go.mod h1:UdDNZ1OO62aGYVnPhxT1U6aI7ukYtA/kB8vaU0diBUM= github.com/google/gopacket v1.1.18 h1:lum7VRA9kdlvBi7/v2p7/zcbkduHaCH/SVVyurs7OpY= github.com/google/gopacket v1.1.18/go.mod h1:UdDNZ1OO62aGYVnPhxT1U6aI7ukYtA/kB8vaU0diBUM= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= +github.com/google/uuid v1.2.0 h1:qJYtXnJRWmpe7m/3XlyhrsLrEURqHRM2kxzoxXqyUDs= +github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c h1:7lF+Vz0LqiRidnzC1Oq86fpX1q/iEv2KJdrCtttYjT4= github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gorilla/websocket v1.4.1 h1:q7AeDBpnBk8AogcD4DSag/Ukw/KV+YhzLj2bP5HvKCM= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= @@ -212,7 +219,6 @@ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/hsanjuan/ipfs-lite v1.1.17 h1:Rk/QZD9TeSbRIm+7FbziZPMXRHr7XNVRx+YRJnLWQLc= github.com/hsanjuan/ipfs-lite v1.1.17/go.mod h1:ZetJanzQEAqWj+OwzIppE/S7x+Azu4WFF6PNMLnQGoY= @@ -228,9 +234,7 @@ github.com/ipfs/bbloom v0.0.4/go.mod h1:cS9YprKXpoZ9lT0n/Mw/a6/aFV6DTjTLYHeA+gyq github.com/ipfs/go-bitswap v0.0.9/go.mod h1:kAPf5qgn2W2DrgAcscZ3HrM9qh4pH+X8Fkk3UPrwvis= github.com/ipfs/go-bitswap v0.1.0/go.mod h1:FFJEf18E9izuCqUtHxbWEvq+reg7o4CW5wSAE1wsxj0= github.com/ipfs/go-bitswap v0.1.2/go.mod h1:qxSWS4NXGs7jQ6zQvoPY3+NmOfHHG47mhkiLzBpJQIs= -github.com/ipfs/go-bitswap v0.1.3 h1:jAl9Z/TYObpGeGATUemnOZ7RYb0F/kzNVlhcYZesz+0= github.com/ipfs/go-bitswap v0.1.3/go.mod h1:YEQlFy0kkxops5Vy+OxWdRSEZIoS7I7KDIwoa5Chkps= -github.com/ipfs/go-bitswap v0.1.8 h1:38X1mKXkiU6Nzw4TOSWD8eTVY5eX3slQunv3QEWfXKg= github.com/ipfs/go-bitswap v0.1.8/go.mod h1:TOWoxllhccevbWFUR2N7B1MTSVVge1s6XSMiCSA4MzM= github.com/ipfs/go-bitswap v0.2.20/go.mod h1:C7TwBgHnu89Q8sHsTJP7IhUqF9XYLe71P4tT5adgmYo= github.com/ipfs/go-bitswap v0.3.3 h1:CrTO3OiOYFBcdliw074/C7T2QYHEOsPClgvR6RIYcO4= @@ -240,18 +244,14 @@ github.com/ipfs/go-block-format v0.0.2 h1:qPDvcP19izTjU8rgo6p7gTXZlkMkF5bz5G3fqI github.com/ipfs/go-block-format v0.0.2/go.mod h1:AWR46JfpcObNfg3ok2JHDUfdiHRgWhJgCQF+KIgOPJY= github.com/ipfs/go-blockservice v0.0.7/go.mod h1:EOfb9k/Y878ZTRY/CH0x5+ATtaipfbRhbvNSdgc/7So= github.com/ipfs/go-blockservice v0.1.0/go.mod h1:hzmMScl1kXHg3M2BjTymbVPjv627N7sYcvYaKbop39M= -github.com/ipfs/go-blockservice v0.1.2 h1:fqFeeu1EG0lGVrqUo+BVJv7LZV31I4ZsyNthCOMAJRc= github.com/ipfs/go-blockservice v0.1.2/go.mod h1:t+411r7psEUhLueM8C7aPA7cxCclv4O3VsUVxt9kz2I= -github.com/ipfs/go-blockservice v0.1.3 h1:9XgsPMwwWJSC9uVr2pMDsW2qFTBSkxpGMhmna8mIjPM= github.com/ipfs/go-blockservice v0.1.3/go.mod h1:OTZhFpkgY48kNzbgyvcexW9cHrpjBYIjSR0KoDOFOLU= github.com/ipfs/go-blockservice v0.1.4 h1:Vq+MlsH8000KbbUciRyYMEw/NNP8UAGmcqKi4uWmFGA= github.com/ipfs/go-blockservice v0.1.4/go.mod h1:OTZhFpkgY48kNzbgyvcexW9cHrpjBYIjSR0KoDOFOLU= github.com/ipfs/go-cid v0.0.1/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM= github.com/ipfs/go-cid v0.0.2/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM= -github.com/ipfs/go-cid v0.0.3 h1:UIAh32wymBpStoe83YCzwVQQ5Oy/H0FdxvUS6DJDzms= github.com/ipfs/go-cid v0.0.3/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM= github.com/ipfs/go-cid v0.0.4/go.mod h1:4LLaPOQwmk5z9LBgQnpkivrx8BJjUyGwTXCd5Xfj6+M= -github.com/ipfs/go-cid v0.0.5 h1:o0Ix8e/ql7Zb5UVUJEUfjsWCIY8t48++9lR8qi6oiJU= github.com/ipfs/go-cid v0.0.5/go.mod h1:plgt+Y5MnOey4vO4UlUazGqdbEXuFYitED67FexhXog= github.com/ipfs/go-cid v0.0.6/go.mod h1:6Ux9z5e+HpkQdckYoX1PG/6xqKspzlEIR5SDmgqgC/I= github.com/ipfs/go-cid v0.0.7 h1:ysQJVJA3fNDF1qigJbsSQOdjhVLsOEoPdh0+R97k3jY= @@ -266,38 +266,31 @@ github.com/ipfs/go-datastore v0.3.1/go.mod h1:w38XXW9kVFNp57Zj5knbKWM2T+KOZCGDRV github.com/ipfs/go-datastore v0.4.0/go.mod h1:SX/xMIKoCszPqp+z9JhPYCmoOoXTvaa13XEbGtsFUhA= github.com/ipfs/go-datastore v0.4.1/go.mod h1:SX/xMIKoCszPqp+z9JhPYCmoOoXTvaa13XEbGtsFUhA= github.com/ipfs/go-datastore v0.4.2/go.mod h1:SX/xMIKoCszPqp+z9JhPYCmoOoXTvaa13XEbGtsFUhA= -github.com/ipfs/go-datastore v0.4.4 h1:rjvQ9+muFaJ+QZ7dN5B1MSDNQ0JVZKkkES/rMZmA8X8= github.com/ipfs/go-datastore v0.4.4/go.mod h1:SX/xMIKoCszPqp+z9JhPYCmoOoXTvaa13XEbGtsFUhA= github.com/ipfs/go-datastore v0.4.5 h1:cwOUcGMLdLPWgu3SlrCckCMznaGADbPqE0r8h768/Dg= github.com/ipfs/go-datastore v0.4.5/go.mod h1:eXTcaaiN6uOlVCLS9GjJUJtlvJfM3xk23w3fyfrmmJs= github.com/ipfs/go-detect-race v0.0.1 h1:qX/xay2W3E4Q1U7d9lNs1sU9nvguX0a7319XbyQ6cOk= github.com/ipfs/go-detect-race v0.0.1/go.mod h1:8BNT7shDZPo99Q74BpGMK+4D8Mn4j46UU0LZ723meps= github.com/ipfs/go-ds-badger v0.0.2/go.mod h1:Y3QpeSFWQf6MopLTiZD+VT6IC1yZqaGmjvRcKeSGij8= -github.com/ipfs/go-ds-badger v0.0.5 h1:dxKuqw5T1Jm8OuV+lchA76H9QZFyPKZeLuT6bN42hJQ= github.com/ipfs/go-ds-badger v0.0.5/go.mod h1:g5AuuCGmr7efyzQhLL8MzwqcauPojGPUaHzfGTzuE3s= -github.com/ipfs/go-ds-badger v0.0.7 h1:NMyh88Q50HG6/S2YD58DLkq0c0/ZQPMbSojONH+PRf4= github.com/ipfs/go-ds-badger v0.0.7/go.mod h1:qt0/fWzZDoPW6jpQeqUjR5kBfhDNB65jd9YlmAvpQBk= github.com/ipfs/go-ds-badger v0.2.1/go.mod h1:Tx7l3aTph3FMFrRS838dcSJh+jjA7cX9DrGVwx/NOwE= github.com/ipfs/go-ds-badger v0.2.3/go.mod h1:pEYw0rgg3FIrywKKnL+Snr+w/LjJZVMTBRn4FS6UHUk= github.com/ipfs/go-ds-badger v0.2.6 h1:Hy8jw4rifxtRDrqpvC1yh36oIyE37KDzsUzlHUPOFiU= github.com/ipfs/go-ds-badger v0.2.6/go.mod h1:02rnztVKA4aZwDuaRPTf8mpqcKmXP7mLl6JPxd14JHA= github.com/ipfs/go-ds-leveldb v0.0.1/go.mod h1:feO8V3kubwsEF22n0YRQCffeb79OOYIykR4L04tMOYc= -github.com/ipfs/go-ds-leveldb v0.1.0 h1:OsCuIIh1LMTk4WIQ1UJH7e3j01qlOP+KWVhNS6lBDZY= github.com/ipfs/go-ds-leveldb v0.1.0/go.mod h1:hqAW8y4bwX5LWcCtku2rFNX3vjDZCy5LZCg+cSZvYb8= github.com/ipfs/go-ds-leveldb v0.4.1/go.mod h1:jpbku/YqBSsBc1qgME8BkWS4AxzF2cEu1Ii2r79Hh9s= github.com/ipfs/go-ds-leveldb v0.4.2 h1:QmQoAJ9WkPMUfBLnu1sBVy0xWWlJPg0m4kRAiJL9iaw= github.com/ipfs/go-ds-leveldb v0.4.2/go.mod h1:jpbku/YqBSsBc1qgME8BkWS4AxzF2cEu1Ii2r79Hh9s= github.com/ipfs/go-ipfs-blockstore v0.0.1/go.mod h1:d3WClOmRQKFnJ0Jz/jj/zmksX0ma1gROTlovZKBmN08= -github.com/ipfs/go-ipfs-blockstore v0.1.0 h1:V1GZorHFUIB6YgTJQdq7mcaIpUfCM3fCyVi+MTo9O88= github.com/ipfs/go-ipfs-blockstore v0.1.0/go.mod h1:5aD0AvHPi7mZc6Ci1WCAhiBQu2IsfTduLl+422H6Rqw= github.com/ipfs/go-ipfs-blockstore v0.1.4/go.mod h1:Jxm3XMVjh6R17WvxFEiyKBLUGr86HgIYJW/D/MwqeYQ= -github.com/ipfs/go-ipfs-blockstore v1.0.1 h1:fnuVj4XdZp4yExhd0CnUwAiMNJHiPnfInhiuwz4lW1w= github.com/ipfs/go-ipfs-blockstore v1.0.1/go.mod h1:MGNZlHNEnR4KGgPHM3/k8lBySIOK2Ve+0KjZubKlaOE= github.com/ipfs/go-ipfs-blockstore v1.0.3 h1:RDhK6fdg5YsonkpMuMpdvk/pRtOQlrIRIybuQfkvB2M= github.com/ipfs/go-ipfs-blockstore v1.0.3/go.mod h1:MGNZlHNEnR4KGgPHM3/k8lBySIOK2Ve+0KjZubKlaOE= github.com/ipfs/go-ipfs-blocksutil v0.0.1 h1:Eh/H4pc1hsvhzsQoMEP3Bke/aW5P5rVM1IWFJMcGIPQ= github.com/ipfs/go-ipfs-blocksutil v0.0.1/go.mod h1:Yq4M86uIOmxmGPUHv/uI7uKqZNtLb449gwKqXjIsnRk= -github.com/ipfs/go-ipfs-chunker v0.0.1 h1:cHUUxKFQ99pozdahi+uSC/3Y6HeRpi9oTeUHbE27SEw= github.com/ipfs/go-ipfs-chunker v0.0.1/go.mod h1:tWewYK0we3+rMbOh7pPFGDyypCtvGcBFymgY4rSDLAw= github.com/ipfs/go-ipfs-chunker v0.0.5 h1:ojCf7HV/m+uS2vhUGWcogIIxiO5ubl5O57Q7NapWLY8= github.com/ipfs/go-ipfs-chunker v0.0.5/go.mod h1:jhgdF8vxRHycr00k13FM8Y0E+6BoalYeobXmUyTreP8= @@ -306,7 +299,6 @@ github.com/ipfs/go-ipfs-config v0.10.0/go.mod h1:Ei/FLgHGTdPyqCPK0oPCwGTe8VSnsjJ github.com/ipfs/go-ipfs-delay v0.0.0-20181109222059-70721b86a9a8/go.mod h1:8SP1YXK1M1kXuc4KJZINY3TQQ03J2rwBG9QfXmbRPrw= github.com/ipfs/go-ipfs-delay v0.0.1 h1:r/UXYyRcddO6thwOnhiznIAiSvxMECGgtv35Xs1IeRQ= github.com/ipfs/go-ipfs-delay v0.0.1/go.mod h1:8SP1YXK1M1kXuc4KJZINY3TQQ03J2rwBG9QfXmbRPrw= -github.com/ipfs/go-ipfs-ds-help v0.0.1 h1:QBg+Ts2zgeemK/dB0saiF/ykzRGgfoFMT90Rzo0OnVU= github.com/ipfs/go-ipfs-ds-help v0.0.1/go.mod h1:gtP9xRaZXqIQRh1HRpp595KbBEdgqWFxefeVKOV8sxo= github.com/ipfs/go-ipfs-ds-help v0.1.1/go.mod h1:SbBafGJuGsPI/QL3j9Fc5YPLeAu+SzOkI0gFwAg+mOs= github.com/ipfs/go-ipfs-ds-help v1.0.0 h1:bEQ8hMGs80h0sR8O4tfDgV6B01aaF9qeTrujrTLYV3g= @@ -315,13 +307,11 @@ github.com/ipfs/go-ipfs-exchange-interface v0.0.1 h1:LJXIo9W7CAmugqI+uofioIpRb6r github.com/ipfs/go-ipfs-exchange-interface v0.0.1/go.mod h1:c8MwfHjtQjPoDyiy9cFquVtVHkO9b9Ob3FG91qJnWCM= github.com/ipfs/go-ipfs-exchange-offline v0.0.1 h1:P56jYKZF7lDDOLx5SotVh5KFxoY6C81I1NSHW1FxGew= github.com/ipfs/go-ipfs-exchange-offline v0.0.1/go.mod h1:WhHSFCVYX36H/anEKQboAzpUws3x7UeEGkzQc3iNkM0= -github.com/ipfs/go-ipfs-files v0.0.3 h1:ME+QnC3uOyla1ciRPezDW0ynQYK2ikOh9OCKAEg4uUA= github.com/ipfs/go-ipfs-files v0.0.3/go.mod h1:INEFm0LL2LWXBhNJ2PMIIb2w45hpXgPjNoE7yA8Y1d4= github.com/ipfs/go-ipfs-files v0.0.8 h1:8o0oFJkJ8UkO/ABl8T6ac6tKF3+NIpj67aAB6ZpusRg= github.com/ipfs/go-ipfs-files v0.0.8/go.mod h1:wiN/jSG8FKyk7N0WyctKSvq3ljIa2NNTiZB55kpTdOs= github.com/ipfs/go-ipfs-posinfo v0.0.1 h1:Esoxj+1JgSjX0+ylc0hUmJCOv6V2vFoZiETLR6OtpRs= github.com/ipfs/go-ipfs-posinfo v0.0.1/go.mod h1:SwyeVP+jCwiDu0C313l/8jg6ZxM0qqtlt2a0vILTc1A= -github.com/ipfs/go-ipfs-pq v0.0.1 h1:zgUotX8dcAB/w/HidJh1zzc1yFq6Vm8J7T2F4itj/RU= github.com/ipfs/go-ipfs-pq v0.0.1/go.mod h1:LWIqQpqfRG3fNc5XsnIhz/wQ2XXGyugQwls7BgUmUfY= github.com/ipfs/go-ipfs-pq v0.0.2 h1:e1vOOW6MuOwG2lqxcLA+wEn93i/9laCY8sXAw76jFOY= github.com/ipfs/go-ipfs-pq v0.0.2/go.mod h1:LWIqQpqfRG3fNc5XsnIhz/wQ2XXGyugQwls7BgUmUfY= @@ -330,25 +320,20 @@ github.com/ipfs/go-ipfs-provider v0.4.3/go.mod h1:rcQBVqfblDQRk5LaCtf2uxuKxMJxvK github.com/ipfs/go-ipfs-routing v0.0.1/go.mod h1:k76lf20iKFxQTjcJokbPM9iBXVXVZhcOwc360N4nuKs= github.com/ipfs/go-ipfs-routing v0.1.0 h1:gAJTT1cEeeLj6/DlLX6t+NxD9fQe2ymTO6qWRDI/HQQ= github.com/ipfs/go-ipfs-routing v0.1.0/go.mod h1:hYoUkJLyAUKhF58tysKpids8RNDPO42BVMgK5dNsoqY= -github.com/ipfs/go-ipfs-util v0.0.1 h1:Wz9bL2wB2YBJqggkA4dD7oSmqB4cAnpNbGrlHJulv50= github.com/ipfs/go-ipfs-util v0.0.1/go.mod h1:spsl5z8KUnrve+73pOhSVZND1SIxPW5RyBCNzQxlJBc= github.com/ipfs/go-ipfs-util v0.0.2 h1:59Sswnk1MFaiq+VcaknX7aYEyGyGDAA73ilhEK2POp8= github.com/ipfs/go-ipfs-util v0.0.2/go.mod h1:CbPtkWJzjLdEcezDns2XYaehFVNXG9zrdrtMecczcsQ= github.com/ipfs/go-ipld-cbor v0.0.2/go.mod h1:wTBtrQZA3SoFKMVkp6cn6HMRteIB1VsmHA0AQFOn7Nc= -github.com/ipfs/go-ipld-cbor v0.0.3 h1:ENsxvybwkmke7Z/QJOmeJfoguj6GH3Y0YOaGrfy9Q0I= github.com/ipfs/go-ipld-cbor v0.0.3/go.mod h1:wTBtrQZA3SoFKMVkp6cn6HMRteIB1VsmHA0AQFOn7Nc= -github.com/ipfs/go-ipld-cbor v0.0.4 h1:Aw3KPOKXjvrm6VjwJvFf1F1ekR/BH3jdof3Bk7OTiSA= github.com/ipfs/go-ipld-cbor v0.0.4/go.mod h1:BkCduEx3XBCO6t2Sfo5BaHzuok7hbhdMm9Oh8B2Ftq4= github.com/ipfs/go-ipld-cbor v0.0.5 h1:ovz4CHKogtG2KB/h1zUp5U0c/IzZrL435rCh5+K/5G8= github.com/ipfs/go-ipld-cbor v0.0.5/go.mod h1:BkCduEx3XBCO6t2Sfo5BaHzuok7hbhdMm9Oh8B2Ftq4= github.com/ipfs/go-ipld-format v0.0.1/go.mod h1:kyJtbkDALmFHv3QR6et67i35QzO3S0dCDnkOJhcZkms= -github.com/ipfs/go-ipld-format v0.0.2 h1:OVAGlyYT6JPZ0pEfGntFPS40lfrDmaDbQwNHEY2G9Zs= github.com/ipfs/go-ipld-format v0.0.2/go.mod h1:4B6+FM2u9OJ9zCV+kSbgFAZlOrv1Hqbf0INGQgiKf9k= github.com/ipfs/go-ipld-format v0.2.0 h1:xGlJKkArkmBvowr+GMCX0FEZtkro71K1AwiKnL37mwA= github.com/ipfs/go-ipld-format v0.2.0/go.mod h1:3l3C1uKoadTPbeNfrDi+xMInYKlx2Cvg1BuydPSdzQs= github.com/ipfs/go-ipns v0.0.2 h1:oq4ErrV4hNQ2Eim257RTYRgfOSV/s8BDaf9iIl4NwFs= github.com/ipfs/go-ipns v0.0.2/go.mod h1:WChil4e0/m9cIINWLxZe1Jtf77oz5L05rO2ei/uKJ5U= -github.com/ipfs/go-log v0.0.1 h1:9XTUN/rW64BCG1YhPK9Hoy3q8nr4gOmHHBpgFdfw6Lc= github.com/ipfs/go-log v0.0.1/go.mod h1:kL1d2/hzSpI0thNYjiKfjanbVNU+IIGA/WnNESY9leM= github.com/ipfs/go-log v1.0.2/go.mod h1:1MNjMxe0u6xvJZgeqbJ8vdo2TKaGwZ1a0Bpza+sr2Sk= github.com/ipfs/go-log v1.0.3/go.mod h1:OsLySYkwIbiSUR/yBTdv1qPtcE4FW3WPWk/ewz9Ru+A= @@ -356,12 +341,10 @@ github.com/ipfs/go-log v1.0.4 h1:6nLQdX4W8P9yZZFH7mO+X/PzjN8Laozm/lMJ6esdgzY= github.com/ipfs/go-log v1.0.4/go.mod h1:oDCg2FkjogeFOhqqb+N39l2RpTNPL6F/StPkB3kPgcs= github.com/ipfs/go-log/v2 v2.0.2/go.mod h1:O7P1lJt27vWHhOwQmcFEvlmo49ry2VY2+JfBWFaa9+0= github.com/ipfs/go-log/v2 v2.0.3/go.mod h1:O7P1lJt27vWHhOwQmcFEvlmo49ry2VY2+JfBWFaa9+0= -github.com/ipfs/go-log/v2 v2.0.5 h1:fL4YI+1g5V/b1Yxr1qAiXTMg1H8z9vx/VmJxBuQMHvU= github.com/ipfs/go-log/v2 v2.0.5/go.mod h1:eZs4Xt4ZUJQFM3DlanGhy7TkwwawCZcSByscwkWG+dw= github.com/ipfs/go-log/v2 v2.1.1 h1:G4TtqN+V9y9HY9TA6BwbCVyyBZ2B9MbCjR2MtGx8FR0= github.com/ipfs/go-log/v2 v2.1.1/go.mod h1:2v2nsGfZsvvAJz13SyFzf9ObaqwHiHxsPLEHntrv9KM= github.com/ipfs/go-merkledag v0.0.6/go.mod h1:QYPdnlvkOg7GnQRofu9XZimC5ZW5Wi3bKys/4GQQfto= -github.com/ipfs/go-merkledag v0.2.3 h1:aMdkK9G1hEeNvn3VXfiEMLY0iJnbiQQUHnM0HFJREsE= github.com/ipfs/go-merkledag v0.2.3/go.mod h1:SQiXrtSts3KGNmgOzMICy5c0POOpUNQLvB3ClKnBAlk= github.com/ipfs/go-merkledag v0.3.2 h1:MRqj40QkrWkvPswXs4EfSslhZ4RVPRbxwX11js0t1xY= github.com/ipfs/go-merkledag v0.3.2/go.mod h1:fvkZNNZixVW6cKSZ/JfLlON5OlgTXNdRLz0p6QG/I2M= @@ -370,7 +353,6 @@ github.com/ipfs/go-metrics-interface v0.0.1/go.mod h1:6s6euYU4zowdslK0GKHmqaIZ3j github.com/ipfs/go-path v0.0.7/go.mod h1:6KTKmeRnBXgqrTvzFrPV3CamxcgvXX/4z79tfAd2Sno= github.com/ipfs/go-peertaskqueue v0.0.4/go.mod h1:03H8fhyeMfKNFWqzYEVyMbcPUeYrqP1MX6Kd+aN+rMQ= github.com/ipfs/go-peertaskqueue v0.1.0/go.mod h1:Jmk3IyCcfl1W3jTW3YpghSwSEC6IJ3Vzz/jUmWw8Z0U= -github.com/ipfs/go-peertaskqueue v0.1.1 h1:+gPjbI+V3NktXZOqJA1kzbms2pYmhjgQQal0MzZrOAY= github.com/ipfs/go-peertaskqueue v0.1.1/go.mod h1:Jmk3IyCcfl1W3jTW3YpghSwSEC6IJ3Vzz/jUmWw8Z0U= github.com/ipfs/go-peertaskqueue v0.2.0 h1:2cSr7exUGKYyDeUyQ7P/nHPs9P7Ht/B+ROrpN1EJOjc= github.com/ipfs/go-peertaskqueue v0.2.0/go.mod h1:5/eNrBEbtSKWCG+kQK8K8fGNixoYUnr+P7jivavs9lY= @@ -380,21 +362,17 @@ github.com/ipfs/go-verifcid v0.0.1 h1:m2HI7zIuR5TFyQ1b79Da5N9dnnCP1vcu2QqawmWlK2 github.com/ipfs/go-verifcid v0.0.1/go.mod h1:5Hrva5KBeIog4A+UpqlaIU+DEstipcJYQQZc0g37pY0= github.com/ipfs/interface-go-ipfs-core v0.4.0 h1:+mUiamyHIwedqP8ZgbCIwpy40oX7QcXUbo4CZOeJVJg= github.com/ipfs/interface-go-ipfs-core v0.4.0/go.mod h1:UJBcU6iNennuI05amq3FQ7g0JHUkibHFAfhfUIy927o= -github.com/jackpal/gateway v1.0.5 h1:qzXWUJfuMdlLMtt0a3Dgt+xkWQiA5itDEITVJtuSwMc= github.com/jackpal/gateway v1.0.5/go.mod h1:lTpwd4ACLXmpyiCTRtfiNyVnUmqT9RivzCDQetPfnjA= -github.com/jackpal/go-nat-pmp v1.0.1 h1:i0LektDkO1QlrTm/cSuP+PyBCDnYvjPLGl4LdWEMiaA= github.com/jackpal/go-nat-pmp v1.0.1/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= github.com/jbenet/go-cienv v0.0.0-20150120210510-1bb1476777ec/go.mod h1:rGaEvXB4uRSZMmzKNLoXvTu1sfx+1kv/DojUlPrSZGs= github.com/jbenet/go-cienv v0.1.0 h1:Vc/s0QbQtoxX8MwwSLWWh+xNNZvM3Lw7NsTcHrvvhMc= github.com/jbenet/go-cienv v0.1.0/go.mod h1:TqNnHUmJgXau0nCzC7kXWeotg3J9W34CUv5Djy1+FlA= -github.com/jbenet/go-temp-err-catcher v0.0.0-20150120210811-aac704a3f4f2 h1:vhC1OXXiT9R2pczegwz6moDvuRpggaroAXhPIseh57A= github.com/jbenet/go-temp-err-catcher v0.0.0-20150120210811-aac704a3f4f2/go.mod h1:8GXXJV31xl8whumTzdZsTt3RnUIiPqzkyf7mxToRCMs= github.com/jbenet/go-temp-err-catcher v0.1.0 h1:zpb3ZH6wIE8Shj2sKS+khgRvf7T7RABoLk/+KKHggpk= github.com/jbenet/go-temp-err-catcher v0.1.0/go.mod h1:0kJRvmDZXNMIiJirNPEYfhpPwbGVtZVWC34vc5WLsDk= github.com/jbenet/goprocess v0.0.0-20160826012719-b497e2f366b8/go.mod h1:Ly/wlsjFq/qrU3Rar62tu1gASgGw6chQbSh/XgIIXCY= -github.com/jbenet/goprocess v0.1.3 h1:YKyIEECS/XvcfHtBzxtjBBbWK+MbvA6dG8ASiqwvr10= github.com/jbenet/goprocess v0.1.3/go.mod h1:5yspPrukOVuOLORacaBi858NqyClJPQxYZlqdZVfqY4= github.com/jbenet/goprocess v0.1.4 h1:DRGOFReOMqqDNXwW70QkacFW0YN9QnwLV0Vqk+3oU0o= github.com/jbenet/goprocess v0.1.4/go.mod h1:5yspPrukOVuOLORacaBi858NqyClJPQxYZlqdZVfqY4= @@ -404,7 +382,8 @@ github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5i github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= -github.com/jtolds/gls v4.2.1+incompatible h1:fSuqC+Gmlu6l/ZYAoZzx2pyucC8Xza35fpRVWLVmUEE= +github.com/json-iterator/go v1.1.9 h1:9yzud/Ht36ygwatGx56VwCZtlI/2AD15T1X2sjSuGns= +github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= @@ -413,26 +392,26 @@ github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaR github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= github.com/klauspost/compress v1.9.5 h1:U+CaK85mrNNb4k8BNOfgJtJ/gr6kswUCFj6miSzVC6M= github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/koron/go-ssdp v0.0.0-20180514024734-4a0ed625a78b h1:wxtKgYHEncAU00muMD06dzLiahtGM1eouRNOzVV7tdQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/koron/go-ssdp v0.0.0-20180514024734-4a0ed625a78b/go.mod h1:5Ky9EC2xfoUKUor0Hjgi2BJhCSXJfMOFlmyYrVKGQMk= github.com/koron/go-ssdp v0.0.0-20191105050749-2e1c40ed0b5d h1:68u9r4wEvL3gYg2jvAOgROwZ3H+Y3hIDk4tbbmIjcYQ= github.com/koron/go-ssdp v0.0.0-20191105050749-2e1c40ed0b5d/go.mod h1:5Ky9EC2xfoUKUor0Hjgi2BJhCSXJfMOFlmyYrVKGQMk= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/libp2p/go-addr-util v0.0.1 h1:TpTQm9cXVRVSKsYbgQ7GKc3KbbHVTnbostgGaDEP+88= +github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= +github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/libp2p/go-addr-util v0.0.1/go.mod h1:4ac6O7n9rIAKB1dnd+s8IbbMXkt+oBpzX4/+RACcnlQ= github.com/libp2p/go-addr-util v0.0.2 h1:7cWK5cdA5x72jX0g8iLrQWm5TRJZ6CzGdPEhWj7plWU= github.com/libp2p/go-addr-util v0.0.2/go.mod h1:Ecd6Fb3yIuLzq4bD7VcywcVSBtefcAwnUISBM3WG15E= @@ -443,15 +422,12 @@ github.com/libp2p/go-cidranger v1.1.0 h1:ewPN8EZ0dd1LSnrtuwd4709PXVcITVeuwbag38y github.com/libp2p/go-cidranger v1.1.0/go.mod h1:KWZTfSr+r9qEo9OkI9/SIEeAtw+NNoU0dXIXt15Okic= github.com/libp2p/go-conn-security v0.0.1/go.mod h1:bGmu51N0KU9IEjX7kl2PQjgZa40JQWnayTvNMgD/vyk= github.com/libp2p/go-conn-security-multistream v0.0.2/go.mod h1:nc9vud7inQ+d6SO0I/6dSWrdMnHnzZNHeyUQqrAJulE= -github.com/libp2p/go-conn-security-multistream v0.1.0 h1:aqGmto+ttL/uJgX0JtQI0tD21CIEy5eYd1Hlp0juHY0= github.com/libp2p/go-conn-security-multistream v0.1.0/go.mod h1:aw6eD7LOsHEX7+2hJkDxw1MteijaVcI+/eP2/x3J1xc= github.com/libp2p/go-conn-security-multistream v0.2.0 h1:uNiDjS58vrvJTg9jO6bySd1rMKejieG7v45ekqHbZ1M= github.com/libp2p/go-conn-security-multistream v0.2.0/go.mod h1:hZN4MjlNetKD3Rq5Jb/P5ohUnFLNzEAR4DLSzpn2QLU= -github.com/libp2p/go-eventbus v0.1.0 h1:mlawomSAjjkk97QnYiEmHsLu7E136+2oCWSHRUvMfzQ= github.com/libp2p/go-eventbus v0.1.0/go.mod h1:vROgu5cs5T7cv7POWlWxBaVLxfSegC5UGQf8A2eEmx4= github.com/libp2p/go-eventbus v0.2.1 h1:VanAdErQnpTioN2TowqNcOijf6YwhuODe4pPKSDpxGc= github.com/libp2p/go-eventbus v0.2.1/go.mod h1:jc2S4SoEVPP48H9Wpzm5aiGwUCBMfGhVhhBjyhhCJs8= -github.com/libp2p/go-flow-metrics v0.0.1 h1:0gxuFd2GuK7IIP5pKljLwps6TvcuYgvG7Atqi3INF5s= github.com/libp2p/go-flow-metrics v0.0.1/go.mod h1:Iv1GH0sG8DtYN3SVJ2eG221wMiNpZxBdp967ls1g+k8= github.com/libp2p/go-flow-metrics v0.0.2/go.mod h1:HeoSNUrOJVK1jEpDqVEiUOIXqhbnS27omG0uWU5slZs= github.com/libp2p/go-flow-metrics v0.0.3 h1:8tAs/hSdNvUiLgtlSy3mxwxWP4I9y/jlkPFT7epKdeM= @@ -470,32 +446,24 @@ github.com/libp2p/go-libp2p v0.12.0/go.mod h1:FpHZrfC1q7nA8jitvdjKBDF31hguaC676g github.com/libp2p/go-libp2p-asn-util v0.0.0-20200825225859-85005c6cf052 h1:BM7aaOF7RpmNn9+9g6uTjGJ0cTzWr5j9i9IKeun2M8U= github.com/libp2p/go-libp2p-asn-util v0.0.0-20200825225859-85005c6cf052/go.mod h1:nRMRTab+kZuk0LnKZpxhOVH/ndsdr2Nr//Zltc/vwgo= github.com/libp2p/go-libp2p-autonat v0.0.6/go.mod h1:uZneLdOkZHro35xIhpbtTzLlgYturpu4J5+0cZK3MqE= -github.com/libp2p/go-libp2p-autonat v0.1.0 h1:aCWAu43Ri4nU0ZPO7NyLzUvvfqd0nE3dX0R/ZGYVgOU= github.com/libp2p/go-libp2p-autonat v0.1.0/go.mod h1:1tLf2yXxiE/oKGtDwPYWTSYG3PtvYlJmg7NeVtPRqH8= -github.com/libp2p/go-libp2p-autonat v0.1.1 h1:WLBZcIRsjZlWdAZj9CiBSvU2wQXoUOiS1Zk1tM7DTJI= github.com/libp2p/go-libp2p-autonat v0.1.1/go.mod h1:OXqkeGOY2xJVWKAGV2inNF5aKN/djNA3fdpCWloIudE= github.com/libp2p/go-libp2p-autonat v0.2.0/go.mod h1:DX+9teU4pEEoZUqR1PiMlqliONQdNbfzE1C718tcViI= github.com/libp2p/go-libp2p-autonat v0.2.1/go.mod h1:MWtAhV5Ko1l6QBsHQNSuM6b1sRkXrpk0/LqCr+vCVxI= -github.com/libp2p/go-libp2p-autonat v0.2.2 h1:4dlgcEEugTFWSvdG2UIFxhnOMpX76QaZSRAtXmYB8n4= github.com/libp2p/go-libp2p-autonat v0.2.2/go.mod h1:HsM62HkqZmHR2k1xgX34WuWDzk/nBwNHoeyyT4IWV6A= -github.com/libp2p/go-libp2p-autonat v0.3.2 h1:OhDSwVVaq7liTaRIsFFYvsaPp0pn2yi0WazejZ4DUmo= github.com/libp2p/go-libp2p-autonat v0.3.2/go.mod h1:0OzOi1/cVc7UcxfOddemYD5vzEqi4fwRbnZcJGLi68U= github.com/libp2p/go-libp2p-autonat v0.4.0 h1:3y8XQbpr+ssX8QfZUHekjHCYK64sj6/4hnf/awD4+Ug= github.com/libp2p/go-libp2p-autonat v0.4.0/go.mod h1:YxaJlpr81FhdOv3W3BTconZPfhaYivRdf53g+S2wobk= github.com/libp2p/go-libp2p-blankhost v0.0.1/go.mod h1:Ibpbw/7cPPYwFb7PACIWdvxxv0t0XCCI10t7czjAjTc= github.com/libp2p/go-libp2p-blankhost v0.1.1/go.mod h1:pf2fvdLJPsC1FsVrNP3DUUvMzUts2dsLLBEpo1vW1ro= -github.com/libp2p/go-libp2p-blankhost v0.1.4 h1:I96SWjR4rK9irDHcHq3XHN6hawCRTPUADzkJacgZLvk= github.com/libp2p/go-libp2p-blankhost v0.1.4/go.mod h1:oJF0saYsAXQCSfDq254GMNmLNz6ZTHTOvtF4ZydUvwU= github.com/libp2p/go-libp2p-blankhost v0.2.0 h1:3EsGAi0CBGcZ33GwRuXEYJLLPoVWyXJ1bcJzAJjINkk= github.com/libp2p/go-libp2p-blankhost v0.2.0/go.mod h1:eduNKXGTioTuQAUcZ5epXi9vMl+t4d8ugUBRQ4SqaNQ= github.com/libp2p/go-libp2p-circuit v0.0.9/go.mod h1:uU+IBvEQzCu953/ps7bYzC/D/R0Ho2A9LfKVVCatlqU= github.com/libp2p/go-libp2p-circuit v0.1.0/go.mod h1:Ahq4cY3V9VJcHcn1SBXjr78AbFkZeIRmfunbA7pmFh8= -github.com/libp2p/go-libp2p-circuit v0.1.4 h1:Phzbmrg3BkVzbqd4ZZ149JxCuUWu2wZcXf/Kr6hZJj8= github.com/libp2p/go-libp2p-circuit v0.1.4/go.mod h1:CY67BrEjKNDhdTk8UgBX1Y/H5c3xkAcs3gnksxY7osU= -github.com/libp2p/go-libp2p-circuit v0.2.1 h1:BDiBcQxX/ZJJ/yDl3sqZt1bjj4PkZCEi7IEpwxXr13k= github.com/libp2p/go-libp2p-circuit v0.2.1/go.mod h1:BXPwYDN5A8z4OEY9sOfr2DUQMLQvKt/6oku45YUmjIo= github.com/libp2p/go-libp2p-circuit v0.2.2/go.mod h1:nkG3iE01tR3FoQ2nMm06IUrCpCyJp1Eo4A1xYdpjfs4= -github.com/libp2p/go-libp2p-circuit v0.3.1 h1:69ENDoGnNN45BNDnBd+8SXSetDuw0eJFcGmOvvtOgBw= github.com/libp2p/go-libp2p-circuit v0.3.1/go.mod h1:8RMIlivu1+RxhebipJwFDA45DasLx+kkrp4IlJj53F4= github.com/libp2p/go-libp2p-circuit v0.4.0 h1:eqQ3sEYkGTtybWgr6JLqJY6QLtPWRErvFjFDfAOO1wc= github.com/libp2p/go-libp2p-circuit v0.4.0/go.mod h1:t/ktoFIUzM6uLQ+o1G6NuBl2ANhBKN9Bc8jRIk31MoA= @@ -507,16 +475,13 @@ github.com/libp2p/go-libp2p-core v0.0.3/go.mod h1:j+YQMNz9WNSkNezXOsahp9kwZBKBvx github.com/libp2p/go-libp2p-core v0.0.4/go.mod h1:jyuCQP356gzfCFtRKyvAbNkyeuxb7OlyhWZ3nls5d2I= github.com/libp2p/go-libp2p-core v0.2.0/go.mod h1:X0eyB0Gy93v0DZtSYbEM7RnMChm9Uv3j7yRXjO77xSI= github.com/libp2p/go-libp2p-core v0.2.2/go.mod h1:8fcwTbsG2B+lTgRJ1ICZtiM5GWCWZVoVrLaDRvIRng0= -github.com/libp2p/go-libp2p-core v0.2.4 h1:Et6ykkTwI6PU44tr8qUF9k43vP0aduMNniShAbUJJw8= github.com/libp2p/go-libp2p-core v0.2.4/go.mod h1:STh4fdfa5vDYr0/SzYYeqnt+E6KfEV5VxfIrm0bcI0g= github.com/libp2p/go-libp2p-core v0.2.5/go.mod h1:6+5zJmKhsf7yHn1RbmYDu08qDUpIUxGdqHuEZckmZOA= -github.com/libp2p/go-libp2p-core v0.3.0 h1:F7PqduvrztDtFsAa/bcheQ3azmNo+Nq7m8hQY5GiUW8= github.com/libp2p/go-libp2p-core v0.3.0/go.mod h1:ACp3DmS3/N64c2jDzcV429ukDpicbL6+TrrxANBjPGw= github.com/libp2p/go-libp2p-core v0.3.1/go.mod h1:thvWy0hvaSBhnVBaW37BvzgVV68OUhgJJLAa6almrII= github.com/libp2p/go-libp2p-core v0.4.0/go.mod h1:49XGI+kc38oGVwqSBhDEwytaAxgZasHhFfQKibzTls0= github.com/libp2p/go-libp2p-core v0.5.0/go.mod h1:49XGI+kc38oGVwqSBhDEwytaAxgZasHhFfQKibzTls0= github.com/libp2p/go-libp2p-core v0.5.1/go.mod h1:uN7L2D4EvPCvzSH5SrhR72UWbnSGpt5/a35Sm4upn4Y= -github.com/libp2p/go-libp2p-core v0.5.2 h1:hevsCcdLiazurKBoeNn64aPYTVOPdY4phaEGeLtHOAs= github.com/libp2p/go-libp2p-core v0.5.2/go.mod h1:uN7L2D4EvPCvzSH5SrhR72UWbnSGpt5/a35Sm4upn4Y= github.com/libp2p/go-libp2p-core v0.5.3/go.mod h1:uN7L2D4EvPCvzSH5SrhR72UWbnSGpt5/a35Sm4upn4Y= github.com/libp2p/go-libp2p-core v0.5.4/go.mod h1:uN7L2D4EvPCvzSH5SrhR72UWbnSGpt5/a35Sm4upn4Y= @@ -524,20 +489,15 @@ github.com/libp2p/go-libp2p-core v0.5.5/go.mod h1:vj3awlOr9+GMZJFH9s4mpt9RHHgGqe github.com/libp2p/go-libp2p-core v0.5.6/go.mod h1:txwbVEhHEXikXn9gfC7/UDDw7rkxuX0bJvM49Ykaswo= github.com/libp2p/go-libp2p-core v0.5.7/go.mod h1:txwbVEhHEXikXn9gfC7/UDDw7rkxuX0bJvM49Ykaswo= github.com/libp2p/go-libp2p-core v0.6.0/go.mod h1:txwbVEhHEXikXn9gfC7/UDDw7rkxuX0bJvM49Ykaswo= -github.com/libp2p/go-libp2p-core v0.6.1 h1:XS+Goh+QegCDojUZp00CaPMfiEADCrLjNZskWE7pvqs= github.com/libp2p/go-libp2p-core v0.6.1/go.mod h1:FfewUH/YpvWbEB+ZY9AQRQ4TAD8sJBt/G1rVvhz5XT8= github.com/libp2p/go-libp2p-core v0.7.0 h1:4a0TMjrWNTZlNvcqxZmrMRDi/NQWrhwO2pkTuLSQ/IQ= github.com/libp2p/go-libp2p-core v0.7.0/go.mod h1:FfewUH/YpvWbEB+ZY9AQRQ4TAD8sJBt/G1rVvhz5XT8= github.com/libp2p/go-libp2p-crypto v0.0.1/go.mod h1:yJkNyDmO341d5wwXxDUGO0LykUVT72ImHNUqh5D/dBE= github.com/libp2p/go-libp2p-crypto v0.0.2/go.mod h1:eETI5OUfBnvARGOHrJz2eWNyTUxEGZnBxMcbUjfIj4I= -github.com/libp2p/go-libp2p-crypto v0.1.0 h1:k9MFy+o2zGDNGsaoZl0MA3iZ75qXxr9OOoAZF+sD5OQ= github.com/libp2p/go-libp2p-crypto v0.1.0/go.mod h1:sPUokVISZiy+nNuTTH/TY+leRSxnFj/2GLjtOTW90hI= github.com/libp2p/go-libp2p-discovery v0.0.5/go.mod h1:YtF20GUxjgoKZ4zmXj8j3Nb2TUSBHFlOCetzYdbZL5I= -github.com/libp2p/go-libp2p-discovery v0.1.0 h1:j+R6cokKcGbnZLf4kcNwpx6mDEUPF3N6SrqMymQhmvs= github.com/libp2p/go-libp2p-discovery v0.1.0/go.mod h1:4F/x+aldVHjHDHuX85x1zWoFTGElt8HnoDzwkFZm29g= -github.com/libp2p/go-libp2p-discovery v0.2.0 h1:1p3YSOq7VsgaL+xVHPi8XAmtGyas6D2J6rWBEfz/aiY= github.com/libp2p/go-libp2p-discovery v0.2.0/go.mod h1:s4VGaxYMbw4+4+tsoQTqh7wfxg97AEdo4GYBt6BadWg= -github.com/libp2p/go-libp2p-discovery v0.3.0 h1:+JnYBRLzZQtRq0mK3xhyjBwHytLmJXMTZkQfbw+UrGA= github.com/libp2p/go-libp2p-discovery v0.3.0/go.mod h1:o03drFnz9BVAZdzC/QUQ+NeQOu38Fu7LJGEOK2gQltw= github.com/libp2p/go-libp2p-discovery v0.4.0/go.mod h1:bZ0aJSrFc/eX2llP0ryhb1kpgkPyTo23SJ5b7UQCMh4= github.com/libp2p/go-libp2p-discovery v0.5.0 h1:Qfl+e5+lfDgwdrXdu4YNCWyEo3fWuP+WgN9mN0iWviQ= @@ -561,18 +521,13 @@ github.com/libp2p/go-libp2p-loggables v0.1.0/go.mod h1:EyumB2Y6PrYjr55Q3/tiJ/o3x github.com/libp2p/go-libp2p-metrics v0.0.1/go.mod h1:jQJ95SXXA/K1VZi13h52WZMa9ja78zjyy5rspMsC/08= github.com/libp2p/go-libp2p-mplex v0.1.1/go.mod h1:KUQWpGkCzfV7UIpi8SKsAVxyBgz1c9R5EvxgnwLsb/I= github.com/libp2p/go-libp2p-mplex v0.2.0/go.mod h1:Ejl9IyjvXJ0T9iqUTE1jpYATQ9NM3g+OtR+EMMODbKo= -github.com/libp2p/go-libp2p-mplex v0.2.1 h1:E1xaJBQnbSiTHGI1gaBKmKhu1TUKkErKJnE8iGvirYI= github.com/libp2p/go-libp2p-mplex v0.2.1/go.mod h1:SC99Rxs8Vuzrf/6WhmH41kNn13TiYdAWNYHrwImKLnE= github.com/libp2p/go-libp2p-mplex v0.2.2/go.mod h1:74S9eum0tVQdAfFiKxAyKzNdSuLqw5oadDq7+L/FELo= -github.com/libp2p/go-libp2p-mplex v0.2.3 h1:2zijwaJvpdesST2MXpI5w9wWFRgYtMcpRX7rrw0jmOo= github.com/libp2p/go-libp2p-mplex v0.2.3/go.mod h1:CK3p2+9qH9x+7ER/gWWDYJ3QW5ZxWDkm+dVvjfuG3ek= -github.com/libp2p/go-libp2p-mplex v0.2.4 h1:XFFXaN4jhqnIuJVjYOR3k6bnRj0mFfJOlIuDVww+4Zo= github.com/libp2p/go-libp2p-mplex v0.2.4/go.mod h1:mI7iOezdWFOisvUwaYd3IDrJ4oVmgoXK8H331ui39CE= github.com/libp2p/go-libp2p-mplex v0.3.0 h1:CZyqqKP0BSGQyPLvpRQougbfXaaaJZdGgzhCpJNuNSk= github.com/libp2p/go-libp2p-mplex v0.3.0/go.mod h1:l9QWxRbbb5/hQMECEb908GbS9Sm2UAR2KFZKUJEynEs= -github.com/libp2p/go-libp2p-nat v0.0.4 h1:+KXK324yaY701On8a0aGjTnw8467kW3ExKcqW2wwmyw= github.com/libp2p/go-libp2p-nat v0.0.4/go.mod h1:N9Js/zVtAXqaeT99cXgTV9e75KpnWCvVOiGzlcHmBbY= -github.com/libp2p/go-libp2p-nat v0.0.5 h1:/mH8pXFVKleflDL1YwqMg27W9GD8kjEx7NY0P6eGc98= github.com/libp2p/go-libp2p-nat v0.0.5/go.mod h1:1qubaE5bTZMJE+E/uu2URroMbzdubFz1ChgiN79yKPE= github.com/libp2p/go-libp2p-nat v0.0.6 h1:wMWis3kYynCbHoyKLPBEMu4YRLltbm8Mk08HGSfvTkU= github.com/libp2p/go-libp2p-nat v0.0.6/go.mod h1:iV59LVhB3IkFvS6S6sauVTSOrNEANnINbI/fkaLimiw= @@ -586,19 +541,15 @@ github.com/libp2p/go-libp2p-noise v0.1.2 h1:IH9GRihQJTx56obm+GnpdPX4KeVIlvpXrP6x github.com/libp2p/go-libp2p-noise v0.1.2/go.mod h1:9B10b7ueo7TIxZHHcjcDCo5Hd6kfKT2m77by82SFRfE= github.com/libp2p/go-libp2p-peer v0.0.1/go.mod h1:nXQvOBbwVqoP+T5Y5nCjeH4sP9IX/J0AMzcDUVruVoo= github.com/libp2p/go-libp2p-peer v0.1.1/go.mod h1:jkF12jGB4Gk/IOo+yomm+7oLWxF278F7UnrYUQ1Q8es= -github.com/libp2p/go-libp2p-peer v0.2.0 h1:EQ8kMjaCUwt/Y5uLgjT8iY2qg0mGUT0N1zUjer50DsY= github.com/libp2p/go-libp2p-peer v0.2.0/go.mod h1:RCffaCvUyW2CJmG2gAWVqwePwW7JMgxjsHm7+J5kjWY= github.com/libp2p/go-libp2p-peerstore v0.0.1/go.mod h1:RabLyPVJLuNQ+GFyoEkfi8H4Ti6k/HtZJ7YKgtSq+20= github.com/libp2p/go-libp2p-peerstore v0.0.6/go.mod h1:RabLyPVJLuNQ+GFyoEkfi8H4Ti6k/HtZJ7YKgtSq+20= github.com/libp2p/go-libp2p-peerstore v0.1.0/go.mod h1:2CeHkQsr8svp4fZ+Oi9ykN1HBb6u0MOvdJ7YIsmcwtY= -github.com/libp2p/go-libp2p-peerstore v0.1.3 h1:wMgajt1uM2tMiqf4M+4qWKVyyFc8SfA+84VV9glZq1M= github.com/libp2p/go-libp2p-peerstore v0.1.3/go.mod h1:BJ9sHlm59/80oSkpWgr1MyY1ciXAXV397W6h1GH/uKI= -github.com/libp2p/go-libp2p-peerstore v0.1.4 h1:d23fvq5oYMJ/lkkbO4oTwBp/JP+I/1m5gZJobNXCE/k= github.com/libp2p/go-libp2p-peerstore v0.1.4/go.mod h1:+4BDbDiiKf4PzpANZDAT+knVdLxvqh7hXOujessqdzs= github.com/libp2p/go-libp2p-peerstore v0.2.0/go.mod h1:N2l3eVIeAitSg3Pi2ipSrJYnqhVnMNQZo9nkSCuAbnQ= github.com/libp2p/go-libp2p-peerstore v0.2.1/go.mod h1:NQxhNjWxf1d4w6PihR8btWIRjwRLBr4TYKfNgrUkOPA= github.com/libp2p/go-libp2p-peerstore v0.2.2/go.mod h1:NQxhNjWxf1d4w6PihR8btWIRjwRLBr4TYKfNgrUkOPA= -github.com/libp2p/go-libp2p-peerstore v0.2.3 h1:MofRq2l3c15vQpEygTetV+zRRrncz+ktiXW7H2EKoEQ= github.com/libp2p/go-libp2p-peerstore v0.2.3/go.mod h1:K8ljLdFn590GMttg/luh4caB/3g0vKuY01psze0upRw= github.com/libp2p/go-libp2p-peerstore v0.2.6 h1:2ACefBX23iMdJU9Ke+dcXt3w86MIryes9v7In4+Qq3U= github.com/libp2p/go-libp2p-peerstore v0.2.6/go.mod h1:ss/TWTgHZTMpsU/oKVVPQCGuDHItOpf2W8RxAi50P2s= @@ -609,9 +560,7 @@ github.com/libp2p/go-libp2p-protocol v0.1.0/go.mod h1:KQPHpAabB57XQxGrXCNvbL6UEX github.com/libp2p/go-libp2p-pubsub v0.4.0 h1:YNVRyXqBgv9i4RG88jzoTtkSOaSB45CqHkL29NNBZb4= github.com/libp2p/go-libp2p-pubsub v0.4.0/go.mod h1:izkeMLvz6Ht8yAISXjx60XUQZMq9ZMe5h2ih4dLIBIQ= github.com/libp2p/go-libp2p-record v0.0.1/go.mod h1:grzqg263Rug/sRex85QrDOLntdFAymLDLm7lxMgU79Q= -github.com/libp2p/go-libp2p-record v0.1.0 h1:wHwBGbFzymoIl69BpgwIu0O6ta3TXGcMPvHUAcodzRc= github.com/libp2p/go-libp2p-record v0.1.0/go.mod h1:ujNc8iuE5dlKWVy6wuL6dd58t0n7xI4hAIl8pE6wu5Q= -github.com/libp2p/go-libp2p-record v0.1.2 h1:M50VKzWnmUrk/M5/Dz99qO9Xh4vs8ijsK+7HkJvRP+0= github.com/libp2p/go-libp2p-record v0.1.2/go.mod h1:pal0eNcT5nqZaTV7UGhqeGqxFgGdsU/9W//C8dqjQDk= github.com/libp2p/go-libp2p-record v0.1.3 h1:R27hoScIhQf/A8XJZ8lYpnqh9LatJ5YbHs28kCIfql0= github.com/libp2p/go-libp2p-record v0.1.3/go.mod h1:yNUff/adKIfPnYQXgp6FQmNu3gLJ6EMg7+/vv2+9pY4= @@ -620,19 +569,14 @@ github.com/libp2p/go-libp2p-routing-helpers v0.2.3 h1:xY61alxJ6PurSi+MXbywZpelvu github.com/libp2p/go-libp2p-routing-helpers v0.2.3/go.mod h1:795bh+9YeoFl99rMASoiVgHdi5bjack0N1+AFAdbvBw= github.com/libp2p/go-libp2p-secio v0.0.3/go.mod h1:hS7HQ00MgLhRO/Wyu1bTX6ctJKhVpm+j2/S2A5UqYb0= github.com/libp2p/go-libp2p-secio v0.1.0/go.mod h1:tMJo2w7h3+wN4pgU2LSYeiKPrfqBgkOsdiKK77hE7c8= -github.com/libp2p/go-libp2p-secio v0.2.0 h1:ywzZBsWEEz2KNTn5RtzauEDq5RFEefPsttXYwAWqHng= github.com/libp2p/go-libp2p-secio v0.2.0/go.mod h1:2JdZepB8J5V9mBp79BmwsaPQhRPNN2NrnB2lKQcdy6g= -github.com/libp2p/go-libp2p-secio v0.2.1 h1:eNWbJTdyPA7NxhP7J3c5lT97DC5d+u+IldkgCYFTPVA= github.com/libp2p/go-libp2p-secio v0.2.1/go.mod h1:cWtZpILJqkqrSkiYcDBh5lA3wbT2Q+hz3rJQq3iftD8= github.com/libp2p/go-libp2p-secio v0.2.2 h1:rLLPvShPQAcY6eNurKNZq3eZjPWfU9kXF2eI9jIYdrg= github.com/libp2p/go-libp2p-secio v0.2.2/go.mod h1:wP3bS+m5AUnFA+OFO7Er03uO1mncHG0uVwGrwvjYlNY= github.com/libp2p/go-libp2p-swarm v0.0.6/go.mod h1:s5GZvzg9xXe8sbeESuFpjt8CJPTCa8mhEusweJqyFy8= github.com/libp2p/go-libp2p-swarm v0.1.0/go.mod h1:wQVsCdjsuZoc730CgOvh5ox6K8evllckjebkdiY5ta4= -github.com/libp2p/go-libp2p-swarm v0.2.2 h1:T4hUpgEs2r371PweU3DuH7EOmBIdTBCwWs+FLcgx3bQ= github.com/libp2p/go-libp2p-swarm v0.2.2/go.mod h1:fvmtQ0T1nErXym1/aa1uJEyN7JzaTNyBcHImCxRpPKU= -github.com/libp2p/go-libp2p-swarm v0.2.3 h1:uVkCb8Blfg7HQ/f30TyHn1g/uCwXsAET7pU0U59gx/A= github.com/libp2p/go-libp2p-swarm v0.2.3/go.mod h1:P2VO/EpxRyDxtChXz/VPVXyTnszHvokHKRhfkEgFKNM= -github.com/libp2p/go-libp2p-swarm v0.2.8 h1:cIUUvytBzNQmGSjnXFlI6UpoBGsaud82mJPIJVfkDlg= github.com/libp2p/go-libp2p-swarm v0.2.8/go.mod h1:JQKMGSth4SMqonruY0a8yjlPVIkb0mdNSwckW7OYziM= github.com/libp2p/go-libp2p-swarm v0.3.0/go.mod h1:hdv95GWCTmzkgeJpP+GK/9D9puJegb7H57B5hWQR5Kk= github.com/libp2p/go-libp2p-swarm v0.3.1 h1:UTobu+oQHGdXTOGpZ4RefuVqYoJXcT0EBtSR74m2LkI= @@ -641,11 +585,8 @@ github.com/libp2p/go-libp2p-testing v0.0.1/go.mod h1:gvchhf3FQOtBdr+eFUABet5a4MB github.com/libp2p/go-libp2p-testing v0.0.2/go.mod h1:gvchhf3FQOtBdr+eFUABet5a4MBLK8jM3V4Zghvmi+E= github.com/libp2p/go-libp2p-testing v0.0.3/go.mod h1:gvchhf3FQOtBdr+eFUABet5a4MBLK8jM3V4Zghvmi+E= github.com/libp2p/go-libp2p-testing v0.0.4/go.mod h1:gvchhf3FQOtBdr+eFUABet5a4MBLK8jM3V4Zghvmi+E= -github.com/libp2p/go-libp2p-testing v0.1.0 h1:WaFRj/t3HdMZGNZqnU2pS7pDRBmMeoDx7/HDNpeyT9U= github.com/libp2p/go-libp2p-testing v0.1.0/go.mod h1:xaZWMJrPUM5GlDBxCeGUi7kI4eqnjVyavGroI2nxEM0= -github.com/libp2p/go-libp2p-testing v0.1.1 h1:U03z3HnGI7Ni8Xx6ONVZvUFOAzWYmolWf5W5jAOPNmU= github.com/libp2p/go-libp2p-testing v0.1.1/go.mod h1:xaZWMJrPUM5GlDBxCeGUi7kI4eqnjVyavGroI2nxEM0= -github.com/libp2p/go-libp2p-testing v0.1.2-0.20200422005655-8775583591d8 h1:v4dvk7YEW8buwCdIVWnhpv0Hp/AAJKRWIxBhmLRZrsk= github.com/libp2p/go-libp2p-testing v0.1.2-0.20200422005655-8775583591d8/go.mod h1:Qy8sAncLKpwXtS2dSnDOP8ktexIAHKu+J+pnZOFZLTc= github.com/libp2p/go-libp2p-testing v0.2.0/go.mod h1:Qy8sAncLKpwXtS2dSnDOP8ktexIAHKu+J+pnZOFZLTc= github.com/libp2p/go-libp2p-testing v0.3.0 h1:ZiBYstPamsi7y6NJZebRudUzsYmVkt998hltyLqf8+g= @@ -655,93 +596,70 @@ github.com/libp2p/go-libp2p-tls v0.1.3/go.mod h1:wZfuewxOndz5RTnCAxFliGjvYSDA40s github.com/libp2p/go-libp2p-transport v0.0.1/go.mod h1:UzbUs9X+PHOSw7S3ZmeOxfnwaQY5vGDzZmKPod3N3tk= github.com/libp2p/go-libp2p-transport v0.0.5/go.mod h1:StoY3sx6IqsP6XKoabsPnHCwqKXWUMWU7Rfcsubee/A= github.com/libp2p/go-libp2p-transport-upgrader v0.0.4/go.mod h1:RGq+tupk+oj7PzL2kn/m1w6YXxcIAYJYeI90h6BGgUc= -github.com/libp2p/go-libp2p-transport-upgrader v0.1.1 h1:PZMS9lhjK9VytzMCW3tWHAXtKXmlURSc3ZdvwEcKCzw= github.com/libp2p/go-libp2p-transport-upgrader v0.1.1/go.mod h1:IEtA6or8JUbsV07qPW4r01GnTenLW4oi3lOPbUMGJJA= -github.com/libp2p/go-libp2p-transport-upgrader v0.2.0 h1:5EhPgQhXZNyfL22ERZTUoVp9UVVbNowWNVtELQaKCHk= github.com/libp2p/go-libp2p-transport-upgrader v0.2.0/go.mod h1:mQcrHj4asu6ArfSoMuyojOdjx73Q47cYD7s5+gZOlns= github.com/libp2p/go-libp2p-transport-upgrader v0.3.0 h1:q3ULhsknEQ34eVDhv4YwKS8iet69ffs9+Fir6a7weN4= github.com/libp2p/go-libp2p-transport-upgrader v0.3.0/go.mod h1:i+SKzbRnvXdVbU3D1dwydnTmKRPXiAR/fyvi1dXuL4o= github.com/libp2p/go-libp2p-yamux v0.1.2/go.mod h1:xUoV/RmYkg6BW/qGxA9XJyg+HzXFYkeXbnhjmnYzKp8= github.com/libp2p/go-libp2p-yamux v0.1.3/go.mod h1:VGSQVrqkh6y4nm0189qqxMtvyBft44MOYYPpYKXiVt4= github.com/libp2p/go-libp2p-yamux v0.2.0/go.mod h1:Db2gU+XfLpm6E4rG5uGCFX6uXA8MEXOxFcRoXUODaK8= -github.com/libp2p/go-libp2p-yamux v0.2.1 h1:Q3XYNiKCC2vIxrvUJL+Jg1kiyeEaIDNKLjgEjo3VQdI= github.com/libp2p/go-libp2p-yamux v0.2.1/go.mod h1:1FBXiHDk1VyRM1C0aez2bCfHQ4vMZKkAQzZbkSQt5fI= github.com/libp2p/go-libp2p-yamux v0.2.2/go.mod h1:lIohaR0pT6mOt0AZ0L2dFze9hds9Req3OfS+B+dv4qw= github.com/libp2p/go-libp2p-yamux v0.2.5/go.mod h1:Zpgj6arbyQrmZ3wxSZxfBmbdnWtbZ48OpsfmQVTErwA= -github.com/libp2p/go-libp2p-yamux v0.2.7 h1:vzKu0NVtxvEIDGCv6mjKRcK0gipSgaXmJZ6jFv0d/dk= github.com/libp2p/go-libp2p-yamux v0.2.7/go.mod h1:X28ENrBMU/nm4I3Nx4sZ4dgjZ6VhLEn0XhIoZ5viCwU= -github.com/libp2p/go-libp2p-yamux v0.2.8 h1:0s3ELSLu2O7hWKfX1YjzudBKCP0kZ+m9e2+0veXzkn4= github.com/libp2p/go-libp2p-yamux v0.2.8/go.mod h1:/t6tDqeuZf0INZMTgd0WxIRbtK2EzI2h7HbFm9eAKI4= github.com/libp2p/go-libp2p-yamux v0.4.0/go.mod h1:+DWDjtFMzoAwYLVkNZftoucn7PelNoy5nm3tZ3/Zw30= github.com/libp2p/go-libp2p-yamux v0.4.1 h1:TJxRVPY9SjH7TNrNC80l1OJMBiWhs1qpKmeB+1Ug3xU= github.com/libp2p/go-libp2p-yamux v0.4.1/go.mod h1:FA/NjRYRVNjqOzpGuGqcruH7jAU2mYIjtKBicVOL3dc= github.com/libp2p/go-maddr-filter v0.0.1/go.mod h1:6eT12kSQMA9x2pvFQa+xesMKUBlj9VImZbj3B9FBH/Q= github.com/libp2p/go-maddr-filter v0.0.4/go.mod h1:6eT12kSQMA9x2pvFQa+xesMKUBlj9VImZbj3B9FBH/Q= -github.com/libp2p/go-maddr-filter v0.0.5 h1:CW3AgbMO6vUvT4kf87y4N+0P8KUl2aqLYhrGyDUbLSg= github.com/libp2p/go-maddr-filter v0.0.5/go.mod h1:Jk+36PMfIqCJhAnaASRH83bdAvfDRp/w6ENFaC9bG+M= github.com/libp2p/go-maddr-filter v0.1.0/go.mod h1:VzZhTXkMucEGGEOSKddrwGiOv0tUhgnKqNEmIAz/bPU= github.com/libp2p/go-mplex v0.0.3/go.mod h1:pK5yMLmOoBR1pNCqDlA2GQrdAVTMkqFalaTWe7l4Yd0= github.com/libp2p/go-mplex v0.0.4/go.mod h1:pK5yMLmOoBR1pNCqDlA2GQrdAVTMkqFalaTWe7l4Yd0= -github.com/libp2p/go-mplex v0.1.0 h1:/nBTy5+1yRyY82YaO6HXQRnO5IAGsXTjEJaR3LdTPc0= github.com/libp2p/go-mplex v0.1.0/go.mod h1:SXgmdki2kwCUlCCbfGLEgHjC4pFqhTp0ZoV6aiKgxDU= github.com/libp2p/go-mplex v0.1.1/go.mod h1:Xgz2RDCi3co0LeZfgjm4OgUF15+sVR8SRcu3SFXI1lk= -github.com/libp2p/go-mplex v0.1.2 h1:qOg1s+WdGLlpkrczDqmhYzyk3vCfsQ8+RxRTQjOZWwI= github.com/libp2p/go-mplex v0.1.2/go.mod h1:Xgz2RDCi3co0LeZfgjm4OgUF15+sVR8SRcu3SFXI1lk= github.com/libp2p/go-mplex v0.2.0 h1:Ov/D+8oBlbRkjBs1R1Iua8hJ8cUfbdiW8EOdZuxcgaI= github.com/libp2p/go-mplex v0.2.0/go.mod h1:0Oy/A9PQlwBytDRp4wSkFnzHYDKcpLot35JQ6msjvYQ= github.com/libp2p/go-msgio v0.0.2/go.mod h1:63lBBgOTDKQL6EWazRMCwXsEeEeK9O2Cd+0+6OOuipQ= github.com/libp2p/go-msgio v0.0.3/go.mod h1:63lBBgOTDKQL6EWazRMCwXsEeEeK9O2Cd+0+6OOuipQ= -github.com/libp2p/go-msgio v0.0.4 h1:agEFehY3zWJFUHK6SEMR7UYmk2z6kC3oeCM7ybLhguA= github.com/libp2p/go-msgio v0.0.4/go.mod h1:63lBBgOTDKQL6EWazRMCwXsEeEeK9O2Cd+0+6OOuipQ= github.com/libp2p/go-msgio v0.0.6 h1:lQ7Uc0kS1wb1EfRxO2Eir/RJoHkHn7t6o+EiwsYIKJA= github.com/libp2p/go-msgio v0.0.6/go.mod h1:4ecVB6d9f4BDSL5fqvPiC4A3KivjWn+Venn/1ALLMWA= -github.com/libp2p/go-nat v0.0.3 h1:l6fKV+p0Xa354EqQOQP+d8CivdLM4kl5GxC1hSc/UeI= github.com/libp2p/go-nat v0.0.3/go.mod h1:88nUEt0k0JD45Bk93NIwDqjlhiOwOoV36GchpcVc1yI= -github.com/libp2p/go-nat v0.0.4 h1:KbizNnq8YIf7+Hn7+VFL/xE0eDrkPru2zIO9NMwL8UQ= github.com/libp2p/go-nat v0.0.4/go.mod h1:Nmw50VAvKuk38jUBcmNh6p9lUJLoODbJRvYAa/+KSDo= github.com/libp2p/go-nat v0.0.5 h1:qxnwkco8RLKqVh1NmjQ+tJ8p8khNLFxuElYG/TwqW4Q= github.com/libp2p/go-nat v0.0.5/go.mod h1:B7NxsVNPZmRLvMOwiEO1scOSyjA56zxYAGv1yQgRkEU= -github.com/libp2p/go-netroute v0.1.2 h1:UHhB35chwgvcRI392znJA3RCBtZ3MpE3ahNCN5MR4Xg= github.com/libp2p/go-netroute v0.1.2/go.mod h1:jZLDV+1PE8y5XxBySEBgbuVAXbhtuHSdmLPL2n9MKbk= -github.com/libp2p/go-netroute v0.1.3 h1:1ngWRx61us/EpaKkdqkMjKk/ufr/JlIFYQAxV2XX8Ig= github.com/libp2p/go-netroute v0.1.3/go.mod h1:jZLDV+1PE8y5XxBySEBgbuVAXbhtuHSdmLPL2n9MKbk= github.com/libp2p/go-netroute v0.1.4 h1:47V0+hJfYaqj1WO0A+cDkRc9xr9qKiK7i8zaoGv8Mmo= github.com/libp2p/go-netroute v0.1.4/go.mod h1:jZLDV+1PE8y5XxBySEBgbuVAXbhtuHSdmLPL2n9MKbk= -github.com/libp2p/go-openssl v0.0.2 h1:9pP2d3Ubaxkv7ZisLjx9BFwgOGnQdQYnfcH29HNY3ls= github.com/libp2p/go-openssl v0.0.2/go.mod h1:v8Zw2ijCSWBQi8Pq5GAixw6DbFfa9u6VIYDXnvOXkc0= -github.com/libp2p/go-openssl v0.0.3 h1:wjlG7HvQkt4Fq4cfH33Ivpwp0omaElYEi9z26qaIkIk= github.com/libp2p/go-openssl v0.0.3/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO1HmaZjggc= -github.com/libp2p/go-openssl v0.0.4 h1:d27YZvLoTyMhIN4njrkr8zMDOM4lfpHIp6A+TK9fovg= github.com/libp2p/go-openssl v0.0.4/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO1HmaZjggc= github.com/libp2p/go-openssl v0.0.5/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO1HmaZjggc= github.com/libp2p/go-openssl v0.0.7 h1:eCAzdLejcNVBzP/iZM9vqHnQm+XyCEbSSIheIPRGNsw= github.com/libp2p/go-openssl v0.0.7/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO1HmaZjggc= -github.com/libp2p/go-reuseport v0.0.1 h1:7PhkfH73VXfPJYKQ6JwS5I/eVcoyYi9IMNGc6FWpFLw= github.com/libp2p/go-reuseport v0.0.1/go.mod h1:jn6RmB1ufnQwl0Q1f+YxAj8isJgDCQzaaxIFYDhcYEA= github.com/libp2p/go-reuseport v0.0.2 h1:XSG94b1FJfGA01BUrT82imejHQyTxO4jEWqheyCXYvU= github.com/libp2p/go-reuseport v0.0.2/go.mod h1:SPD+5RwGC7rcnzngoYC86GjPzjSywuQyMVAheVBD9nQ= -github.com/libp2p/go-reuseport-transport v0.0.2 h1:WglMwyXyBu61CMkjCCtnmqNqnjib0GIEjMiHTwR/KN4= github.com/libp2p/go-reuseport-transport v0.0.2/go.mod h1:YkbSDrvjUVDL6b8XqriyA20obEtsW9BLkuOUyQAOCbs= -github.com/libp2p/go-reuseport-transport v0.0.3 h1:zzOeXnTooCkRvoH+bSXEfXhn76+LAiwoneM0gnXjF2M= github.com/libp2p/go-reuseport-transport v0.0.3/go.mod h1:Spv+MPft1exxARzP2Sruj2Wb5JSyHNncjf1Oi2dEbzM= github.com/libp2p/go-reuseport-transport v0.0.4 h1:OZGz0RB620QDGpv300n1zaOcKGGAoGVf8h9txtt/1uM= github.com/libp2p/go-reuseport-transport v0.0.4/go.mod h1:trPa7r/7TJK/d+0hdBLOCGvpQQVOU74OXbNCIMkufGw= -github.com/libp2p/go-sockaddr v0.0.2 h1:tCuXfpA9rq7llM/v834RKc/Xvovy/AqM9kHvTV/jY/Q= github.com/libp2p/go-sockaddr v0.0.2/go.mod h1:syPvOmNs24S3dFVGJA1/mrqdeijPxLV2Le3BRLKd68k= github.com/libp2p/go-sockaddr v0.1.0 h1:Y4s3/jNoryVRKEBrkJ576F17CPOaMIzUeCsg7dlTDj0= github.com/libp2p/go-sockaddr v0.1.0/go.mod h1:syPvOmNs24S3dFVGJA1/mrqdeijPxLV2Le3BRLKd68k= github.com/libp2p/go-stream-muxer v0.0.1/go.mod h1:bAo8x7YkSpadMTbtTaxGVHWUQsR/l5MEaHbKaliuT14= github.com/libp2p/go-stream-muxer v0.1.0/go.mod h1:8JAVsjeRBCWwPoZeH0W1imLOcriqXJyFvB0mR4A04sQ= github.com/libp2p/go-stream-muxer-multistream v0.1.1/go.mod h1:zmGdfkQ1AzOECIAcccoL8L//laqawOsO03zX8Sa+eGw= -github.com/libp2p/go-stream-muxer-multistream v0.2.0 h1:714bRJ4Zy9mdhyTLJ+ZKiROmAFwUHpeRidG+q7LTQOg= github.com/libp2p/go-stream-muxer-multistream v0.2.0/go.mod h1:j9eyPol/LLRqT+GPLSxvimPhNph4sfYfMoDPd7HkzIc= github.com/libp2p/go-stream-muxer-multistream v0.3.0 h1:TqnSHPJEIqDEO7h1wZZ0p3DXdvDSiLHQidKKUGZtiOY= github.com/libp2p/go-stream-muxer-multistream v0.3.0/go.mod h1:yDh8abSIzmZtqtOt64gFJUXEryejzNb0lisTt+fAMJA= github.com/libp2p/go-tcp-transport v0.0.4/go.mod h1:+E8HvC8ezEVOxIo3V5vCK9l1y/19K427vCzQ+xHKH/o= github.com/libp2p/go-tcp-transport v0.1.0/go.mod h1:oJ8I5VXryj493DEJ7OsBieu8fcg2nHGctwtInJVpipc= -github.com/libp2p/go-tcp-transport v0.1.1 h1:yGlqURmqgNA2fvzjSgZNlHcsd/IulAnKM8Ncu+vlqnw= github.com/libp2p/go-tcp-transport v0.1.1/go.mod h1:3HzGvLbx6etZjnFlERyakbaYPdfjg2pWP97dFZworkY= -github.com/libp2p/go-tcp-transport v0.2.0 h1:YoThc549fzmNJIh7XjHVtMIFaEDRtIrtWciG5LyYAPo= github.com/libp2p/go-tcp-transport v0.2.0/go.mod h1:vX2U0CnWimU4h0SGSEsg++AzvBcroCGYw28kh94oLe0= github.com/libp2p/go-tcp-transport v0.2.1 h1:ExZiVQV+h+qL16fzCWtd1HSzPsqWottJ8KXwWaVi8Ns= github.com/libp2p/go-tcp-transport v0.2.1/go.mod h1:zskiJ70MEfWz2MKxvFB/Pv+tPIB1PpPUrHIWQ8aFw7M= @@ -750,36 +668,33 @@ github.com/libp2p/go-testutil v0.1.0/go.mod h1:81b2n5HypcVyrCg/MJx4Wgfp/VHojytjV github.com/libp2p/go-ws-transport v0.0.5/go.mod h1:Qbl4BxPfXXhhd/o0wcrgoaItHqA9tnZjoFZnxykuaXU= github.com/libp2p/go-ws-transport v0.1.0/go.mod h1:rjw1MG1LU9YDC6gzmwObkPd/Sqwhw7yT74kj3raBFuo= github.com/libp2p/go-ws-transport v0.2.0/go.mod h1:9BHJz/4Q5A9ludYWKoGCFC5gUElzlHoKzu0yY9p/klM= -github.com/libp2p/go-ws-transport v0.3.0 h1:mjo6pL5aVR9rCjl9wNq3DupbaQlyR61pzoOT2MdtxaA= github.com/libp2p/go-ws-transport v0.3.0/go.mod h1:bpgTJmRZAvVHrgHybCVyqoBmyLQ1fiZuEaBYusP5zsk= github.com/libp2p/go-ws-transport v0.3.1 h1:ZX5rWB8nhRRJVaPO6tmkGI/Xx8XNboYX20PW5hXIscw= github.com/libp2p/go-ws-transport v0.3.1/go.mod h1:bpgTJmRZAvVHrgHybCVyqoBmyLQ1fiZuEaBYusP5zsk= github.com/libp2p/go-yamux v1.2.1/go.mod h1:FGTiPvoV/3DVdgWpX+tM0OW3tsM+W5bSE3gZwqQTcow= github.com/libp2p/go-yamux v1.2.2/go.mod h1:FGTiPvoV/3DVdgWpX+tM0OW3tsM+W5bSE3gZwqQTcow= -github.com/libp2p/go-yamux v1.2.3 h1:xX8A36vpXb59frIzWFdEgptLMsOANMFq2K7fPRlunYI= github.com/libp2p/go-yamux v1.2.3/go.mod h1:FGTiPvoV/3DVdgWpX+tM0OW3tsM+W5bSE3gZwqQTcow= github.com/libp2p/go-yamux v1.3.0/go.mod h1:FGTiPvoV/3DVdgWpX+tM0OW3tsM+W5bSE3gZwqQTcow= github.com/libp2p/go-yamux v1.3.3/go.mod h1:FGTiPvoV/3DVdgWpX+tM0OW3tsM+W5bSE3gZwqQTcow= -github.com/libp2p/go-yamux v1.3.5 h1:ibuz4naPAully0pN6J/kmUARiqLpnDQIzI/8GCOrljg= github.com/libp2p/go-yamux v1.3.5/go.mod h1:FGTiPvoV/3DVdgWpX+tM0OW3tsM+W5bSE3gZwqQTcow= -github.com/libp2p/go-yamux v1.3.7 h1:v40A1eSPJDIZwz2AvrV3cxpTZEGDP11QJbukmEhYyQI= github.com/libp2p/go-yamux v1.3.7/go.mod h1:fr7aVgmdNGJK+N1g+b6DW6VxzbRCjCOejR/hkmpooHE= github.com/libp2p/go-yamux v1.4.0/go.mod h1:fr7aVgmdNGJK+N1g+b6DW6VxzbRCjCOejR/hkmpooHE= github.com/libp2p/go-yamux v1.4.1 h1:P1Fe9vF4th5JOxxgQvfbOHkrGqIZniTLf+ddhZp8YTI= github.com/libp2p/go-yamux v1.4.1/go.mod h1:fr7aVgmdNGJK+N1g+b6DW6VxzbRCjCOejR/hkmpooHE= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329 h1:2gxZ0XQIU/5z3Z3bUBu+FXuk2pFbkN6tcwi/pjyaDic= github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= +github.com/mattn/go-colorable v0.0.0-20170327083344-ded68f7a9561/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= -github.com/mattn/go-colorable v0.1.2 h1:/bC9yWikZXAL9uJdulbSfyVNIR3n3trXl+v8+1sx8mU= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.8 h1:HLtExJ+uU2HOZ+wI0Tt5DtUDrx8yhUqDcp7fYERX4CE= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= github.com/miekg/dns v1.1.12/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.28/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= @@ -795,6 +710,13 @@ github.com/minio/sha256-simd v0.1.1/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mmcloughlin/avo v0.0.0-20201105074841-5d2f697d268f/go.mod h1:6aKT4zZIrpGqB3RpFU14ByCSSyKY6LfJz4J/JJChHfI= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/mr-tron/base58 v1.1.0/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8= github.com/mr-tron/base58 v1.1.1/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8= @@ -813,7 +735,6 @@ github.com/multiformats/go-multiaddr v0.1.0/go.mod h1:xKVEak1K9cS1VdmPZW3LSIb6lg github.com/multiformats/go-multiaddr v0.1.1/go.mod h1:aMKBKNEYmzmDmxfX88/vz+J5IU55txyt0p4aiWVohjo= github.com/multiformats/go-multiaddr v0.2.0/go.mod h1:0nO36NvPpyV4QzvTLi/lafl2y95ncPj0vFwVF6k6wJ4= github.com/multiformats/go-multiaddr v0.2.1/go.mod h1:s/Apk6IyxfvMjDafnhJgJ3/46z7tZ04iMk5wP4QMGGE= -github.com/multiformats/go-multiaddr v0.2.2 h1:XZLDTszBIJe6m0zF6ITBrEcZR73OPUhCBBS9rYAuUzI= github.com/multiformats/go-multiaddr v0.2.2/go.mod h1:NtfXiOtHvghW9KojvtySjH5y0u0xW5UouOmQQrn6a3Y= github.com/multiformats/go-multiaddr v0.3.0/go.mod h1:dF9kph9wfJ+3VLAaeBqo9Of8x4fJxp6ggJGteB8HQTI= github.com/multiformats/go-multiaddr v0.3.1 h1:1bxa+W7j9wZKTZREySx1vPMs2TqrYWjVZ7zE6/XLG1I= @@ -831,7 +752,6 @@ github.com/multiformats/go-multiaddr-net v0.1.1/go.mod h1:5JNbcfBOP4dnhoZOv10JJV github.com/multiformats/go-multiaddr-net v0.1.2/go.mod h1:QsWt3XK/3hwvNxZJp92iMQKME1qHfpYmyIjFVsSOY6Y= github.com/multiformats/go-multiaddr-net v0.1.3/go.mod h1:ilNnaM9HbmVFqsb/qcNysjCu4PVONlrBZpHIrw/qQuA= github.com/multiformats/go-multiaddr-net v0.1.4/go.mod h1:ilNnaM9HbmVFqsb/qcNysjCu4PVONlrBZpHIrw/qQuA= -github.com/multiformats/go-multiaddr-net v0.1.5 h1:QoRKvu0xHN1FCFJcMQLbG/yQE2z441L5urvG3+qyz7g= github.com/multiformats/go-multiaddr-net v0.1.5/go.mod h1:ilNnaM9HbmVFqsb/qcNysjCu4PVONlrBZpHIrw/qQuA= github.com/multiformats/go-multiaddr-net v0.2.0 h1:MSXRGN0mFymt6B1yo/6BPnIRpLPEnKgQNvVfCX5VDJk= github.com/multiformats/go-multiaddr-net v0.2.0/go.mod h1:gGdH3UXny6U3cKKYCvpXI5rnK7YaOIEOPVDI9tsJbEA= @@ -850,7 +770,6 @@ github.com/multiformats/go-multistream v0.0.1/go.mod h1:fJTiDfXJVmItycydCnNx4+wS github.com/multiformats/go-multistream v0.0.4/go.mod h1:fJTiDfXJVmItycydCnNx4+wSzZ5NwG2FEVAI30fiovg= github.com/multiformats/go-multistream v0.1.0/go.mod h1:fJTiDfXJVmItycydCnNx4+wSzZ5NwG2FEVAI30fiovg= github.com/multiformats/go-multistream v0.1.1/go.mod h1:KmHZ40hzVxiaiwlj3MEbYgK9JFk2/9UktWZAF54Du38= -github.com/multiformats/go-multistream v0.1.2 h1:knyamLYMPFPngQjGQ0lhnlys3jtVR/3xV6TREUJr+fE= github.com/multiformats/go-multistream v0.1.2/go.mod h1:5GZPQZbkWOLOn3J2y4Y99vVW7vOfsAflxARk3x14o6k= github.com/multiformats/go-multistream v0.2.0 h1:6AuNmQVKUkRnddw2YiDjt5Elit40SFxMJkVnhmETXtU= github.com/multiformats/go-multistream v0.2.0/go.mod h1:5GZPQZbkWOLOn3J2y4Y99vVW7vOfsAflxARk3x14o6k= @@ -865,6 +784,8 @@ github.com/namsral/flag v1.7.4-pre h1:b2ScHhoCUkbsq0d2C15Mv+VU8bl8hAXV8arnWiOHNZ github.com/namsral/flag v1.7.4-pre/go.mod h1:OXldTctbM6SWH1K899kPZcf65KxJiD7MsceFUpB5yDo= github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/ockam-network/did v0.1.3 h1:qJGdccOV4bLfsS/eFM+Aj+CdCRJKNMxbmJevQclw44k= +github.com/ockam-network/did v0.1.3/go.mod h1:ZsbTIuVGt8OrQEbqWrSztUISN4joeMabdsinbLubbzw= github.com/oklog/ulid/v2 v2.0.2 h1:r4fFzBm+bv0wNKNh5eXTwU7i85y5x+uwkxCUTNVQqLc= github.com/oklog/ulid/v2 v2.0.2/go.mod h1:mtBL0Qe/0HAx6/a4Z30qxVIAL1eQDweXq5lxOEiwQ68= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -885,6 +806,7 @@ github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYr github.com/pborman/getopt v0.0.0-20170112200414-7148bc3a4c30/go.mod h1:85jBQOZwpVEaDAr341tbn15RS4fCAsIst0qp7i8ex1o= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.4.0/go.mod h1:PN7xzY2wHTK0K9p34ErDQMlFxa51Fk0OUruD3k1mMwo= +github.com/peterh/liner v0.0.0-20170317030525-88609521dc4b/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc= github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2 h1:JhzVVoYvbOACxoUmOs6V/G4D5nPVUW73rKvXxP4XUJc= github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2/go.mod h1:iIss55rKnNBTvrwdmkUpLnDpZoAHvWaiq5+iMmen4AE= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -908,6 +830,7 @@ github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPx github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/assertions v1.0.0 h1:UVQPSSmc3qtTi+zPPkCXvZX9VvW/xT/NsRvKfwY81a8= github.com/smartystreets/assertions v1.0.0/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM= @@ -924,9 +847,11 @@ github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0b github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cobra v0.0.0-20170417170307-b6cb39589372/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/pflag v0.0.0-20170417173400-9e4c21054fa1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= github.com/src-d/envconfig v1.0.0/go.mod h1:Q9YQZ7BKITldTBnoxsE5gOeB5y66RyPXeue/R4aaNBc= @@ -937,14 +862,15 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV github.com/stretchr/testify v1.3.1-0.20190311161405-34c6fa2dc709/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/syndtr/goleveldb v1.0.0 h1:fBdIW9lB4Iz0n9khmH8w27SJ3QEJ7+IgjPEwGSZiFdE= github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ= github.com/textileio/go-datastore-extensions v1.0.1 h1:qIJGqJaigQ1wD4TdwS/hf73u0HChhXvvUSJuxBEKS+c= github.com/textileio/go-datastore-extensions v1.0.1/go.mod h1:Pzj9FDRkb55910dr/FX8M7WywvnS26gBgEDez1ZBuLE= -github.com/textileio/go-ds-badger v0.2.7-0.20201204225019-4ee78c4a40e2 h1:VIWkccJp5k8x1hbwQsSn6Xnns4wUDEW6XdiMLiOpr7k= -github.com/textileio/go-ds-badger v0.2.7-0.20201204225019-4ee78c4a40e2/go.mod h1:qEZ/z1KyoRhGS5MYEbIcWUCCPd/0HxCkFDVeJgP1RcI= +github.com/textileio/go-ds-badger3 v0.0.0-20210324034212-7b7fb3be3d1c h1:iOWa9/AXFssCi7VhbEvVkpCYXqq/n3E2zKH6u+9pIfM= +github.com/textileio/go-ds-badger3 v0.0.0-20210324034212-7b7fb3be3d1c/go.mod h1:VX3oCNk7szANGG+baANuhTx7dheWiEPH7lp1n69ef4M= github.com/textileio/go-ds-mongo v0.1.4 h1:5PPMEmqCfeCySzadtuBXMEJVDGP1Cga/CQXo3GWetmE= github.com/textileio/go-ds-mongo v0.1.4/go.mod h1:Zf6JlMPiIQUUmGlFFn5Z65C9p9LAvPg7XvX+qdGmTsU= github.com/tidwall/gjson v1.3.5 h1:2oW9FBNu8qt9jy5URgrzsVx/T/KSn3qn/smJQ0crlDQ= @@ -955,7 +881,12 @@ github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tidwall/sjson v1.0.4 h1:UcdIRXff12Lpnu3OLtZvnc03g4vH2suXDXhBwBqmzYg= github.com/tidwall/sjson v1.0.4/go.mod h1:bURseu1nuBkFpIES5cz6zBtjmYeOQmEESshn7VpF15Y= +github.com/twitchyliquid64/golang-asm v0.15.0/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= +github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= +github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= +github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs= +github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/warpfork/go-wish v0.0.0-20180510122957-5ad1f5abf436/go.mod h1:x6AKhvSSexNrVSrViXSHUEbICjmGXhtgABaHIySUSGw= github.com/warpfork/go-wish v0.0.0-20190328234359-8b3e70f8e830 h1:8kxMKmKzXXL4Ru1nyhvdms/JjWt+3YLpvRb/bAjO/y0= github.com/warpfork/go-wish v0.0.0-20190328234359-8b3e70f8e830/go.mod h1:x6AKhvSSexNrVSrViXSHUEbICjmGXhtgABaHIySUSGw= @@ -990,19 +921,24 @@ github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1: github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74= github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.mongodb.org/mongo-driver v1.4.0 h1:C8rFn1VF4GVEM/rG+dSoMmlm2pyQ9cs2/oRtUATejRU= go.mongodb.org/mongo-driver v1.4.0/go.mod h1:llVBH2pkj9HywK0Dtdt6lDikOjFLbceHVu/Rc0iMKLs= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.1/go.mod h1:Ap50jQcDJrx6rB6VgeeFPtuPIf3wMRvRfrfYDO6+BmA= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4 h1:LYy1Hy3MJdrCdMwwzxA/dRok4ejH+RwNGbuoD9fCjto= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.5 h1:dntmOdLpSpHlVqbW5Eay97DelsZHe+55D+xC6i0dDS0= +go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.starlark.net v0.0.0-20190702223751-32f345186213/go.mod h1:c1/X6cHgvdXj6pUlmWKMkuqRnW4K8x2vwt6JAaaircg= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/goleak v1.0.0 h1:qsup4IcBdlmsnGfqyLl4Ntn3C2XCCuKAE7DwHpScyUo= go.uber.org/goleak v1.0.0/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= +go.uber.org/goleak v1.1.10 h1:z+mqJhf6ss6BSfSM671tgKyZBFPTTJM+HLxnhPC3wu0= +go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.5.0 h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= @@ -1010,10 +946,11 @@ go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEa go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.14.1/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= -go.uber.org/zap v1.15.0 h1:ZZCA22JRF2gQE5FoNmhmrf7jeJJ2uhqDUNRYKm8dvmM= go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= go.uber.org/zap v1.16.0 h1:uFRZXykJGK9lLY4HtgSw44DnIcAM+kRBP7x5m+NpAOM= go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= +golang.org/x/arch v0.0.0-20190927153633-4e8777c89be4/go.mod h1:flIaEI6LNU6xOCD5PaJvn9wGP0agmIOqjrtsKGRguv4= +golang.org/x/arch v0.0.0-20201008161808-52c3e6f60cff/go.mod h1:flIaEI6LNU6xOCD5PaJvn9wGP0agmIOqjrtsKGRguv4= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -1030,8 +967,8 @@ golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190618222545-ea8f1a30c443/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200423211502-4bdfaf469ed5 h1:Q7tZBpemrlsc2I7IyODzhtallWRSm4Q0d09pL6XbQtU= golang.org/x/crypto v0.0.0-20200423211502-4bdfaf469ed5/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c h1:9HhBz5L/UjnK9XLtiZhYAdue5BVKep3PMmS2LuPDt8k= golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1048,8 +985,11 @@ golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b h1:GgiSbuUyC0BlbUmHQBgFqu32eiRR/CEYdjOjOd4zE6Y= golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.1 h1:Kvvh58BN8Y9/lBi7hTekvtMpm07eUZ0ck5pRHpsMWrY= +golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1063,8 +1003,10 @@ golang.org/x/net v0.0.0-20190611141213-3f473d35a33a/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200421231249-e086a090c8fd h1:QPwSajcTUrFriMF1nJ3XzgoqakqQEsnZf9LdXdi2nkI= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200421231249-e086a090c8fd/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20201021035429-f5854403a974 h1:IX6qOQeG5uLjB/hjjwjedwfjND0hgjPMMyO1RoIXQNI= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1072,8 +1014,9 @@ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a h1:WXEvlFVvvGxCJLG6REjsT03iWnKLEWinaScsxF2Vm2o= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9 h1:SQFwaSi55rU7vdNs9Yr0Z324VNlrF+0wMqRXT4St8ck= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1099,13 +1042,16 @@ golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f h1:gWF768j/LaZugp8dyS4UwsslYCYz9XgFxvlgsn0n9H8= golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f h1:+Nyd8tzPX9R7BWHguqsrbFdRx3WQ/1ib8I44HXV5yTA= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= @@ -1128,13 +1074,19 @@ golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191127201027-ecd32218bd7f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa h1:5E4dL8+NgFOgjwbTKz+OOEGGhP+ectTmF842l6KjupQ= golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20201105001634-bc3cf281b174/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a h1:CB3a9Nez8M13wwlr/E2YtwoU+qYHKfC+JrDa45RXXoQ= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180518175338-11a468237815/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= @@ -1162,7 +1114,6 @@ google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQ google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= @@ -1179,11 +1130,13 @@ gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkep gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= diff --git a/integrationtests/foldersync/client.go b/integrationtests/foldersync/client.go index 8320d546..24f551cd 100644 --- a/integrationtests/foldersync/client.go +++ b/integrationtests/foldersync/client.go @@ -15,7 +15,7 @@ import ( ipfslite "github.com/hsanjuan/ipfs-lite" "github.com/ipfs/go-cid" - logging "github.com/ipfs/go-log" + logging "github.com/ipfs/go-log/v2" ma "github.com/multiformats/go-multiaddr" "github.com/textileio/go-threads/common" core "github.com/textileio/go-threads/core/db" @@ -23,8 +23,9 @@ import ( "github.com/textileio/go-threads/core/thread" "github.com/textileio/go-threads/db" kt "github.com/textileio/go-threads/db/keytransform" + "github.com/textileio/go-threads/db/util" "github.com/textileio/go-threads/integrationtests/foldersync/watcher" - "github.com/textileio/go-threads/util" + tutil "github.com/textileio/go-threads/util" ) var ( @@ -72,14 +73,14 @@ type client struct { } func newRootClient(name, folderPath, repoPath string) (*client, error) { - id := thread.NewIDV1(thread.Raw, 32) + id := thread.NewRandomIDV1() network, err := newNetwork(repoPath) if err != nil { return nil, err } - s, err := util.NewBadgerDatastore(repoPath, "eventstore", false) + s, err := tutil.NewBadgerDatastore(repoPath, "eventstore") if err != nil { return nil, err } @@ -106,7 +107,7 @@ func newJoinerClient(name, folderPath, repoPath string, addr ma.Multiaddr, key t return nil, err } - s, err := util.NewBadgerDatastore(repoPath, "eventstore", false) + s, err := tutil.NewBadgerDatastore(repoPath, "eventstore") if err != nil { return nil, err } @@ -130,7 +131,7 @@ func newJoinerClient(name, folderPath, repoPath string, addr ma.Multiaddr, key t func newNetwork(repoPath string) (common.NetBoostrapper, error) { network, err := common.DefaultNetwork( common.WithNetBadgerPersistence(repoPath), - common.WithNetHostAddr(util.FreeLocalAddr()), + common.WithNetHostAddr(tutil.FreeLocalAddr()), common.WithNetDebug(true), ) if err != nil { diff --git a/integrationtests/foldersync/foldersync_test.go b/integrationtests/foldersync/foldersync_test.go index b3f2f140..75563310 100644 --- a/integrationtests/foldersync/foldersync_test.go +++ b/integrationtests/foldersync/foldersync_test.go @@ -12,11 +12,12 @@ import ( "testing" "time" - logging "github.com/ipfs/go-log" + logging "github.com/ipfs/go-log/v2" ma "github.com/multiformats/go-multiaddr" core "github.com/textileio/go-threads/core/db" "github.com/textileio/go-threads/core/thread" "github.com/textileio/go-threads/db" + dutil "github.com/textileio/go-threads/db/util" "github.com/textileio/go-threads/util" ) @@ -33,7 +34,7 @@ func TestSimple(t *testing.T) { t.Skip("Skipping foldersync tests") } - id := thread.NewIDV1(thread.Raw, 32) + id := thread.NewRandomIDV1() // db0 @@ -43,7 +44,7 @@ func TestSimple(t *testing.T) { network0, err := newNetwork(repoPath0) checkErr(t, err) - store0, err := util.NewBadgerDatastore(repoPath0, "eventstore", false) + store0, err := util.NewBadgerDatastore(repoPath0, "eventstore") checkErr(t, err) defer store0.Close() db0, err := db.NewDB(context.Background(), store0, network0, id, db.WithNewCollections(cc)) @@ -63,7 +64,7 @@ func TestSimple(t *testing.T) { network1, err := newNetwork(repoPath1) checkErr(t, err) - store1, err := util.NewBadgerDatastore(repoPath1, "eventstore", false) + store1, err := util.NewBadgerDatastore(repoPath1, "eventstore") checkErr(t, err) defer store1.Close() db1, err := db.NewDBFromAddr( @@ -87,7 +88,7 @@ func TestSimple(t *testing.T) { network2, err := newNetwork(repoPath2) checkErr(t, err) - store2, err := util.NewBadgerDatastore(repoPath2, "eventstore", false) + store2, err := util.NewBadgerDatastore(repoPath2, "eventstore") checkErr(t, err) defer store2.Close() db2, err := db.NewDBFromAddr( @@ -111,7 +112,7 @@ func TestSimple(t *testing.T) { network3, err := newNetwork(repoPath3) checkErr(t, err) - store3, err := util.NewBadgerDatastore(repoPath3, "eventstore", false) + store3, err := util.NewBadgerDatastore(repoPath3, "eventstore") checkErr(t, err) defer store3.Close() db3, err := db.NewDBFromAddr( @@ -134,13 +135,13 @@ func TestSimple(t *testing.T) { folder2 := folder{ID: core.NewInstanceID(), Owner: "client2", Files: []file{}} folder3 := folder{ID: core.NewInstanceID(), Owner: "client3", Files: []file{}} - _, err = c0.Create(util.JSONFromInstance(folder0)) + _, err = c0.Create(dutil.JSONFromInstance(folder0)) checkErr(t, err) - _, err = c1.Create(util.JSONFromInstance(folder1)) + _, err = c1.Create(dutil.JSONFromInstance(folder1)) checkErr(t, err) - _, err = c2.Create(util.JSONFromInstance(folder2)) + _, err = c2.Create(dutil.JSONFromInstance(folder2)) checkErr(t, err) - _, err = c3.Create(util.JSONFromInstance(folder3)) + _, err = c3.Create(dutil.JSONFromInstance(folder3)) checkErr(t, err) time.Sleep(time.Second * 15) diff --git a/integrationtests/foldersync/watcher/watcher.go b/integrationtests/foldersync/watcher/watcher.go index 85e2d7c1..5d90eb37 100644 --- a/integrationtests/foldersync/watcher/watcher.go +++ b/integrationtests/foldersync/watcher/watcher.go @@ -4,7 +4,7 @@ import ( "sync" "github.com/fsnotify/fsnotify" - logging "github.com/ipfs/go-log" + logging "github.com/ipfs/go-log/v2" ) var ( diff --git a/jsonpatcher/jsonpatcher.go b/jsonpatcher/jsonpatcher.go index cfba615d..f4c8877f 100644 --- a/jsonpatcher/jsonpatcher.go +++ b/jsonpatcher/jsonpatcher.go @@ -13,7 +13,7 @@ import ( ds "github.com/ipfs/go-datastore" cbornode "github.com/ipfs/go-ipld-cbor" format "github.com/ipfs/go-ipld-format" - logging "github.com/ipfs/go-log" + logging "github.com/ipfs/go-log/v2" "github.com/multiformats/go-multihash" core "github.com/textileio/go-threads/core/db" ) @@ -39,7 +39,7 @@ func (ot operationType) String() (s string) { } var ( - log = logging.Logger("jsonpatcher") + log = logging.Logger("threads/jsonpatcher") errCantCreateExistingInstance = errors.New("cant't create already existent instance") errUnknownOperation = errors.New("unknown operation type") ) diff --git a/jwt/jwt.go b/jwt/jwt.go index 66522ff3..7be284eb 100644 --- a/jwt/jwt.go +++ b/jwt/jwt.go @@ -15,7 +15,7 @@ type SigningMethodEd25519 struct { var SigningMethodEd25519i *SigningMethodEd25519 func init() { - SigningMethodEd25519i = &SigningMethodEd25519{"Ed25519"} + SigningMethodEd25519i = &SigningMethodEd25519{"EdDSA"} jwt.RegisterSigningMethod(SigningMethodEd25519i.Alg(), func() jwt.SigningMethod { return SigningMethodEd25519i }) diff --git a/jwt/jwt_test.go b/jwt/jwt_test.go index 50e95752..a5c5cbde 100644 --- a/jwt/jwt_test.go +++ b/jwt/jwt_test.go @@ -20,23 +20,23 @@ var ed25519TestData = []struct { valid bool }{ { - "Ed25519", - "eyJhbGciOiJFZDI1NTE5IiwidHlwIjoiSldUIn0.eyJqdGkiOiJmb28iLCJzdWIiOiJiYXIifQ.E73qcBjcCSsYto_Pa5CpwZUu9lA3ecCVkZ8pJiFYNaOe2x-uZCDmZnx52AByO78oxft09GosVcJtqYNv1VBxDQ", - "Ed25519", + "EdDSA", + "eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJmb28iLCJzdWIiOiJiYXIifQ.bEOyiiKwfUnwxQxqCW7k6g_uriuCndKdiiX0F_Br0PkBbghDg4aP5sxotWFkNoPq_38Di5msYv-R6MiAk2nCBA", + "EdDSA", map[string]interface{}{"jti": "foo", "sub": "bar"}, true, }, { "invalid key", - "eyJhbGciOiJFZDI1NTE5IiwidHlwIjoiSldUIn0.eyJqdGkiOiJmb28iLCJzdWIiOiJiYXIifQ.7FSQFedbbRl42nvUWJqBswvjmyMaBBLKk0opiARjxtZmQ86dVMYs5wcZ0gItVV8YLVu6F5065IFD699tVcacBA", - "Ed25519", + "eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJmb28iLCJzdWIiOiJiYXIifQ.bEOyiiKwfUnwxQxqCW7k6g_uriuCndKdiiX0F_Br0PkBbghDg4aP5sxotWFkNoPq_38Di5msYv-R6MiAk2nABC", + "EdDSA", map[string]interface{}{"jti": "foo", "sub": "bar"}, false, }, } func TestSigningMethodEd25519_Alg(t *testing.T) { - if SigningMethodEd25519i.Alg() != "Ed25519" { + if SigningMethodEd25519i.Alg() != "EdDSA" { t.Fatal("wrong alg") } } @@ -86,8 +86,8 @@ func TestGenerateEd25519Token(t *testing.T) { t.Fatal(err) } claims := &jwt.StandardClaims{ - Id: "bar", - Subject: "foo", + Id: "foo", + Subject: "bar", } _, err = jwt.NewWithClaims(SigningMethodEd25519i, claims).SignedString(sk) if err != nil { diff --git a/logstore/lstoreds/addr_book.go b/logstore/lstoreds/addr_book.go index 0efce53b..cca8eadc 100644 --- a/logstore/lstoreds/addr_book.go +++ b/logstore/lstoreds/addr_book.go @@ -10,7 +10,7 @@ import ( lru "github.com/hashicorp/golang-lru" ds "github.com/ipfs/go-datastore" "github.com/ipfs/go-datastore/query" - logging "github.com/ipfs/go-log" + logging "github.com/ipfs/go-log/v2" "github.com/libp2p/go-libp2p-core/peer" "github.com/libp2p/go-libp2p-peerstore/pstoremem" ma "github.com/multiformats/go-multiaddr" @@ -28,7 +28,7 @@ const ( ) var ( - log = logging.Logger("logstore") + log = logging.Logger("threads/logstore") // Thread addresses are stored db key pattern: // /thread/addrs// diff --git a/logstore/lstoreds/ds_test.go b/logstore/lstoreds/ds_test.go index 2a5002c6..9099c256 100644 --- a/logstore/lstoreds/ds_test.go +++ b/logstore/lstoreds/ds_test.go @@ -8,7 +8,7 @@ import ( "time" ds "github.com/ipfs/go-datastore" - badger "github.com/textileio/go-ds-badger" + badger "github.com/textileio/go-ds-badger3" core "github.com/textileio/go-threads/core/logstore" pt "github.com/textileio/go-threads/test" ) diff --git a/logstore/lstorehybrid/hybrid_test.go b/logstore/lstorehybrid/hybrid_test.go index c5b43750..4f8dca11 100644 --- a/logstore/lstorehybrid/hybrid_test.go +++ b/logstore/lstorehybrid/hybrid_test.go @@ -6,7 +6,7 @@ import ( "os" "testing" - badger "github.com/textileio/go-ds-badger" + badger "github.com/textileio/go-ds-badger3" core "github.com/textileio/go-threads/core/logstore" "github.com/textileio/go-threads/logstore/lstoreds" m "github.com/textileio/go-threads/logstore/lstoremem" diff --git a/logstore/lstoremem/addr_book.go b/logstore/lstoremem/addr_book.go index 22d30930..254082e2 100644 --- a/logstore/lstoremem/addr_book.go +++ b/logstore/lstoremem/addr_book.go @@ -6,7 +6,7 @@ import ( "sync" "time" - logging "github.com/ipfs/go-log" + logging "github.com/ipfs/go-log/v2" "github.com/libp2p/go-libp2p-core/peer" "github.com/libp2p/go-libp2p-peerstore/addr" ma "github.com/multiformats/go-multiaddr" @@ -14,7 +14,7 @@ import ( "github.com/textileio/go-threads/core/thread" ) -var log = logging.Logger("logstore") +var log = logging.Logger("threads/logstore") type expiringAddr struct { Addr ma.Multiaddr diff --git a/net/api/client/client.go b/net/api/client/client.go index fdc6b650..20d2ebb3 100644 --- a/net/api/client/client.go +++ b/net/api/client/client.go @@ -2,16 +2,18 @@ package client import ( "context" - "fmt" + "encoding/json" "io" "log" "github.com/ipfs/go-cid" - "github.com/ipfs/go-ipld-format" + format "github.com/ipfs/go-ipld-format" ic "github.com/libp2p/go-libp2p-core/crypto" "github.com/libp2p/go-libp2p-core/peer" ma "github.com/multiformats/go-multiaddr" "github.com/textileio/go-threads/cbor" + "github.com/textileio/go-threads/core/did" + d "github.com/textileio/go-threads/core/did" core "github.com/textileio/go-threads/core/net" "github.com/textileio/go-threads/core/thread" "github.com/textileio/go-threads/crypto" @@ -26,7 +28,7 @@ import ( // Client provides the client api. type Client struct { - c pb.APIClient + c pb.APIServiceClient conn *grpc.ClientConn } @@ -39,7 +41,7 @@ func NewClient(target string, opts ...grpc.DialOption) (*Client, error) { return nil, err } return &Client{ - c: pb.NewAPIClient(conn), + c: pb.NewAPIServiceClient(conn), conn: conn, }, nil } @@ -49,73 +51,29 @@ func (c *Client) Close() error { return c.conn.Close() } -func (c *Client) GetHostID(ctx context.Context) (peer.ID, error) { - resp, err := c.c.GetHostID(ctx, &pb.GetHostIDRequest{}) - if err != nil { - return "", err - } - return peer.IDFromBytes(resp.PeerID) -} - -func (c *Client) GetToken(ctx context.Context, identity thread.Identity) (tok thread.Token, err error) { - stream, err := c.c.GetToken(ctx) +func (c *Client) GetServices(ctx context.Context) (doc d.Document, err error) { + res, err := c.c.GetServices(ctx, &pb.GetServicesRequest{}) if err != nil { return } - defer func() { - if e := stream.CloseSend(); e != nil && err == nil { - err = e - } - }() - if err = stream.Send(&pb.GetTokenRequest{ - Payload: &pb.GetTokenRequest_Key{ - Key: identity.GetPublic().String(), - }, - }); err == io.EOF { - var noOp interface{} - return tok, stream.RecvMsg(noOp) - } else if err != nil { - return - } - - rep, err := stream.Recv() - if err != nil { - return - } - var challenge []byte - switch payload := rep.Payload.(type) { - case *pb.GetTokenReply_Challenge: - challenge = payload.Challenge - default: - return tok, fmt.Errorf("challenge was not received") - } - - sig, err := identity.Sign(ctx, challenge) - if err != nil { - return - } - if err = stream.Send(&pb.GetTokenRequest{ - Payload: &pb.GetTokenRequest_Signature{ - Signature: sig, - }, - }); err == io.EOF { - var noOp interface{} - return tok, stream.RecvMsg(noOp) - } else if err != nil { - return + if err := json.Unmarshal(res.Doc, &doc); err != nil { + return doc, err } + return doc, nil +} - rep, err = stream.Recv() +func (c *Client) ValidateIdentity(ctx context.Context, identity did.Token) (thread.PubKey, did.DID, error) { + res, err := c.c.ValidateIdentity(ctx, &pb.ValidateIdentityRequest{ + Identity: string(identity), + }) if err != nil { - return + return nil, "", err } - switch payload := rep.Payload.(type) { - case *pb.GetTokenReply_Token: - tok = thread.Token(payload.Token) - default: - return tok, fmt.Errorf("token was not received") + pk := &thread.Libp2pPubKey{} + if err = pk.UnmarshalBinary(res.PubKey); err != nil { + return nil, "", err } - return tok, nil + return pk, did.DID(res.Did), err } func (c *Client) CreateThread(ctx context.Context, id thread.ID, opts ...core.NewThreadOption) (info thread.Info, err error) { @@ -127,15 +85,15 @@ func (c *Client) CreateThread(ctx context.Context, id thread.ID, opts ...core.Ne if err != nil { return } - ctx = thread.NewTokenContext(ctx, args.Token) - resp, err := c.c.CreateThread(ctx, &pb.CreateThreadRequest{ + ctx = d.NewTokenContext(ctx, args.Token) + res, err := c.c.CreateThread(ctx, &pb.CreateThreadRequest{ ThreadID: id.Bytes(), Keys: keys, }) if err != nil { return } - return threadInfoFromProto(resp) + return threadInfoFromProto(res) } func (c *Client) AddThread(ctx context.Context, addr ma.Multiaddr, opts ...core.NewThreadOption) (info thread.Info, err error) { @@ -147,15 +105,15 @@ func (c *Client) AddThread(ctx context.Context, addr ma.Multiaddr, opts ...core. if err != nil { return } - ctx = thread.NewTokenContext(ctx, args.Token) - resp, err := c.c.AddThread(ctx, &pb.AddThreadRequest{ + ctx = d.NewTokenContext(ctx, args.Token) + res, err := c.c.AddThread(ctx, &pb.AddThreadRequest{ Addr: addr.Bytes(), Keys: keys, }) if err != nil { return } - return threadInfoFromProto(resp) + return threadInfoFromProto(res) } func (c *Client) GetThread(ctx context.Context, id thread.ID, opts ...core.ThreadOption) (info thread.Info, err error) { @@ -163,14 +121,14 @@ func (c *Client) GetThread(ctx context.Context, id thread.ID, opts ...core.Threa for _, opt := range opts { opt(args) } - ctx = thread.NewTokenContext(ctx, args.Token) - resp, err := c.c.GetThread(ctx, &pb.GetThreadRequest{ + ctx = d.NewTokenContext(ctx, args.Token) + res, err := c.c.GetThread(ctx, &pb.GetThreadRequest{ ThreadID: id.Bytes(), }) if err != nil { return } - return threadInfoFromProto(resp) + return threadInfoFromProto(res) } func (c *Client) PullThread(ctx context.Context, id thread.ID, opts ...core.ThreadOption) error { @@ -178,7 +136,7 @@ func (c *Client) PullThread(ctx context.Context, id thread.ID, opts ...core.Thre for _, opt := range opts { opt(args) } - ctx = thread.NewTokenContext(ctx, args.Token) + ctx = d.NewTokenContext(ctx, args.Token) _, err := c.c.PullThread(ctx, &pb.PullThreadRequest{ ThreadID: id.Bytes(), }) @@ -190,7 +148,7 @@ func (c *Client) DeleteThread(ctx context.Context, id thread.ID, opts ...core.Th for _, opt := range opts { opt(args) } - ctx = thread.NewTokenContext(ctx, args.Token) + ctx = d.NewTokenContext(ctx, args.Token) _, err := c.c.DeleteThread(ctx, &pb.DeleteThreadRequest{ ThreadID: id.Bytes(), }) @@ -202,15 +160,15 @@ func (c *Client) AddReplicator(ctx context.Context, id thread.ID, paddr ma.Multi for _, opt := range opts { opt(args) } - ctx = thread.NewTokenContext(ctx, args.Token) - resp, err := c.c.AddReplicator(ctx, &pb.AddReplicatorRequest{ + ctx = d.NewTokenContext(ctx, args.Token) + res, err := c.c.AddReplicator(ctx, &pb.AddReplicatorRequest{ ThreadID: id.Bytes(), Addr: paddr.Bytes(), }) if err != nil { return } - return peer.IDFromBytes(resp.PeerID) + return peer.IDFromBytes(res.PeerID) } func (c *Client) CreateRecord(ctx context.Context, id thread.ID, body format.Node, opts ...core.ThreadOption) (core.ThreadRecord, error) { @@ -222,15 +180,15 @@ func (c *Client) CreateRecord(ctx context.Context, id thread.ID, body format.Nod if err != nil { return nil, err } - ctx = thread.NewTokenContext(ctx, args.Token) - resp, err := c.c.CreateRecord(ctx, &pb.CreateRecordRequest{ + ctx = d.NewTokenContext(ctx, args.Token) + res, err := c.c.CreateRecord(ctx, &pb.CreateRecordRequest{ ThreadID: id.Bytes(), Body: body.RawData(), }) if err != nil { return nil, err } - return threadRecordFromProto(resp, info.Key.Service()) + return threadRecordFromProto(res, info.Key.Service()) } func (c *Client) AddRecord(ctx context.Context, id thread.ID, lid peer.ID, rec core.Record, opts ...core.ThreadOption) error { @@ -243,7 +201,7 @@ func (c *Client) AddRecord(ctx context.Context, id thread.ID, lid peer.ID, rec c if err != nil { return err } - ctx = thread.NewTokenContext(ctx, args.Token) + ctx = d.NewTokenContext(ctx, args.Token) _, err = c.c.AddRecord(ctx, &pb.AddRecordRequest{ ThreadID: id.Bytes(), LogID: lidb, @@ -261,15 +219,15 @@ func (c *Client) GetRecord(ctx context.Context, id thread.ID, rid cid.Cid, opts if err != nil { return nil, err } - ctx = thread.NewTokenContext(ctx, args.Token) - resp, err := c.c.GetRecord(ctx, &pb.GetRecordRequest{ + ctx = d.NewTokenContext(ctx, args.Token) + res, err := c.c.GetRecord(ctx, &pb.GetRecordRequest{ ThreadID: id.Bytes(), RecordID: rid.Bytes(), }) if err != nil { return nil, err } - return cbor.RecordFromProto(util.RecToServiceRec(resp.Record), info.Key.Service()) + return cbor.RecordFromProto(util.RecToServiceRec(res.Record), info.Key.Service()) } func (c *Client) Subscribe(ctx context.Context, opts ...core.SubOption) (<-chan core.ThreadRecord, error) { @@ -282,7 +240,7 @@ func (c *Client) Subscribe(ctx context.Context, opts ...core.SubOption) (<-chan for i, id := range args.ThreadIDs { ids[i] = id.Bytes() } - ctx = thread.NewTokenContext(ctx, args.Token) + ctx = d.NewTokenContext(ctx, args.Token) stream, err := c.c.Subscribe(ctx, &pb.SubscribeRequest{ ThreadIDs: ids, }) @@ -294,7 +252,7 @@ func (c *Client) Subscribe(ctx context.Context, opts ...core.SubOption) (<-chan go func() { defer close(channel) for { - resp, err := stream.Recv() + res, err := stream.Recv() if err == io.EOF { return } @@ -305,7 +263,7 @@ func (c *Client) Subscribe(ctx context.Context, opts ...core.SubOption) (<-chan } return } - threadID, err := thread.Cast(resp.ThreadID) + threadID, err := thread.Cast(res.ThreadID) if err != nil { log.Fatalf("error casting thread ID: %v", err) } @@ -322,7 +280,7 @@ func (c *Client) Subscribe(ctx context.Context, opts ...core.SubOption) (<-chan sk = info.Key.Service() threads[threadID] = sk } - rec, err := threadRecordFromProto(resp, sk) + rec, err := threadRecordFromProto(res, sk) if err != nil { log.Fatalf("error unpacking record: %v", err) } diff --git a/net/api/client/client_test.go b/net/api/client/client_test.go index 7d1caf5b..6cdc3033 100644 --- a/net/api/client/client_test.go +++ b/net/api/client/client_test.go @@ -23,6 +23,7 @@ import ( "github.com/phayes/freeport" "github.com/textileio/go-threads/cbor" "github.com/textileio/go-threads/common" + "github.com/textileio/go-threads/core/did" core "github.com/textileio/go-threads/core/net" "github.com/textileio/go-threads/core/thread" sym "github.com/textileio/go-threads/crypto/symmetric" @@ -33,32 +34,14 @@ import ( "google.golang.org/grpc" ) -func TestClient_GetHostID(t *testing.T) { +func TestClient_GetServices(t *testing.T) { t.Parallel() _, client, done := setup(t) defer done() - t.Run("test get host ID", func(t *testing.T) { - if _, err := client.GetHostID(context.Background()); err != nil { - t.Fatalf("failed to get host ID: %v", err) - } - }) -} - -func TestClient_GetToken(t *testing.T) { - t.Parallel() - _, client, done := setup(t) - defer done() - - identity := createIdentity(t) - - t.Run("test get token", func(t *testing.T) { - tok, err := client.GetToken(context.Background(), identity) - if err != nil { - t.Fatalf("failed to get token: %v", err) - } - if tok == "" { - t.Fatal("emtpy token") + t.Run("test get services", func(t *testing.T) { + if _, err := client.GetServices(context.Background()); err != nil { + t.Fatalf("failed to get services: %v", err) } }) } @@ -69,7 +52,7 @@ func TestClient_CreateThread(t *testing.T) { defer done() t.Run("test create thread", func(t *testing.T) { - id := thread.NewIDV1(thread.Raw, 32) + id := thread.NewRandomIDV1() info, err := client.CreateThread(context.Background(), id) if err != nil { t.Fatalf("failed to create thread: %v", err) @@ -93,12 +76,12 @@ func TestClient_AddThread(t *testing.T) { _, client2, done2 := setup(t) defer done2() - hostID1, err := client1.GetHostID(context.Background()) + hostDoc1, err := client1.GetServices(context.Background()) if err != nil { t.Fatal(err) } info1 := createThread(t, client1) - addr := threadAddr(t, hostAddr1, hostID1, info1) + addr := threadAddr(t, hostAddr1, hostDoc1.ID, info1) t.Run("test add thread", func(t *testing.T) { info2, err := client2.AddThread(context.Background(), addr, core.WithThreadKey(info1.Key)) @@ -168,13 +151,13 @@ func TestClient_AddReplicator(t *testing.T) { defer done2() info := createThread(t, client1) - hostID2, err := client2.GetHostID(context.Background()) + hostDoc2, err := client2.GetServices(context.Background()) if err != nil { t.Fatal(err) } t.Run("test add replicator", func(t *testing.T) { - addr := peerAddr(t, hostAddr2, hostID2) + addr := peerAddr(t, hostAddr2, hostDoc2.ID) pid, err := client1.AddReplicator(context.Background(), info.ID, addr) if err != nil { t.Fatalf("failed to add replicator: %v", err) @@ -219,24 +202,24 @@ func TestClient_AddRecord(t *testing.T) { defer done() // Create a thread, keeping read key and log private key on the client - id := thread.NewIDV1(thread.Raw, 32) + id := thread.NewRandomIDV1() tk := thread.NewRandomKey() logSk, logPk, err := crypto.GenerateEd25519Key(crand.Reader) if err != nil { t.Fatal(err) } identity := createIdentity(t) - tok, err := client.GetToken(context.Background(), identity) - if err != nil { - t.Fatal(err) - } + //tok, err := client.GetToken(context.Background(), identity) + //if err != nil { + // t.Fatal(err) + //} _, err = client.CreateThread( context.Background(), id, core.WithThreadKey(thread.NewServiceKey(tk.Service())), - core.WithLogKey(logPk), - core.WithNewThreadToken(tok)) + core.WithLogKey(logPk)) + //core.WithNewThreadToken(tok)) if err != nil { t.Fatal(err) } @@ -322,11 +305,11 @@ func TestClient_Subscribe(t *testing.T) { defer done2() info := createThread(t, client1) - hostID2, err := client2.GetHostID(context.Background()) + hostDoc2, err := client2.GetServices(context.Background()) if err != nil { t.Fatal(err) } - addr := peerAddr(t, hostAddr2, hostID2) + addr := peerAddr(t, hostAddr2, hostDoc2.ID) if _, err := client1.AddReplicator(context.Background(), info.ID, addr); err != nil { t.Fatal(err) } @@ -382,7 +365,7 @@ func TestClient_Close(t *testing.T) { if err != nil { t.Fatal(err) } - client, err := NewClient(target, grpc.WithInsecure(), grpc.WithPerRPCCredentials(thread.Credentials{})) + client, err := NewClient(target, grpc.WithInsecure(), grpc.WithPerRPCCredentials(did.RPCCredentials{})) if err != nil { t.Fatal(err) } @@ -400,7 +383,7 @@ func setup(t *testing.T) (ma.Multiaddr, *Client, func()) { if err != nil { t.Fatal(err) } - client, err := NewClient(target, grpc.WithInsecure(), grpc.WithPerRPCCredentials(thread.Credentials{})) + client, err := NewClient(target, grpc.WithInsecure(), grpc.WithPerRPCCredentials(did.RPCCredentials{})) if err != nil { t.Fatal(err) } @@ -448,7 +431,7 @@ func makeServer(t *testing.T) (ma.Multiaddr, ma.Multiaddr, func()) { t.Fatal(err) } go func() { - pb.RegisterAPIServer(server, service) + pb.RegisterAPIServiceServer(server, service) if err := server.Serve(listener); err != nil && !errors.Is(err, grpc.ErrServerStopped) { log.Fatalf("serve error: %v", err) } @@ -472,7 +455,7 @@ func createIdentity(t *testing.T) thread.Identity { } func createThread(t *testing.T, client *Client) thread.Info { - id := thread.NewIDV1(thread.Raw, 32) + id := thread.NewRandomIDV1() info, err := client.CreateThread(context.Background(), id) if err != nil { t.Fatal(err) @@ -480,20 +463,28 @@ func createThread(t *testing.T, client *Client) thread.Info { return info } -func threadAddr(t *testing.T, hostAddr ma.Multiaddr, hostID peer.ID, info thread.Info) ma.Multiaddr { - pa, err := ma.NewMultiaddr("/p2p/" + hostID.String()) +func threadAddr(t *testing.T, hostAddr ma.Multiaddr, hostDID did.DID, info thread.Info) ma.Multiaddr { + d, err := hostDID.Decode() + if err != nil { + t.Fatal(err) + } + pa, err := ma.NewMultiaddr("/p2p/" + d.ID) if err != nil { t.Fatal(err) } - ta, err := ma.NewMultiaddr("/" + thread.Name + "/" + info.ID.String()) + ta, err := ma.NewMultiaddr("/" + thread.ProtocolName + "/" + info.ID.String()) if err != nil { t.Fatal(err) } return hostAddr.Encapsulate(pa.Encapsulate(ta)) } -func peerAddr(t *testing.T, hostAddr ma.Multiaddr, hostID peer.ID) ma.Multiaddr { - pa, err := ma.NewMultiaddr("/p2p/" + hostID.String()) +func peerAddr(t *testing.T, hostAddr ma.Multiaddr, hostDID did.DID) ma.Multiaddr { + d, err := hostDID.Decode() + if err != nil { + t.Fatal(err) + } + pa, err := ma.NewMultiaddr("/p2p/" + d.ID) if err != nil { t.Fatal(err) } diff --git a/net/api/pb/Makefile b/net/api/pb/Makefile deleted file mode 100644 index 897702e3..00000000 --- a/net/api/pb/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -PB = $(wildcard *.proto) -GO = $(PB:.proto=.pb.go) -PROTOC_GEN_TS_PATH = "./javascript/node_modules/.bin/protoc-gen-ts" - -all: $(GO) - -%.pb.go: %.proto - protoc -I=. \ - --plugin="protoc-gen-ts=${PROTOC_GEN_TS_PATH}" --js_out="import_style=commonjs,binary:javascript/." --ts_out="service=grpc-web:javascript/." \ - --go_out=\ - plugins=grpc:\ - . $< - -clean: - rm -f *.pb.go - rm -f *pb_test.go - rm -f ./javascript/*.js - rm -f ./javascript/*.d.ts - -.PHONY: clean \ No newline at end of file diff --git a/net/api/pb/javascript/package-lock.json b/net/api/pb/javascript/package-lock.json index f816572b..abab9a1f 100644 --- a/net/api/pb/javascript/package-lock.json +++ b/net/api/pb/javascript/package-lock.json @@ -1,21 +1,21 @@ { - "name": "@textile/threads-net-grpc", + "name": "@textile/threads-grpc", "version": "0.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { "@improbable-eng/grpc-web": { - "version": "0.13.0", - "resolved": "https://registry.npmjs.org/@improbable-eng/grpc-web/-/grpc-web-0.13.0.tgz", - "integrity": "sha512-vaxxT+Qwb7GPqDQrBV4vAAfH0HywgOLw6xGIKXd9Q8hcV63CQhmS3p4+pZ9/wVvt4Ph3ZDK9fdC983b9aGMUFg==", + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/@improbable-eng/grpc-web/-/grpc-web-0.14.0.tgz", + "integrity": "sha512-ag1PTMWpBZKGi6GrEcZ4lkU5Qag23Xjo10BmnK9qyx4TMmSVcWmQ3rECirfQzm2uogrM9n1M6xfOpFsJP62ivA==", "requires": { - "browser-headers": "^0.4.0" + "browser-headers": "^0.4.1" } }, "@types/google-protobuf": { - "version": "3.7.3", - "resolved": "https://registry.npmjs.org/@types/google-protobuf/-/google-protobuf-3.7.3.tgz", - "integrity": "sha512-FRwj40euE2bYkG+0X5w2nEA8yAzgJRcEa7RBd0Gsdkb9/tPM2pctVVAvnOUTbcXo2VmIHPo0Ae94Gl9vRHfKzg==" + "version": "3.7.4", + "resolved": "https://registry.npmjs.org/@types/google-protobuf/-/google-protobuf-3.7.4.tgz", + "integrity": "sha512-6PjMFKl13cgB4kRdYtvyjKl8VVa0PXS2IdVxHhQ8GEKbxBkyJtSbaIeK1eZGjDKN7dvUh4vkOvU9FMwYNv4GQQ==" }, "browser-headers": { "version": "0.4.1", @@ -23,14 +23,14 @@ "integrity": "sha512-CA9hsySZVo9371qEHjHZtYxV2cFtVj5Wj/ZHi8ooEsrtm4vOnl9Y9HmyYWk9q+05d7K3rdoAE0j3MVEFVvtQtg==" }, "google-protobuf": { - "version": "3.13.0", - "resolved": "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.13.0.tgz", - "integrity": "sha512-ZIf3qfLFayVrPvAjeKKxO5FRF1/NwRxt6Dko+fWEMuHwHbZx8/fcaAao9b0wCM6kr8qeg2te8XTpyuvKuD9aKw==" + "version": "3.15.5", + "resolved": "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.15.5.tgz", + "integrity": "sha512-6bLpAI4nMIQODlegR7OevgkCoyOj5frLVDArUpeuBWad7XWUNWMGP0v5lz1/aeUI6Yf3cG9XA6acZkPxom4SEw==" }, "ts-protoc-gen": { - "version": "0.13.0", - "resolved": "https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.13.0.tgz", - "integrity": "sha512-j18X4rkDBbG/ZHUJy88WFeZP6mStGow5uREaohowlHXTu3/N7WcpyPhb7Vh6wN38ERmc/AkT9gqT98+vtlRhJA==", + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.14.0.tgz", + "integrity": "sha512-2z6w2HioMCMVNcgNHBcEvudmQfzrn+3BjAlz+xgYZ9L0o8n8UG8WUiTJcbXHFiEg2SU8IltwH2pm1otLoMSKwg==", "dev": true, "requires": { "google-protobuf": "^3.6.1" diff --git a/net/api/pb/javascript/package.json b/net/api/pb/javascript/package.json index e28e028b..483f09a5 100644 --- a/net/api/pb/javascript/package.json +++ b/net/api/pb/javascript/package.json @@ -1,7 +1,7 @@ { - "name": "@textile/threads-net-grpc", + "name": "@textile/threads-grpc", "version": "0.0.0", - "description": "A gRPC client for interacting with a remote ThreadDB network service.", + "description": "A client for interacting with the Threads gRPC API.", "repository": { "type": "git", "url": "git+https://github.com/textileio/go-threads.git" @@ -9,17 +9,17 @@ "author": "Textile", "license": "MIT", "files": [ - "threadsnet_pb.js", - "threadsnet_pb_service.js", - "threadsnet_pb.d.ts", - "threadsnet_pb_service.d.ts" + "net/api/pb/threads_pb.js", + "net/api/pb/threads_pb_service.js", + "net/api/pb/threads_pb.d.ts", + "net/api/pb/threads_pb_service.d.ts" ], "dependencies": { - "@improbable-eng/grpc-web": "^0.13.0", - "@types/google-protobuf": "^3.7.3", - "google-protobuf": "^3.13.0" + "@improbable-eng/grpc-web": "^0.14.0", + "@types/google-protobuf": "^3.7.4", + "google-protobuf": "^3.15.5" }, "devDependencies": { - "ts-protoc-gen": "^0.13.0" + "ts-protoc-gen": "^0.14.0" } } diff --git a/net/api/pb/threads.pb.go b/net/api/pb/threads.pb.go new file mode 100644 index 00000000..cd60170a --- /dev/null +++ b/net/api/pb/threads.pb.go @@ -0,0 +1,2358 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.23.0 +// protoc v3.13.0 +// source: net/api/pb/threads.proto + +package pb + +import ( + context "context" + proto "github.com/golang/protobuf/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type GetServicesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *GetServicesRequest) Reset() { + *x = GetServicesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_net_api_pb_threads_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetServicesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetServicesRequest) ProtoMessage() {} + +func (x *GetServicesRequest) ProtoReflect() protoreflect.Message { + mi := &file_net_api_pb_threads_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetServicesRequest.ProtoReflect.Descriptor instead. +func (*GetServicesRequest) Descriptor() ([]byte, []int) { + return file_net_api_pb_threads_proto_rawDescGZIP(), []int{0} +} + +type GetServicesReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Doc []byte `protobuf:"bytes,1,opt,name=doc,proto3" json:"doc,omitempty"` +} + +func (x *GetServicesReply) Reset() { + *x = GetServicesReply{} + if protoimpl.UnsafeEnabled { + mi := &file_net_api_pb_threads_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetServicesReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetServicesReply) ProtoMessage() {} + +func (x *GetServicesReply) ProtoReflect() protoreflect.Message { + mi := &file_net_api_pb_threads_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetServicesReply.ProtoReflect.Descriptor instead. +func (*GetServicesReply) Descriptor() ([]byte, []int) { + return file_net_api_pb_threads_proto_rawDescGZIP(), []int{1} +} + +func (x *GetServicesReply) GetDoc() []byte { + if x != nil { + return x.Doc + } + return nil +} + +type ValidateIdentityRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Identity string `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"` +} + +func (x *ValidateIdentityRequest) Reset() { + *x = ValidateIdentityRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_net_api_pb_threads_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ValidateIdentityRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidateIdentityRequest) ProtoMessage() {} + +func (x *ValidateIdentityRequest) ProtoReflect() protoreflect.Message { + mi := &file_net_api_pb_threads_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ValidateIdentityRequest.ProtoReflect.Descriptor instead. +func (*ValidateIdentityRequest) Descriptor() ([]byte, []int) { + return file_net_api_pb_threads_proto_rawDescGZIP(), []int{2} +} + +func (x *ValidateIdentityRequest) GetIdentity() string { + if x != nil { + return x.Identity + } + return "" +} + +type ValidateIdentityReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PubKey []byte `protobuf:"bytes,1,opt,name=pubKey,proto3" json:"pubKey,omitempty"` + Did string `protobuf:"bytes,2,opt,name=did,proto3" json:"did,omitempty"` +} + +func (x *ValidateIdentityReply) Reset() { + *x = ValidateIdentityReply{} + if protoimpl.UnsafeEnabled { + mi := &file_net_api_pb_threads_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ValidateIdentityReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidateIdentityReply) ProtoMessage() {} + +func (x *ValidateIdentityReply) ProtoReflect() protoreflect.Message { + mi := &file_net_api_pb_threads_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ValidateIdentityReply.ProtoReflect.Descriptor instead. +func (*ValidateIdentityReply) Descriptor() ([]byte, []int) { + return file_net_api_pb_threads_proto_rawDescGZIP(), []int{3} +} + +func (x *ValidateIdentityReply) GetPubKey() []byte { + if x != nil { + return x.PubKey + } + return nil +} + +func (x *ValidateIdentityReply) GetDid() string { + if x != nil { + return x.Did + } + return "" +} + +type CreateThreadRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ThreadID []byte `protobuf:"bytes,1,opt,name=threadID,proto3" json:"threadID,omitempty"` + Keys *Keys `protobuf:"bytes,2,opt,name=keys,proto3" json:"keys,omitempty"` +} + +func (x *CreateThreadRequest) Reset() { + *x = CreateThreadRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_net_api_pb_threads_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateThreadRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateThreadRequest) ProtoMessage() {} + +func (x *CreateThreadRequest) ProtoReflect() protoreflect.Message { + mi := &file_net_api_pb_threads_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateThreadRequest.ProtoReflect.Descriptor instead. +func (*CreateThreadRequest) Descriptor() ([]byte, []int) { + return file_net_api_pb_threads_proto_rawDescGZIP(), []int{4} +} + +func (x *CreateThreadRequest) GetThreadID() []byte { + if x != nil { + return x.ThreadID + } + return nil +} + +func (x *CreateThreadRequest) GetKeys() *Keys { + if x != nil { + return x.Keys + } + return nil +} + +type Keys struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ThreadKey []byte `protobuf:"bytes,1,opt,name=threadKey,proto3" json:"threadKey,omitempty"` + LogKey []byte `protobuf:"bytes,2,opt,name=logKey,proto3" json:"logKey,omitempty"` +} + +func (x *Keys) Reset() { + *x = Keys{} + if protoimpl.UnsafeEnabled { + mi := &file_net_api_pb_threads_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Keys) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Keys) ProtoMessage() {} + +func (x *Keys) ProtoReflect() protoreflect.Message { + mi := &file_net_api_pb_threads_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Keys.ProtoReflect.Descriptor instead. +func (*Keys) Descriptor() ([]byte, []int) { + return file_net_api_pb_threads_proto_rawDescGZIP(), []int{5} +} + +func (x *Keys) GetThreadKey() []byte { + if x != nil { + return x.ThreadKey + } + return nil +} + +func (x *Keys) GetLogKey() []byte { + if x != nil { + return x.LogKey + } + return nil +} + +type ThreadInfoReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ThreadID []byte `protobuf:"bytes,1,opt,name=threadID,proto3" json:"threadID,omitempty"` + ThreadKey []byte `protobuf:"bytes,2,opt,name=threadKey,proto3" json:"threadKey,omitempty"` + Logs []*LogInfo `protobuf:"bytes,3,rep,name=logs,proto3" json:"logs,omitempty"` + Addrs [][]byte `protobuf:"bytes,4,rep,name=addrs,proto3" json:"addrs,omitempty"` +} + +func (x *ThreadInfoReply) Reset() { + *x = ThreadInfoReply{} + if protoimpl.UnsafeEnabled { + mi := &file_net_api_pb_threads_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ThreadInfoReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ThreadInfoReply) ProtoMessage() {} + +func (x *ThreadInfoReply) ProtoReflect() protoreflect.Message { + mi := &file_net_api_pb_threads_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ThreadInfoReply.ProtoReflect.Descriptor instead. +func (*ThreadInfoReply) Descriptor() ([]byte, []int) { + return file_net_api_pb_threads_proto_rawDescGZIP(), []int{6} +} + +func (x *ThreadInfoReply) GetThreadID() []byte { + if x != nil { + return x.ThreadID + } + return nil +} + +func (x *ThreadInfoReply) GetThreadKey() []byte { + if x != nil { + return x.ThreadKey + } + return nil +} + +func (x *ThreadInfoReply) GetLogs() []*LogInfo { + if x != nil { + return x.Logs + } + return nil +} + +func (x *ThreadInfoReply) GetAddrs() [][]byte { + if x != nil { + return x.Addrs + } + return nil +} + +type LogInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ID []byte `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"` + PubKey []byte `protobuf:"bytes,2,opt,name=pubKey,proto3" json:"pubKey,omitempty"` + PrivKey []byte `protobuf:"bytes,3,opt,name=privKey,proto3" json:"privKey,omitempty"` + Addrs [][]byte `protobuf:"bytes,4,rep,name=addrs,proto3" json:"addrs,omitempty"` + Head []byte `protobuf:"bytes,5,opt,name=head,proto3" json:"head,omitempty"` +} + +func (x *LogInfo) Reset() { + *x = LogInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_net_api_pb_threads_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LogInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LogInfo) ProtoMessage() {} + +func (x *LogInfo) ProtoReflect() protoreflect.Message { + mi := &file_net_api_pb_threads_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LogInfo.ProtoReflect.Descriptor instead. +func (*LogInfo) Descriptor() ([]byte, []int) { + return file_net_api_pb_threads_proto_rawDescGZIP(), []int{7} +} + +func (x *LogInfo) GetID() []byte { + if x != nil { + return x.ID + } + return nil +} + +func (x *LogInfo) GetPubKey() []byte { + if x != nil { + return x.PubKey + } + return nil +} + +func (x *LogInfo) GetPrivKey() []byte { + if x != nil { + return x.PrivKey + } + return nil +} + +func (x *LogInfo) GetAddrs() [][]byte { + if x != nil { + return x.Addrs + } + return nil +} + +func (x *LogInfo) GetHead() []byte { + if x != nil { + return x.Head + } + return nil +} + +type AddThreadRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Addr []byte `protobuf:"bytes,1,opt,name=addr,proto3" json:"addr,omitempty"` + Keys *Keys `protobuf:"bytes,2,opt,name=keys,proto3" json:"keys,omitempty"` +} + +func (x *AddThreadRequest) Reset() { + *x = AddThreadRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_net_api_pb_threads_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AddThreadRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddThreadRequest) ProtoMessage() {} + +func (x *AddThreadRequest) ProtoReflect() protoreflect.Message { + mi := &file_net_api_pb_threads_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AddThreadRequest.ProtoReflect.Descriptor instead. +func (*AddThreadRequest) Descriptor() ([]byte, []int) { + return file_net_api_pb_threads_proto_rawDescGZIP(), []int{8} +} + +func (x *AddThreadRequest) GetAddr() []byte { + if x != nil { + return x.Addr + } + return nil +} + +func (x *AddThreadRequest) GetKeys() *Keys { + if x != nil { + return x.Keys + } + return nil +} + +type GetThreadRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ThreadID []byte `protobuf:"bytes,1,opt,name=threadID,proto3" json:"threadID,omitempty"` +} + +func (x *GetThreadRequest) Reset() { + *x = GetThreadRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_net_api_pb_threads_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetThreadRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetThreadRequest) ProtoMessage() {} + +func (x *GetThreadRequest) ProtoReflect() protoreflect.Message { + mi := &file_net_api_pb_threads_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetThreadRequest.ProtoReflect.Descriptor instead. +func (*GetThreadRequest) Descriptor() ([]byte, []int) { + return file_net_api_pb_threads_proto_rawDescGZIP(), []int{9} +} + +func (x *GetThreadRequest) GetThreadID() []byte { + if x != nil { + return x.ThreadID + } + return nil +} + +type PullThreadRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ThreadID []byte `protobuf:"bytes,1,opt,name=threadID,proto3" json:"threadID,omitempty"` +} + +func (x *PullThreadRequest) Reset() { + *x = PullThreadRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_net_api_pb_threads_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PullThreadRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PullThreadRequest) ProtoMessage() {} + +func (x *PullThreadRequest) ProtoReflect() protoreflect.Message { + mi := &file_net_api_pb_threads_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PullThreadRequest.ProtoReflect.Descriptor instead. +func (*PullThreadRequest) Descriptor() ([]byte, []int) { + return file_net_api_pb_threads_proto_rawDescGZIP(), []int{10} +} + +func (x *PullThreadRequest) GetThreadID() []byte { + if x != nil { + return x.ThreadID + } + return nil +} + +type PullThreadReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *PullThreadReply) Reset() { + *x = PullThreadReply{} + if protoimpl.UnsafeEnabled { + mi := &file_net_api_pb_threads_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PullThreadReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PullThreadReply) ProtoMessage() {} + +func (x *PullThreadReply) ProtoReflect() protoreflect.Message { + mi := &file_net_api_pb_threads_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PullThreadReply.ProtoReflect.Descriptor instead. +func (*PullThreadReply) Descriptor() ([]byte, []int) { + return file_net_api_pb_threads_proto_rawDescGZIP(), []int{11} +} + +type DeleteThreadRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ThreadID []byte `protobuf:"bytes,1,opt,name=threadID,proto3" json:"threadID,omitempty"` +} + +func (x *DeleteThreadRequest) Reset() { + *x = DeleteThreadRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_net_api_pb_threads_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteThreadRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteThreadRequest) ProtoMessage() {} + +func (x *DeleteThreadRequest) ProtoReflect() protoreflect.Message { + mi := &file_net_api_pb_threads_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteThreadRequest.ProtoReflect.Descriptor instead. +func (*DeleteThreadRequest) Descriptor() ([]byte, []int) { + return file_net_api_pb_threads_proto_rawDescGZIP(), []int{12} +} + +func (x *DeleteThreadRequest) GetThreadID() []byte { + if x != nil { + return x.ThreadID + } + return nil +} + +type DeleteThreadReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *DeleteThreadReply) Reset() { + *x = DeleteThreadReply{} + if protoimpl.UnsafeEnabled { + mi := &file_net_api_pb_threads_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteThreadReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteThreadReply) ProtoMessage() {} + +func (x *DeleteThreadReply) ProtoReflect() protoreflect.Message { + mi := &file_net_api_pb_threads_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteThreadReply.ProtoReflect.Descriptor instead. +func (*DeleteThreadReply) Descriptor() ([]byte, []int) { + return file_net_api_pb_threads_proto_rawDescGZIP(), []int{13} +} + +type AddReplicatorRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ThreadID []byte `protobuf:"bytes,1,opt,name=threadID,proto3" json:"threadID,omitempty"` + Addr []byte `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"` +} + +func (x *AddReplicatorRequest) Reset() { + *x = AddReplicatorRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_net_api_pb_threads_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AddReplicatorRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddReplicatorRequest) ProtoMessage() {} + +func (x *AddReplicatorRequest) ProtoReflect() protoreflect.Message { + mi := &file_net_api_pb_threads_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AddReplicatorRequest.ProtoReflect.Descriptor instead. +func (*AddReplicatorRequest) Descriptor() ([]byte, []int) { + return file_net_api_pb_threads_proto_rawDescGZIP(), []int{14} +} + +func (x *AddReplicatorRequest) GetThreadID() []byte { + if x != nil { + return x.ThreadID + } + return nil +} + +func (x *AddReplicatorRequest) GetAddr() []byte { + if x != nil { + return x.Addr + } + return nil +} + +type AddReplicatorReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PeerID []byte `protobuf:"bytes,1,opt,name=peerID,proto3" json:"peerID,omitempty"` +} + +func (x *AddReplicatorReply) Reset() { + *x = AddReplicatorReply{} + if protoimpl.UnsafeEnabled { + mi := &file_net_api_pb_threads_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AddReplicatorReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddReplicatorReply) ProtoMessage() {} + +func (x *AddReplicatorReply) ProtoReflect() protoreflect.Message { + mi := &file_net_api_pb_threads_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AddReplicatorReply.ProtoReflect.Descriptor instead. +func (*AddReplicatorReply) Descriptor() ([]byte, []int) { + return file_net_api_pb_threads_proto_rawDescGZIP(), []int{15} +} + +func (x *AddReplicatorReply) GetPeerID() []byte { + if x != nil { + return x.PeerID + } + return nil +} + +type CreateRecordRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ThreadID []byte `protobuf:"bytes,1,opt,name=threadID,proto3" json:"threadID,omitempty"` + Body []byte `protobuf:"bytes,2,opt,name=body,proto3" json:"body,omitempty"` +} + +func (x *CreateRecordRequest) Reset() { + *x = CreateRecordRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_net_api_pb_threads_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateRecordRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateRecordRequest) ProtoMessage() {} + +func (x *CreateRecordRequest) ProtoReflect() protoreflect.Message { + mi := &file_net_api_pb_threads_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateRecordRequest.ProtoReflect.Descriptor instead. +func (*CreateRecordRequest) Descriptor() ([]byte, []int) { + return file_net_api_pb_threads_proto_rawDescGZIP(), []int{16} +} + +func (x *CreateRecordRequest) GetThreadID() []byte { + if x != nil { + return x.ThreadID + } + return nil +} + +func (x *CreateRecordRequest) GetBody() []byte { + if x != nil { + return x.Body + } + return nil +} + +type NewRecordReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ThreadID []byte `protobuf:"bytes,1,opt,name=threadID,proto3" json:"threadID,omitempty"` + LogID []byte `protobuf:"bytes,2,opt,name=logID,proto3" json:"logID,omitempty"` + Record *Record `protobuf:"bytes,3,opt,name=record,proto3" json:"record,omitempty"` +} + +func (x *NewRecordReply) Reset() { + *x = NewRecordReply{} + if protoimpl.UnsafeEnabled { + mi := &file_net_api_pb_threads_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NewRecordReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NewRecordReply) ProtoMessage() {} + +func (x *NewRecordReply) ProtoReflect() protoreflect.Message { + mi := &file_net_api_pb_threads_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NewRecordReply.ProtoReflect.Descriptor instead. +func (*NewRecordReply) Descriptor() ([]byte, []int) { + return file_net_api_pb_threads_proto_rawDescGZIP(), []int{17} +} + +func (x *NewRecordReply) GetThreadID() []byte { + if x != nil { + return x.ThreadID + } + return nil +} + +func (x *NewRecordReply) GetLogID() []byte { + if x != nil { + return x.LogID + } + return nil +} + +func (x *NewRecordReply) GetRecord() *Record { + if x != nil { + return x.Record + } + return nil +} + +type AddRecordRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ThreadID []byte `protobuf:"bytes,1,opt,name=threadID,proto3" json:"threadID,omitempty"` + LogID []byte `protobuf:"bytes,2,opt,name=logID,proto3" json:"logID,omitempty"` + Record *Record `protobuf:"bytes,3,opt,name=record,proto3" json:"record,omitempty"` +} + +func (x *AddRecordRequest) Reset() { + *x = AddRecordRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_net_api_pb_threads_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AddRecordRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddRecordRequest) ProtoMessage() {} + +func (x *AddRecordRequest) ProtoReflect() protoreflect.Message { + mi := &file_net_api_pb_threads_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AddRecordRequest.ProtoReflect.Descriptor instead. +func (*AddRecordRequest) Descriptor() ([]byte, []int) { + return file_net_api_pb_threads_proto_rawDescGZIP(), []int{18} +} + +func (x *AddRecordRequest) GetThreadID() []byte { + if x != nil { + return x.ThreadID + } + return nil +} + +func (x *AddRecordRequest) GetLogID() []byte { + if x != nil { + return x.LogID + } + return nil +} + +func (x *AddRecordRequest) GetRecord() *Record { + if x != nil { + return x.Record + } + return nil +} + +type Record struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RecordNode []byte `protobuf:"bytes,1,opt,name=recordNode,proto3" json:"recordNode,omitempty"` + EventNode []byte `protobuf:"bytes,2,opt,name=eventNode,proto3" json:"eventNode,omitempty"` + HeaderNode []byte `protobuf:"bytes,3,opt,name=headerNode,proto3" json:"headerNode,omitempty"` + BodyNode []byte `protobuf:"bytes,4,opt,name=bodyNode,proto3" json:"bodyNode,omitempty"` +} + +func (x *Record) Reset() { + *x = Record{} + if protoimpl.UnsafeEnabled { + mi := &file_net_api_pb_threads_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Record) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Record) ProtoMessage() {} + +func (x *Record) ProtoReflect() protoreflect.Message { + mi := &file_net_api_pb_threads_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Record.ProtoReflect.Descriptor instead. +func (*Record) Descriptor() ([]byte, []int) { + return file_net_api_pb_threads_proto_rawDescGZIP(), []int{19} +} + +func (x *Record) GetRecordNode() []byte { + if x != nil { + return x.RecordNode + } + return nil +} + +func (x *Record) GetEventNode() []byte { + if x != nil { + return x.EventNode + } + return nil +} + +func (x *Record) GetHeaderNode() []byte { + if x != nil { + return x.HeaderNode + } + return nil +} + +func (x *Record) GetBodyNode() []byte { + if x != nil { + return x.BodyNode + } + return nil +} + +type AddRecordReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *AddRecordReply) Reset() { + *x = AddRecordReply{} + if protoimpl.UnsafeEnabled { + mi := &file_net_api_pb_threads_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AddRecordReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddRecordReply) ProtoMessage() {} + +func (x *AddRecordReply) ProtoReflect() protoreflect.Message { + mi := &file_net_api_pb_threads_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AddRecordReply.ProtoReflect.Descriptor instead. +func (*AddRecordReply) Descriptor() ([]byte, []int) { + return file_net_api_pb_threads_proto_rawDescGZIP(), []int{20} +} + +type GetRecordRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ThreadID []byte `protobuf:"bytes,1,opt,name=threadID,proto3" json:"threadID,omitempty"` + RecordID []byte `protobuf:"bytes,2,opt,name=recordID,proto3" json:"recordID,omitempty"` +} + +func (x *GetRecordRequest) Reset() { + *x = GetRecordRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_net_api_pb_threads_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetRecordRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetRecordRequest) ProtoMessage() {} + +func (x *GetRecordRequest) ProtoReflect() protoreflect.Message { + mi := &file_net_api_pb_threads_proto_msgTypes[21] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetRecordRequest.ProtoReflect.Descriptor instead. +func (*GetRecordRequest) Descriptor() ([]byte, []int) { + return file_net_api_pb_threads_proto_rawDescGZIP(), []int{21} +} + +func (x *GetRecordRequest) GetThreadID() []byte { + if x != nil { + return x.ThreadID + } + return nil +} + +func (x *GetRecordRequest) GetRecordID() []byte { + if x != nil { + return x.RecordID + } + return nil +} + +type GetRecordReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Record *Record `protobuf:"bytes,1,opt,name=record,proto3" json:"record,omitempty"` +} + +func (x *GetRecordReply) Reset() { + *x = GetRecordReply{} + if protoimpl.UnsafeEnabled { + mi := &file_net_api_pb_threads_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetRecordReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetRecordReply) ProtoMessage() {} + +func (x *GetRecordReply) ProtoReflect() protoreflect.Message { + mi := &file_net_api_pb_threads_proto_msgTypes[22] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetRecordReply.ProtoReflect.Descriptor instead. +func (*GetRecordReply) Descriptor() ([]byte, []int) { + return file_net_api_pb_threads_proto_rawDescGZIP(), []int{22} +} + +func (x *GetRecordReply) GetRecord() *Record { + if x != nil { + return x.Record + } + return nil +} + +type SubscribeRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ThreadIDs [][]byte `protobuf:"bytes,1,rep,name=threadIDs,proto3" json:"threadIDs,omitempty"` +} + +func (x *SubscribeRequest) Reset() { + *x = SubscribeRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_net_api_pb_threads_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SubscribeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SubscribeRequest) ProtoMessage() {} + +func (x *SubscribeRequest) ProtoReflect() protoreflect.Message { + mi := &file_net_api_pb_threads_proto_msgTypes[23] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SubscribeRequest.ProtoReflect.Descriptor instead. +func (*SubscribeRequest) Descriptor() ([]byte, []int) { + return file_net_api_pb_threads_proto_rawDescGZIP(), []int{23} +} + +func (x *SubscribeRequest) GetThreadIDs() [][]byte { + if x != nil { + return x.ThreadIDs + } + return nil +} + +var File_net_api_pb_threads_proto protoreflect.FileDescriptor + +var file_net_api_pb_threads_proto_rawDesc = []byte{ + 0x0a, 0x18, 0x6e, 0x65, 0x74, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x62, 0x2f, 0x74, 0x68, 0x72, + 0x65, 0x61, 0x64, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x6e, 0x65, 0x74, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x22, 0x14, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x24, 0x0a, 0x10, + 0x47, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, + 0x12, 0x10, 0x0a, 0x03, 0x64, 0x6f, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x64, + 0x6f, 0x63, 0x22, 0x35, 0x0a, 0x17, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x49, 0x64, + 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, + 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x22, 0x41, 0x0a, 0x15, 0x56, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x70, + 0x6c, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x06, 0x70, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x69, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x69, 0x64, 0x22, 0x57, 0x0a, 0x13, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x68, 0x72, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x68, 0x72, 0x65, 0x61, 0x64, 0x49, 0x44, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x74, 0x68, 0x72, 0x65, 0x61, 0x64, 0x49, 0x44, 0x12, + 0x24, 0x0a, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, + 0x6e, 0x65, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x4b, 0x65, 0x79, 0x73, 0x52, + 0x04, 0x6b, 0x65, 0x79, 0x73, 0x22, 0x3c, 0x0a, 0x04, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x1c, 0x0a, + 0x09, 0x74, 0x68, 0x72, 0x65, 0x61, 0x64, 0x4b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x09, 0x74, 0x68, 0x72, 0x65, 0x61, 0x64, 0x4b, 0x65, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x6c, + 0x6f, 0x67, 0x4b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x6c, 0x6f, 0x67, + 0x4b, 0x65, 0x79, 0x22, 0x8a, 0x01, 0x0a, 0x0f, 0x54, 0x68, 0x72, 0x65, 0x61, 0x64, 0x49, 0x6e, + 0x66, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x68, 0x72, 0x65, 0x61, + 0x64, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x74, 0x68, 0x72, 0x65, 0x61, + 0x64, 0x49, 0x44, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x68, 0x72, 0x65, 0x61, 0x64, 0x4b, 0x65, 0x79, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x74, 0x68, 0x72, 0x65, 0x61, 0x64, 0x4b, 0x65, + 0x79, 0x12, 0x27, 0x0a, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x13, 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x67, + 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x64, + 0x64, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x05, 0x61, 0x64, 0x64, 0x72, 0x73, + 0x22, 0x75, 0x0a, 0x07, 0x4c, 0x6f, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x49, + 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, 0x49, 0x44, 0x12, 0x16, 0x0a, 0x06, 0x70, + 0x75, 0x62, 0x4b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x70, 0x75, 0x62, + 0x4b, 0x65, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x72, 0x69, 0x76, 0x4b, 0x65, 0x79, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x72, 0x69, 0x76, 0x4b, 0x65, 0x79, 0x12, 0x14, 0x0a, + 0x05, 0x61, 0x64, 0x64, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x05, 0x61, 0x64, + 0x64, 0x72, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x65, 0x61, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x04, 0x68, 0x65, 0x61, 0x64, 0x22, 0x4c, 0x0a, 0x10, 0x41, 0x64, 0x64, 0x54, 0x68, + 0x72, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x61, + 0x64, 0x64, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, + 0x24, 0x0a, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, + 0x6e, 0x65, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x4b, 0x65, 0x79, 0x73, 0x52, + 0x04, 0x6b, 0x65, 0x79, 0x73, 0x22, 0x2e, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x54, 0x68, 0x72, 0x65, + 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x68, 0x72, + 0x65, 0x61, 0x64, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x74, 0x68, 0x72, + 0x65, 0x61, 0x64, 0x49, 0x44, 0x22, 0x2f, 0x0a, 0x11, 0x50, 0x75, 0x6c, 0x6c, 0x54, 0x68, 0x72, + 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x68, + 0x72, 0x65, 0x61, 0x64, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x74, 0x68, + 0x72, 0x65, 0x61, 0x64, 0x49, 0x44, 0x22, 0x11, 0x0a, 0x0f, 0x50, 0x75, 0x6c, 0x6c, 0x54, 0x68, + 0x72, 0x65, 0x61, 0x64, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x31, 0x0a, 0x13, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x54, 0x68, 0x72, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x68, 0x72, 0x65, 0x61, 0x64, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x08, 0x74, 0x68, 0x72, 0x65, 0x61, 0x64, 0x49, 0x44, 0x22, 0x13, 0x0a, 0x11, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x68, 0x72, 0x65, 0x61, 0x64, 0x52, 0x65, 0x70, 0x6c, + 0x79, 0x22, 0x46, 0x0a, 0x14, 0x41, 0x64, 0x64, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, + 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x68, 0x72, + 0x65, 0x61, 0x64, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x74, 0x68, 0x72, + 0x65, 0x61, 0x64, 0x49, 0x44, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x22, 0x2c, 0x0a, 0x12, 0x41, 0x64, 0x64, + 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, + 0x16, 0x0a, 0x06, 0x70, 0x65, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x06, 0x70, 0x65, 0x65, 0x72, 0x49, 0x44, 0x22, 0x45, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, + 0x0a, 0x08, 0x74, 0x68, 0x72, 0x65, 0x61, 0x64, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x08, 0x74, 0x68, 0x72, 0x65, 0x61, 0x64, 0x49, 0x44, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, + 0x64, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0x6e, + 0x0a, 0x0e, 0x4e, 0x65, 0x77, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x70, 0x6c, 0x79, + 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x68, 0x72, 0x65, 0x61, 0x64, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x08, 0x74, 0x68, 0x72, 0x65, 0x61, 0x64, 0x49, 0x44, 0x12, 0x14, 0x0a, 0x05, + 0x6c, 0x6f, 0x67, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x6c, 0x6f, 0x67, + 0x49, 0x44, 0x12, 0x2a, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, + 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x22, 0x70, + 0x0a, 0x10, 0x41, 0x64, 0x64, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x68, 0x72, 0x65, 0x61, 0x64, 0x49, 0x44, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x74, 0x68, 0x72, 0x65, 0x61, 0x64, 0x49, 0x44, 0x12, 0x14, + 0x0a, 0x05, 0x6c, 0x6f, 0x67, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x6c, + 0x6f, 0x67, 0x49, 0x44, 0x12, 0x2a, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, + 0x62, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, + 0x22, 0x82, 0x01, 0x0a, 0x06, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x72, + 0x65, 0x63, 0x6f, 0x72, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x0a, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x65, + 0x76, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, + 0x65, 0x76, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x68, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x68, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x6f, 0x64, + 0x79, 0x4e, 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x62, 0x6f, 0x64, + 0x79, 0x4e, 0x6f, 0x64, 0x65, 0x22, 0x10, 0x0a, 0x0e, 0x41, 0x64, 0x64, 0x52, 0x65, 0x63, 0x6f, + 0x72, 0x64, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x4a, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x52, 0x65, + 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x74, + 0x68, 0x72, 0x65, 0x61, 0x64, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x74, + 0x68, 0x72, 0x65, 0x61, 0x64, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x63, 0x6f, 0x72, + 0x64, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x72, 0x65, 0x63, 0x6f, 0x72, + 0x64, 0x49, 0x44, 0x22, 0x3c, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, + 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x2a, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x70, 0x62, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, + 0x64, 0x22, 0x30, 0x0a, 0x10, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x68, 0x72, 0x65, 0x61, 0x64, 0x49, + 0x44, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x09, 0x74, 0x68, 0x72, 0x65, 0x61, 0x64, + 0x49, 0x44, 0x73, 0x32, 0xbc, 0x07, 0x0a, 0x0a, 0x41, 0x50, 0x49, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x12, 0x4d, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x73, 0x12, 0x1e, 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x47, + 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1c, 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x47, + 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, + 0x00, 0x12, 0x5c, 0x0a, 0x10, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x49, 0x64, 0x65, + 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x23, 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x70, 0x62, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6e, 0x65, 0x74, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, + 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, + 0x4e, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x68, 0x72, 0x65, 0x61, 0x64, 0x12, + 0x1f, 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x54, 0x68, 0x72, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1b, 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x54, 0x68, + 0x72, 0x65, 0x61, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, + 0x48, 0x0a, 0x09, 0x41, 0x64, 0x64, 0x54, 0x68, 0x72, 0x65, 0x61, 0x64, 0x12, 0x1c, 0x2e, 0x6e, + 0x65, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x41, 0x64, 0x64, 0x54, 0x68, 0x72, + 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x6e, 0x65, 0x74, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x54, 0x68, 0x72, 0x65, 0x61, 0x64, 0x49, 0x6e, + 0x66, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x48, 0x0a, 0x09, 0x47, 0x65, 0x74, + 0x54, 0x68, 0x72, 0x65, 0x61, 0x64, 0x12, 0x1c, 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x68, 0x72, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, + 0x62, 0x2e, 0x54, 0x68, 0x72, 0x65, 0x61, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x70, 0x6c, + 0x79, 0x22, 0x00, 0x12, 0x4a, 0x0a, 0x0a, 0x50, 0x75, 0x6c, 0x6c, 0x54, 0x68, 0x72, 0x65, 0x61, + 0x64, 0x12, 0x1d, 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x50, + 0x75, 0x6c, 0x6c, 0x54, 0x68, 0x72, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1b, 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x75, + 0x6c, 0x6c, 0x54, 0x68, 0x72, 0x65, 0x61, 0x64, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, + 0x50, 0x0a, 0x0c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x68, 0x72, 0x65, 0x61, 0x64, 0x12, + 0x1f, 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x54, 0x68, 0x72, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1d, 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x54, 0x68, 0x72, 0x65, 0x61, 0x64, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, + 0x00, 0x12, 0x53, 0x0a, 0x0d, 0x41, 0x64, 0x64, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, + 0x6f, 0x72, 0x12, 0x20, 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, + 0x41, 0x64, 0x64, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, + 0x62, 0x2e, 0x41, 0x64, 0x64, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x52, + 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x4d, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x1f, 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x65, 0x77, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, + 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x47, 0x0a, 0x09, 0x41, 0x64, 0x64, 0x52, 0x65, 0x63, 0x6f, + 0x72, 0x64, 0x12, 0x1c, 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, + 0x41, 0x64, 0x64, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1a, 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x41, 0x64, + 0x64, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x47, + 0x0a, 0x09, 0x47, 0x65, 0x74, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x1c, 0x2e, 0x6e, 0x65, + 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x63, 0x6f, + 0x72, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x6e, 0x65, 0x74, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, + 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x49, 0x0a, 0x09, 0x53, 0x75, 0x62, 0x73, 0x63, + 0x72, 0x69, 0x62, 0x65, 0x12, 0x1c, 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, + 0x62, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x62, 0x2e, + 0x4e, 0x65, 0x77, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, + 0x30, 0x01, 0x42, 0x2c, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x74, 0x65, 0x78, 0x74, 0x69, 0x6c, 0x65, 0x69, 0x6f, 0x2f, 0x67, 0x6f, 0x2d, 0x62, 0x75, + 0x63, 0x6b, 0x65, 0x74, 0x73, 0x2f, 0x6e, 0x65, 0x74, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x62, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_net_api_pb_threads_proto_rawDescOnce sync.Once + file_net_api_pb_threads_proto_rawDescData = file_net_api_pb_threads_proto_rawDesc +) + +func file_net_api_pb_threads_proto_rawDescGZIP() []byte { + file_net_api_pb_threads_proto_rawDescOnce.Do(func() { + file_net_api_pb_threads_proto_rawDescData = protoimpl.X.CompressGZIP(file_net_api_pb_threads_proto_rawDescData) + }) + return file_net_api_pb_threads_proto_rawDescData +} + +var file_net_api_pb_threads_proto_msgTypes = make([]protoimpl.MessageInfo, 24) +var file_net_api_pb_threads_proto_goTypes = []interface{}{ + (*GetServicesRequest)(nil), // 0: net.api.pb.GetServicesRequest + (*GetServicesReply)(nil), // 1: net.api.pb.GetServicesReply + (*ValidateIdentityRequest)(nil), // 2: net.api.pb.ValidateIdentityRequest + (*ValidateIdentityReply)(nil), // 3: net.api.pb.ValidateIdentityReply + (*CreateThreadRequest)(nil), // 4: net.api.pb.CreateThreadRequest + (*Keys)(nil), // 5: net.api.pb.Keys + (*ThreadInfoReply)(nil), // 6: net.api.pb.ThreadInfoReply + (*LogInfo)(nil), // 7: net.api.pb.LogInfo + (*AddThreadRequest)(nil), // 8: net.api.pb.AddThreadRequest + (*GetThreadRequest)(nil), // 9: net.api.pb.GetThreadRequest + (*PullThreadRequest)(nil), // 10: net.api.pb.PullThreadRequest + (*PullThreadReply)(nil), // 11: net.api.pb.PullThreadReply + (*DeleteThreadRequest)(nil), // 12: net.api.pb.DeleteThreadRequest + (*DeleteThreadReply)(nil), // 13: net.api.pb.DeleteThreadReply + (*AddReplicatorRequest)(nil), // 14: net.api.pb.AddReplicatorRequest + (*AddReplicatorReply)(nil), // 15: net.api.pb.AddReplicatorReply + (*CreateRecordRequest)(nil), // 16: net.api.pb.CreateRecordRequest + (*NewRecordReply)(nil), // 17: net.api.pb.NewRecordReply + (*AddRecordRequest)(nil), // 18: net.api.pb.AddRecordRequest + (*Record)(nil), // 19: net.api.pb.Record + (*AddRecordReply)(nil), // 20: net.api.pb.AddRecordReply + (*GetRecordRequest)(nil), // 21: net.api.pb.GetRecordRequest + (*GetRecordReply)(nil), // 22: net.api.pb.GetRecordReply + (*SubscribeRequest)(nil), // 23: net.api.pb.SubscribeRequest +} +var file_net_api_pb_threads_proto_depIdxs = []int32{ + 5, // 0: net.api.pb.CreateThreadRequest.keys:type_name -> net.api.pb.Keys + 7, // 1: net.api.pb.ThreadInfoReply.logs:type_name -> net.api.pb.LogInfo + 5, // 2: net.api.pb.AddThreadRequest.keys:type_name -> net.api.pb.Keys + 19, // 3: net.api.pb.NewRecordReply.record:type_name -> net.api.pb.Record + 19, // 4: net.api.pb.AddRecordRequest.record:type_name -> net.api.pb.Record + 19, // 5: net.api.pb.GetRecordReply.record:type_name -> net.api.pb.Record + 0, // 6: net.api.pb.APIService.GetServices:input_type -> net.api.pb.GetServicesRequest + 2, // 7: net.api.pb.APIService.ValidateIdentity:input_type -> net.api.pb.ValidateIdentityRequest + 4, // 8: net.api.pb.APIService.CreateThread:input_type -> net.api.pb.CreateThreadRequest + 8, // 9: net.api.pb.APIService.AddThread:input_type -> net.api.pb.AddThreadRequest + 9, // 10: net.api.pb.APIService.GetThread:input_type -> net.api.pb.GetThreadRequest + 10, // 11: net.api.pb.APIService.PullThread:input_type -> net.api.pb.PullThreadRequest + 12, // 12: net.api.pb.APIService.DeleteThread:input_type -> net.api.pb.DeleteThreadRequest + 14, // 13: net.api.pb.APIService.AddReplicator:input_type -> net.api.pb.AddReplicatorRequest + 16, // 14: net.api.pb.APIService.CreateRecord:input_type -> net.api.pb.CreateRecordRequest + 18, // 15: net.api.pb.APIService.AddRecord:input_type -> net.api.pb.AddRecordRequest + 21, // 16: net.api.pb.APIService.GetRecord:input_type -> net.api.pb.GetRecordRequest + 23, // 17: net.api.pb.APIService.Subscribe:input_type -> net.api.pb.SubscribeRequest + 1, // 18: net.api.pb.APIService.GetServices:output_type -> net.api.pb.GetServicesReply + 3, // 19: net.api.pb.APIService.ValidateIdentity:output_type -> net.api.pb.ValidateIdentityReply + 6, // 20: net.api.pb.APIService.CreateThread:output_type -> net.api.pb.ThreadInfoReply + 6, // 21: net.api.pb.APIService.AddThread:output_type -> net.api.pb.ThreadInfoReply + 6, // 22: net.api.pb.APIService.GetThread:output_type -> net.api.pb.ThreadInfoReply + 11, // 23: net.api.pb.APIService.PullThread:output_type -> net.api.pb.PullThreadReply + 13, // 24: net.api.pb.APIService.DeleteThread:output_type -> net.api.pb.DeleteThreadReply + 15, // 25: net.api.pb.APIService.AddReplicator:output_type -> net.api.pb.AddReplicatorReply + 17, // 26: net.api.pb.APIService.CreateRecord:output_type -> net.api.pb.NewRecordReply + 20, // 27: net.api.pb.APIService.AddRecord:output_type -> net.api.pb.AddRecordReply + 22, // 28: net.api.pb.APIService.GetRecord:output_type -> net.api.pb.GetRecordReply + 17, // 29: net.api.pb.APIService.Subscribe:output_type -> net.api.pb.NewRecordReply + 18, // [18:30] is the sub-list for method output_type + 6, // [6:18] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name +} + +func init() { file_net_api_pb_threads_proto_init() } +func file_net_api_pb_threads_proto_init() { + if File_net_api_pb_threads_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_net_api_pb_threads_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetServicesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_net_api_pb_threads_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetServicesReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_net_api_pb_threads_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ValidateIdentityRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_net_api_pb_threads_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ValidateIdentityReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_net_api_pb_threads_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateThreadRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_net_api_pb_threads_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Keys); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_net_api_pb_threads_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ThreadInfoReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_net_api_pb_threads_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LogInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_net_api_pb_threads_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddThreadRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_net_api_pb_threads_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetThreadRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_net_api_pb_threads_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PullThreadRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_net_api_pb_threads_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PullThreadReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_net_api_pb_threads_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteThreadRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_net_api_pb_threads_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteThreadReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_net_api_pb_threads_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddReplicatorRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_net_api_pb_threads_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddReplicatorReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_net_api_pb_threads_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateRecordRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_net_api_pb_threads_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NewRecordReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_net_api_pb_threads_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddRecordRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_net_api_pb_threads_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Record); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_net_api_pb_threads_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddRecordReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_net_api_pb_threads_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetRecordRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_net_api_pb_threads_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetRecordReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_net_api_pb_threads_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SubscribeRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_net_api_pb_threads_proto_rawDesc, + NumEnums: 0, + NumMessages: 24, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_net_api_pb_threads_proto_goTypes, + DependencyIndexes: file_net_api_pb_threads_proto_depIdxs, + MessageInfos: file_net_api_pb_threads_proto_msgTypes, + }.Build() + File_net_api_pb_threads_proto = out.File + file_net_api_pb_threads_proto_rawDesc = nil + file_net_api_pb_threads_proto_goTypes = nil + file_net_api_pb_threads_proto_depIdxs = nil +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConnInterface + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion6 + +// APIServiceClient is the client API for APIService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type APIServiceClient interface { + GetServices(ctx context.Context, in *GetServicesRequest, opts ...grpc.CallOption) (*GetServicesReply, error) + ValidateIdentity(ctx context.Context, in *ValidateIdentityRequest, opts ...grpc.CallOption) (*ValidateIdentityReply, error) + CreateThread(ctx context.Context, in *CreateThreadRequest, opts ...grpc.CallOption) (*ThreadInfoReply, error) + AddThread(ctx context.Context, in *AddThreadRequest, opts ...grpc.CallOption) (*ThreadInfoReply, error) + GetThread(ctx context.Context, in *GetThreadRequest, opts ...grpc.CallOption) (*ThreadInfoReply, error) + PullThread(ctx context.Context, in *PullThreadRequest, opts ...grpc.CallOption) (*PullThreadReply, error) + DeleteThread(ctx context.Context, in *DeleteThreadRequest, opts ...grpc.CallOption) (*DeleteThreadReply, error) + AddReplicator(ctx context.Context, in *AddReplicatorRequest, opts ...grpc.CallOption) (*AddReplicatorReply, error) + CreateRecord(ctx context.Context, in *CreateRecordRequest, opts ...grpc.CallOption) (*NewRecordReply, error) + AddRecord(ctx context.Context, in *AddRecordRequest, opts ...grpc.CallOption) (*AddRecordReply, error) + GetRecord(ctx context.Context, in *GetRecordRequest, opts ...grpc.CallOption) (*GetRecordReply, error) + Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (APIService_SubscribeClient, error) +} + +type aPIServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewAPIServiceClient(cc grpc.ClientConnInterface) APIServiceClient { + return &aPIServiceClient{cc} +} + +func (c *aPIServiceClient) GetServices(ctx context.Context, in *GetServicesRequest, opts ...grpc.CallOption) (*GetServicesReply, error) { + out := new(GetServicesReply) + err := c.cc.Invoke(ctx, "/net.api.pb.APIService/GetServices", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aPIServiceClient) ValidateIdentity(ctx context.Context, in *ValidateIdentityRequest, opts ...grpc.CallOption) (*ValidateIdentityReply, error) { + out := new(ValidateIdentityReply) + err := c.cc.Invoke(ctx, "/net.api.pb.APIService/ValidateIdentity", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aPIServiceClient) CreateThread(ctx context.Context, in *CreateThreadRequest, opts ...grpc.CallOption) (*ThreadInfoReply, error) { + out := new(ThreadInfoReply) + err := c.cc.Invoke(ctx, "/net.api.pb.APIService/CreateThread", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aPIServiceClient) AddThread(ctx context.Context, in *AddThreadRequest, opts ...grpc.CallOption) (*ThreadInfoReply, error) { + out := new(ThreadInfoReply) + err := c.cc.Invoke(ctx, "/net.api.pb.APIService/AddThread", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aPIServiceClient) GetThread(ctx context.Context, in *GetThreadRequest, opts ...grpc.CallOption) (*ThreadInfoReply, error) { + out := new(ThreadInfoReply) + err := c.cc.Invoke(ctx, "/net.api.pb.APIService/GetThread", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aPIServiceClient) PullThread(ctx context.Context, in *PullThreadRequest, opts ...grpc.CallOption) (*PullThreadReply, error) { + out := new(PullThreadReply) + err := c.cc.Invoke(ctx, "/net.api.pb.APIService/PullThread", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aPIServiceClient) DeleteThread(ctx context.Context, in *DeleteThreadRequest, opts ...grpc.CallOption) (*DeleteThreadReply, error) { + out := new(DeleteThreadReply) + err := c.cc.Invoke(ctx, "/net.api.pb.APIService/DeleteThread", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aPIServiceClient) AddReplicator(ctx context.Context, in *AddReplicatorRequest, opts ...grpc.CallOption) (*AddReplicatorReply, error) { + out := new(AddReplicatorReply) + err := c.cc.Invoke(ctx, "/net.api.pb.APIService/AddReplicator", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aPIServiceClient) CreateRecord(ctx context.Context, in *CreateRecordRequest, opts ...grpc.CallOption) (*NewRecordReply, error) { + out := new(NewRecordReply) + err := c.cc.Invoke(ctx, "/net.api.pb.APIService/CreateRecord", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aPIServiceClient) AddRecord(ctx context.Context, in *AddRecordRequest, opts ...grpc.CallOption) (*AddRecordReply, error) { + out := new(AddRecordReply) + err := c.cc.Invoke(ctx, "/net.api.pb.APIService/AddRecord", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aPIServiceClient) GetRecord(ctx context.Context, in *GetRecordRequest, opts ...grpc.CallOption) (*GetRecordReply, error) { + out := new(GetRecordReply) + err := c.cc.Invoke(ctx, "/net.api.pb.APIService/GetRecord", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aPIServiceClient) Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (APIService_SubscribeClient, error) { + stream, err := c.cc.NewStream(ctx, &_APIService_serviceDesc.Streams[0], "/net.api.pb.APIService/Subscribe", opts...) + if err != nil { + return nil, err + } + x := &aPIServiceSubscribeClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type APIService_SubscribeClient interface { + Recv() (*NewRecordReply, error) + grpc.ClientStream +} + +type aPIServiceSubscribeClient struct { + grpc.ClientStream +} + +func (x *aPIServiceSubscribeClient) Recv() (*NewRecordReply, error) { + m := new(NewRecordReply) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// APIServiceServer is the server API for APIService service. +type APIServiceServer interface { + GetServices(context.Context, *GetServicesRequest) (*GetServicesReply, error) + ValidateIdentity(context.Context, *ValidateIdentityRequest) (*ValidateIdentityReply, error) + CreateThread(context.Context, *CreateThreadRequest) (*ThreadInfoReply, error) + AddThread(context.Context, *AddThreadRequest) (*ThreadInfoReply, error) + GetThread(context.Context, *GetThreadRequest) (*ThreadInfoReply, error) + PullThread(context.Context, *PullThreadRequest) (*PullThreadReply, error) + DeleteThread(context.Context, *DeleteThreadRequest) (*DeleteThreadReply, error) + AddReplicator(context.Context, *AddReplicatorRequest) (*AddReplicatorReply, error) + CreateRecord(context.Context, *CreateRecordRequest) (*NewRecordReply, error) + AddRecord(context.Context, *AddRecordRequest) (*AddRecordReply, error) + GetRecord(context.Context, *GetRecordRequest) (*GetRecordReply, error) + Subscribe(*SubscribeRequest, APIService_SubscribeServer) error +} + +// UnimplementedAPIServiceServer can be embedded to have forward compatible implementations. +type UnimplementedAPIServiceServer struct { +} + +func (*UnimplementedAPIServiceServer) GetServices(context.Context, *GetServicesRequest) (*GetServicesReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetServices not implemented") +} +func (*UnimplementedAPIServiceServer) ValidateIdentity(context.Context, *ValidateIdentityRequest) (*ValidateIdentityReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method ValidateIdentity not implemented") +} +func (*UnimplementedAPIServiceServer) CreateThread(context.Context, *CreateThreadRequest) (*ThreadInfoReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateThread not implemented") +} +func (*UnimplementedAPIServiceServer) AddThread(context.Context, *AddThreadRequest) (*ThreadInfoReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method AddThread not implemented") +} +func (*UnimplementedAPIServiceServer) GetThread(context.Context, *GetThreadRequest) (*ThreadInfoReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetThread not implemented") +} +func (*UnimplementedAPIServiceServer) PullThread(context.Context, *PullThreadRequest) (*PullThreadReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method PullThread not implemented") +} +func (*UnimplementedAPIServiceServer) DeleteThread(context.Context, *DeleteThreadRequest) (*DeleteThreadReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteThread not implemented") +} +func (*UnimplementedAPIServiceServer) AddReplicator(context.Context, *AddReplicatorRequest) (*AddReplicatorReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method AddReplicator not implemented") +} +func (*UnimplementedAPIServiceServer) CreateRecord(context.Context, *CreateRecordRequest) (*NewRecordReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateRecord not implemented") +} +func (*UnimplementedAPIServiceServer) AddRecord(context.Context, *AddRecordRequest) (*AddRecordReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method AddRecord not implemented") +} +func (*UnimplementedAPIServiceServer) GetRecord(context.Context, *GetRecordRequest) (*GetRecordReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetRecord not implemented") +} +func (*UnimplementedAPIServiceServer) Subscribe(*SubscribeRequest, APIService_SubscribeServer) error { + return status.Errorf(codes.Unimplemented, "method Subscribe not implemented") +} + +func RegisterAPIServiceServer(s *grpc.Server, srv APIServiceServer) { + s.RegisterService(&_APIService_serviceDesc, srv) +} + +func _APIService_GetServices_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetServicesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(APIServiceServer).GetServices(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/net.api.pb.APIService/GetServices", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(APIServiceServer).GetServices(ctx, req.(*GetServicesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _APIService_ValidateIdentity_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ValidateIdentityRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(APIServiceServer).ValidateIdentity(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/net.api.pb.APIService/ValidateIdentity", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(APIServiceServer).ValidateIdentity(ctx, req.(*ValidateIdentityRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _APIService_CreateThread_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateThreadRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(APIServiceServer).CreateThread(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/net.api.pb.APIService/CreateThread", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(APIServiceServer).CreateThread(ctx, req.(*CreateThreadRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _APIService_AddThread_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AddThreadRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(APIServiceServer).AddThread(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/net.api.pb.APIService/AddThread", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(APIServiceServer).AddThread(ctx, req.(*AddThreadRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _APIService_GetThread_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetThreadRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(APIServiceServer).GetThread(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/net.api.pb.APIService/GetThread", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(APIServiceServer).GetThread(ctx, req.(*GetThreadRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _APIService_PullThread_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PullThreadRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(APIServiceServer).PullThread(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/net.api.pb.APIService/PullThread", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(APIServiceServer).PullThread(ctx, req.(*PullThreadRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _APIService_DeleteThread_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteThreadRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(APIServiceServer).DeleteThread(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/net.api.pb.APIService/DeleteThread", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(APIServiceServer).DeleteThread(ctx, req.(*DeleteThreadRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _APIService_AddReplicator_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AddReplicatorRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(APIServiceServer).AddReplicator(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/net.api.pb.APIService/AddReplicator", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(APIServiceServer).AddReplicator(ctx, req.(*AddReplicatorRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _APIService_CreateRecord_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateRecordRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(APIServiceServer).CreateRecord(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/net.api.pb.APIService/CreateRecord", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(APIServiceServer).CreateRecord(ctx, req.(*CreateRecordRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _APIService_AddRecord_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AddRecordRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(APIServiceServer).AddRecord(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/net.api.pb.APIService/AddRecord", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(APIServiceServer).AddRecord(ctx, req.(*AddRecordRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _APIService_GetRecord_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetRecordRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(APIServiceServer).GetRecord(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/net.api.pb.APIService/GetRecord", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(APIServiceServer).GetRecord(ctx, req.(*GetRecordRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _APIService_Subscribe_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(SubscribeRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(APIServiceServer).Subscribe(m, &aPIServiceSubscribeServer{stream}) +} + +type APIService_SubscribeServer interface { + Send(*NewRecordReply) error + grpc.ServerStream +} + +type aPIServiceSubscribeServer struct { + grpc.ServerStream +} + +func (x *aPIServiceSubscribeServer) Send(m *NewRecordReply) error { + return x.ServerStream.SendMsg(m) +} + +var _APIService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "net.api.pb.APIService", + HandlerType: (*APIServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetServices", + Handler: _APIService_GetServices_Handler, + }, + { + MethodName: "ValidateIdentity", + Handler: _APIService_ValidateIdentity_Handler, + }, + { + MethodName: "CreateThread", + Handler: _APIService_CreateThread_Handler, + }, + { + MethodName: "AddThread", + Handler: _APIService_AddThread_Handler, + }, + { + MethodName: "GetThread", + Handler: _APIService_GetThread_Handler, + }, + { + MethodName: "PullThread", + Handler: _APIService_PullThread_Handler, + }, + { + MethodName: "DeleteThread", + Handler: _APIService_DeleteThread_Handler, + }, + { + MethodName: "AddReplicator", + Handler: _APIService_AddReplicator_Handler, + }, + { + MethodName: "CreateRecord", + Handler: _APIService_CreateRecord_Handler, + }, + { + MethodName: "AddRecord", + Handler: _APIService_AddRecord_Handler, + }, + { + MethodName: "GetRecord", + Handler: _APIService_GetRecord_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "Subscribe", + Handler: _APIService_Subscribe_Handler, + ServerStreams: true, + }, + }, + Metadata: "net/api/pb/threads.proto", +} diff --git a/net/api/pb/threadsnet.proto b/net/api/pb/threads.proto similarity index 77% rename from net/api/pb/threadsnet.proto rename to net/api/pb/threads.proto index 4a2064de..95f16658 100644 --- a/net/api/pb/threadsnet.proto +++ b/net/api/pb/threads.proto @@ -1,29 +1,20 @@ syntax = "proto3"; -package threads.net.pb; +package net.api.pb; +option go_package = "github.com/textileio/go-buckets/net/api/pb"; -option java_multiple_files = true; -option java_package = "io.textile.threads_net_grpc"; -option java_outer_classname = "ThreadsNet"; -option objc_class_prefix = "THREADSNET"; +message GetServicesRequest {} -message GetHostIDRequest {} - -message GetHostIDReply { - bytes peerID = 1; +message GetServicesReply { + bytes doc = 1; } -message GetTokenRequest { - oneof payload { - string key = 1; - bytes signature = 2; - } +message ValidateIdentityRequest { + string identity = 1; } -message GetTokenReply { - oneof payload { - bytes challenge = 1; - string token = 2; - } +message ValidateIdentityReply { + bytes pubKey = 1; + string did = 2; } message CreateThreadRequest { @@ -120,9 +111,9 @@ message SubscribeRequest { repeated bytes threadIDs = 1; } -service API { - rpc GetHostID(GetHostIDRequest) returns (GetHostIDReply) {} - rpc GetToken(stream GetTokenRequest) returns (stream GetTokenReply) {} +service APIService { + rpc GetServices(GetServicesRequest) returns (GetServicesReply) {} + rpc ValidateIdentity(ValidateIdentityRequest) returns (ValidateIdentityReply) {} rpc CreateThread(CreateThreadRequest) returns (ThreadInfoReply) {} rpc AddThread(AddThreadRequest) returns (ThreadInfoReply) {} rpc GetThread(GetThreadRequest) returns (ThreadInfoReply) {} diff --git a/net/api/pb/threadsnet.pb.go b/net/api/pb/threadsnet.pb.go deleted file mode 100644 index b0e76229..00000000 --- a/net/api/pb/threadsnet.pb.go +++ /dev/null @@ -1,1795 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: threadsnet.proto - -package threads_net_pb - -import ( - context "context" - fmt "fmt" - proto "github.com/golang/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -type GetHostIDRequest struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetHostIDRequest) Reset() { *m = GetHostIDRequest{} } -func (m *GetHostIDRequest) String() string { return proto.CompactTextString(m) } -func (*GetHostIDRequest) ProtoMessage() {} -func (*GetHostIDRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_0a395cd12426f651, []int{0} -} - -func (m *GetHostIDRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetHostIDRequest.Unmarshal(m, b) -} -func (m *GetHostIDRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetHostIDRequest.Marshal(b, m, deterministic) -} -func (m *GetHostIDRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetHostIDRequest.Merge(m, src) -} -func (m *GetHostIDRequest) XXX_Size() int { - return xxx_messageInfo_GetHostIDRequest.Size(m) -} -func (m *GetHostIDRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetHostIDRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetHostIDRequest proto.InternalMessageInfo - -type GetHostIDReply struct { - PeerID []byte `protobuf:"bytes,1,opt,name=peerID,proto3" json:"peerID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetHostIDReply) Reset() { *m = GetHostIDReply{} } -func (m *GetHostIDReply) String() string { return proto.CompactTextString(m) } -func (*GetHostIDReply) ProtoMessage() {} -func (*GetHostIDReply) Descriptor() ([]byte, []int) { - return fileDescriptor_0a395cd12426f651, []int{1} -} - -func (m *GetHostIDReply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetHostIDReply.Unmarshal(m, b) -} -func (m *GetHostIDReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetHostIDReply.Marshal(b, m, deterministic) -} -func (m *GetHostIDReply) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetHostIDReply.Merge(m, src) -} -func (m *GetHostIDReply) XXX_Size() int { - return xxx_messageInfo_GetHostIDReply.Size(m) -} -func (m *GetHostIDReply) XXX_DiscardUnknown() { - xxx_messageInfo_GetHostIDReply.DiscardUnknown(m) -} - -var xxx_messageInfo_GetHostIDReply proto.InternalMessageInfo - -func (m *GetHostIDReply) GetPeerID() []byte { - if m != nil { - return m.PeerID - } - return nil -} - -type GetTokenRequest struct { - // Types that are valid to be assigned to Payload: - // *GetTokenRequest_Key - // *GetTokenRequest_Signature - Payload isGetTokenRequest_Payload `protobuf_oneof:"payload"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetTokenRequest) Reset() { *m = GetTokenRequest{} } -func (m *GetTokenRequest) String() string { return proto.CompactTextString(m) } -func (*GetTokenRequest) ProtoMessage() {} -func (*GetTokenRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_0a395cd12426f651, []int{2} -} - -func (m *GetTokenRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetTokenRequest.Unmarshal(m, b) -} -func (m *GetTokenRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetTokenRequest.Marshal(b, m, deterministic) -} -func (m *GetTokenRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetTokenRequest.Merge(m, src) -} -func (m *GetTokenRequest) XXX_Size() int { - return xxx_messageInfo_GetTokenRequest.Size(m) -} -func (m *GetTokenRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetTokenRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetTokenRequest proto.InternalMessageInfo - -type isGetTokenRequest_Payload interface { - isGetTokenRequest_Payload() -} - -type GetTokenRequest_Key struct { - Key string `protobuf:"bytes,1,opt,name=key,proto3,oneof"` -} - -type GetTokenRequest_Signature struct { - Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3,oneof"` -} - -func (*GetTokenRequest_Key) isGetTokenRequest_Payload() {} - -func (*GetTokenRequest_Signature) isGetTokenRequest_Payload() {} - -func (m *GetTokenRequest) GetPayload() isGetTokenRequest_Payload { - if m != nil { - return m.Payload - } - return nil -} - -func (m *GetTokenRequest) GetKey() string { - if x, ok := m.GetPayload().(*GetTokenRequest_Key); ok { - return x.Key - } - return "" -} - -func (m *GetTokenRequest) GetSignature() []byte { - if x, ok := m.GetPayload().(*GetTokenRequest_Signature); ok { - return x.Signature - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*GetTokenRequest) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*GetTokenRequest_Key)(nil), - (*GetTokenRequest_Signature)(nil), - } -} - -type GetTokenReply struct { - // Types that are valid to be assigned to Payload: - // *GetTokenReply_Challenge - // *GetTokenReply_Token - Payload isGetTokenReply_Payload `protobuf_oneof:"payload"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetTokenReply) Reset() { *m = GetTokenReply{} } -func (m *GetTokenReply) String() string { return proto.CompactTextString(m) } -func (*GetTokenReply) ProtoMessage() {} -func (*GetTokenReply) Descriptor() ([]byte, []int) { - return fileDescriptor_0a395cd12426f651, []int{3} -} - -func (m *GetTokenReply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetTokenReply.Unmarshal(m, b) -} -func (m *GetTokenReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetTokenReply.Marshal(b, m, deterministic) -} -func (m *GetTokenReply) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetTokenReply.Merge(m, src) -} -func (m *GetTokenReply) XXX_Size() int { - return xxx_messageInfo_GetTokenReply.Size(m) -} -func (m *GetTokenReply) XXX_DiscardUnknown() { - xxx_messageInfo_GetTokenReply.DiscardUnknown(m) -} - -var xxx_messageInfo_GetTokenReply proto.InternalMessageInfo - -type isGetTokenReply_Payload interface { - isGetTokenReply_Payload() -} - -type GetTokenReply_Challenge struct { - Challenge []byte `protobuf:"bytes,1,opt,name=challenge,proto3,oneof"` -} - -type GetTokenReply_Token struct { - Token string `protobuf:"bytes,2,opt,name=token,proto3,oneof"` -} - -func (*GetTokenReply_Challenge) isGetTokenReply_Payload() {} - -func (*GetTokenReply_Token) isGetTokenReply_Payload() {} - -func (m *GetTokenReply) GetPayload() isGetTokenReply_Payload { - if m != nil { - return m.Payload - } - return nil -} - -func (m *GetTokenReply) GetChallenge() []byte { - if x, ok := m.GetPayload().(*GetTokenReply_Challenge); ok { - return x.Challenge - } - return nil -} - -func (m *GetTokenReply) GetToken() string { - if x, ok := m.GetPayload().(*GetTokenReply_Token); ok { - return x.Token - } - return "" -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*GetTokenReply) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*GetTokenReply_Challenge)(nil), - (*GetTokenReply_Token)(nil), - } -} - -type CreateThreadRequest struct { - ThreadID []byte `protobuf:"bytes,1,opt,name=threadID,proto3" json:"threadID,omitempty"` - Keys *Keys `protobuf:"bytes,2,opt,name=keys,proto3" json:"keys,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CreateThreadRequest) Reset() { *m = CreateThreadRequest{} } -func (m *CreateThreadRequest) String() string { return proto.CompactTextString(m) } -func (*CreateThreadRequest) ProtoMessage() {} -func (*CreateThreadRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_0a395cd12426f651, []int{4} -} - -func (m *CreateThreadRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CreateThreadRequest.Unmarshal(m, b) -} -func (m *CreateThreadRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CreateThreadRequest.Marshal(b, m, deterministic) -} -func (m *CreateThreadRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateThreadRequest.Merge(m, src) -} -func (m *CreateThreadRequest) XXX_Size() int { - return xxx_messageInfo_CreateThreadRequest.Size(m) -} -func (m *CreateThreadRequest) XXX_DiscardUnknown() { - xxx_messageInfo_CreateThreadRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateThreadRequest proto.InternalMessageInfo - -func (m *CreateThreadRequest) GetThreadID() []byte { - if m != nil { - return m.ThreadID - } - return nil -} - -func (m *CreateThreadRequest) GetKeys() *Keys { - if m != nil { - return m.Keys - } - return nil -} - -type Keys struct { - ThreadKey []byte `protobuf:"bytes,1,opt,name=threadKey,proto3" json:"threadKey,omitempty"` - LogKey []byte `protobuf:"bytes,2,opt,name=logKey,proto3" json:"logKey,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Keys) Reset() { *m = Keys{} } -func (m *Keys) String() string { return proto.CompactTextString(m) } -func (*Keys) ProtoMessage() {} -func (*Keys) Descriptor() ([]byte, []int) { - return fileDescriptor_0a395cd12426f651, []int{5} -} - -func (m *Keys) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Keys.Unmarshal(m, b) -} -func (m *Keys) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Keys.Marshal(b, m, deterministic) -} -func (m *Keys) XXX_Merge(src proto.Message) { - xxx_messageInfo_Keys.Merge(m, src) -} -func (m *Keys) XXX_Size() int { - return xxx_messageInfo_Keys.Size(m) -} -func (m *Keys) XXX_DiscardUnknown() { - xxx_messageInfo_Keys.DiscardUnknown(m) -} - -var xxx_messageInfo_Keys proto.InternalMessageInfo - -func (m *Keys) GetThreadKey() []byte { - if m != nil { - return m.ThreadKey - } - return nil -} - -func (m *Keys) GetLogKey() []byte { - if m != nil { - return m.LogKey - } - return nil -} - -type ThreadInfoReply struct { - ThreadID []byte `protobuf:"bytes,1,opt,name=threadID,proto3" json:"threadID,omitempty"` - ThreadKey []byte `protobuf:"bytes,2,opt,name=threadKey,proto3" json:"threadKey,omitempty"` - Logs []*LogInfo `protobuf:"bytes,3,rep,name=logs,proto3" json:"logs,omitempty"` - Addrs [][]byte `protobuf:"bytes,4,rep,name=addrs,proto3" json:"addrs,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ThreadInfoReply) Reset() { *m = ThreadInfoReply{} } -func (m *ThreadInfoReply) String() string { return proto.CompactTextString(m) } -func (*ThreadInfoReply) ProtoMessage() {} -func (*ThreadInfoReply) Descriptor() ([]byte, []int) { - return fileDescriptor_0a395cd12426f651, []int{6} -} - -func (m *ThreadInfoReply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ThreadInfoReply.Unmarshal(m, b) -} -func (m *ThreadInfoReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ThreadInfoReply.Marshal(b, m, deterministic) -} -func (m *ThreadInfoReply) XXX_Merge(src proto.Message) { - xxx_messageInfo_ThreadInfoReply.Merge(m, src) -} -func (m *ThreadInfoReply) XXX_Size() int { - return xxx_messageInfo_ThreadInfoReply.Size(m) -} -func (m *ThreadInfoReply) XXX_DiscardUnknown() { - xxx_messageInfo_ThreadInfoReply.DiscardUnknown(m) -} - -var xxx_messageInfo_ThreadInfoReply proto.InternalMessageInfo - -func (m *ThreadInfoReply) GetThreadID() []byte { - if m != nil { - return m.ThreadID - } - return nil -} - -func (m *ThreadInfoReply) GetThreadKey() []byte { - if m != nil { - return m.ThreadKey - } - return nil -} - -func (m *ThreadInfoReply) GetLogs() []*LogInfo { - if m != nil { - return m.Logs - } - return nil -} - -func (m *ThreadInfoReply) GetAddrs() [][]byte { - if m != nil { - return m.Addrs - } - return nil -} - -type LogInfo struct { - ID []byte `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"` - PubKey []byte `protobuf:"bytes,2,opt,name=pubKey,proto3" json:"pubKey,omitempty"` - PrivKey []byte `protobuf:"bytes,3,opt,name=privKey,proto3" json:"privKey,omitempty"` - Addrs [][]byte `protobuf:"bytes,4,rep,name=addrs,proto3" json:"addrs,omitempty"` - Head []byte `protobuf:"bytes,5,opt,name=head,proto3" json:"head,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *LogInfo) Reset() { *m = LogInfo{} } -func (m *LogInfo) String() string { return proto.CompactTextString(m) } -func (*LogInfo) ProtoMessage() {} -func (*LogInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_0a395cd12426f651, []int{7} -} - -func (m *LogInfo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_LogInfo.Unmarshal(m, b) -} -func (m *LogInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_LogInfo.Marshal(b, m, deterministic) -} -func (m *LogInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_LogInfo.Merge(m, src) -} -func (m *LogInfo) XXX_Size() int { - return xxx_messageInfo_LogInfo.Size(m) -} -func (m *LogInfo) XXX_DiscardUnknown() { - xxx_messageInfo_LogInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_LogInfo proto.InternalMessageInfo - -func (m *LogInfo) GetID() []byte { - if m != nil { - return m.ID - } - return nil -} - -func (m *LogInfo) GetPubKey() []byte { - if m != nil { - return m.PubKey - } - return nil -} - -func (m *LogInfo) GetPrivKey() []byte { - if m != nil { - return m.PrivKey - } - return nil -} - -func (m *LogInfo) GetAddrs() [][]byte { - if m != nil { - return m.Addrs - } - return nil -} - -func (m *LogInfo) GetHead() []byte { - if m != nil { - return m.Head - } - return nil -} - -type AddThreadRequest struct { - Addr []byte `protobuf:"bytes,1,opt,name=addr,proto3" json:"addr,omitempty"` - Keys *Keys `protobuf:"bytes,2,opt,name=keys,proto3" json:"keys,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AddThreadRequest) Reset() { *m = AddThreadRequest{} } -func (m *AddThreadRequest) String() string { return proto.CompactTextString(m) } -func (*AddThreadRequest) ProtoMessage() {} -func (*AddThreadRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_0a395cd12426f651, []int{8} -} - -func (m *AddThreadRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_AddThreadRequest.Unmarshal(m, b) -} -func (m *AddThreadRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_AddThreadRequest.Marshal(b, m, deterministic) -} -func (m *AddThreadRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_AddThreadRequest.Merge(m, src) -} -func (m *AddThreadRequest) XXX_Size() int { - return xxx_messageInfo_AddThreadRequest.Size(m) -} -func (m *AddThreadRequest) XXX_DiscardUnknown() { - xxx_messageInfo_AddThreadRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_AddThreadRequest proto.InternalMessageInfo - -func (m *AddThreadRequest) GetAddr() []byte { - if m != nil { - return m.Addr - } - return nil -} - -func (m *AddThreadRequest) GetKeys() *Keys { - if m != nil { - return m.Keys - } - return nil -} - -type GetThreadRequest struct { - ThreadID []byte `protobuf:"bytes,1,opt,name=threadID,proto3" json:"threadID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetThreadRequest) Reset() { *m = GetThreadRequest{} } -func (m *GetThreadRequest) String() string { return proto.CompactTextString(m) } -func (*GetThreadRequest) ProtoMessage() {} -func (*GetThreadRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_0a395cd12426f651, []int{9} -} - -func (m *GetThreadRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetThreadRequest.Unmarshal(m, b) -} -func (m *GetThreadRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetThreadRequest.Marshal(b, m, deterministic) -} -func (m *GetThreadRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetThreadRequest.Merge(m, src) -} -func (m *GetThreadRequest) XXX_Size() int { - return xxx_messageInfo_GetThreadRequest.Size(m) -} -func (m *GetThreadRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetThreadRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetThreadRequest proto.InternalMessageInfo - -func (m *GetThreadRequest) GetThreadID() []byte { - if m != nil { - return m.ThreadID - } - return nil -} - -type PullThreadRequest struct { - ThreadID []byte `protobuf:"bytes,1,opt,name=threadID,proto3" json:"threadID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *PullThreadRequest) Reset() { *m = PullThreadRequest{} } -func (m *PullThreadRequest) String() string { return proto.CompactTextString(m) } -func (*PullThreadRequest) ProtoMessage() {} -func (*PullThreadRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_0a395cd12426f651, []int{10} -} - -func (m *PullThreadRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PullThreadRequest.Unmarshal(m, b) -} -func (m *PullThreadRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PullThreadRequest.Marshal(b, m, deterministic) -} -func (m *PullThreadRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_PullThreadRequest.Merge(m, src) -} -func (m *PullThreadRequest) XXX_Size() int { - return xxx_messageInfo_PullThreadRequest.Size(m) -} -func (m *PullThreadRequest) XXX_DiscardUnknown() { - xxx_messageInfo_PullThreadRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_PullThreadRequest proto.InternalMessageInfo - -func (m *PullThreadRequest) GetThreadID() []byte { - if m != nil { - return m.ThreadID - } - return nil -} - -type PullThreadReply struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *PullThreadReply) Reset() { *m = PullThreadReply{} } -func (m *PullThreadReply) String() string { return proto.CompactTextString(m) } -func (*PullThreadReply) ProtoMessage() {} -func (*PullThreadReply) Descriptor() ([]byte, []int) { - return fileDescriptor_0a395cd12426f651, []int{11} -} - -func (m *PullThreadReply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PullThreadReply.Unmarshal(m, b) -} -func (m *PullThreadReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PullThreadReply.Marshal(b, m, deterministic) -} -func (m *PullThreadReply) XXX_Merge(src proto.Message) { - xxx_messageInfo_PullThreadReply.Merge(m, src) -} -func (m *PullThreadReply) XXX_Size() int { - return xxx_messageInfo_PullThreadReply.Size(m) -} -func (m *PullThreadReply) XXX_DiscardUnknown() { - xxx_messageInfo_PullThreadReply.DiscardUnknown(m) -} - -var xxx_messageInfo_PullThreadReply proto.InternalMessageInfo - -type DeleteThreadRequest struct { - ThreadID []byte `protobuf:"bytes,1,opt,name=threadID,proto3" json:"threadID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeleteThreadRequest) Reset() { *m = DeleteThreadRequest{} } -func (m *DeleteThreadRequest) String() string { return proto.CompactTextString(m) } -func (*DeleteThreadRequest) ProtoMessage() {} -func (*DeleteThreadRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_0a395cd12426f651, []int{12} -} - -func (m *DeleteThreadRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteThreadRequest.Unmarshal(m, b) -} -func (m *DeleteThreadRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteThreadRequest.Marshal(b, m, deterministic) -} -func (m *DeleteThreadRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteThreadRequest.Merge(m, src) -} -func (m *DeleteThreadRequest) XXX_Size() int { - return xxx_messageInfo_DeleteThreadRequest.Size(m) -} -func (m *DeleteThreadRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteThreadRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteThreadRequest proto.InternalMessageInfo - -func (m *DeleteThreadRequest) GetThreadID() []byte { - if m != nil { - return m.ThreadID - } - return nil -} - -type DeleteThreadReply struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeleteThreadReply) Reset() { *m = DeleteThreadReply{} } -func (m *DeleteThreadReply) String() string { return proto.CompactTextString(m) } -func (*DeleteThreadReply) ProtoMessage() {} -func (*DeleteThreadReply) Descriptor() ([]byte, []int) { - return fileDescriptor_0a395cd12426f651, []int{13} -} - -func (m *DeleteThreadReply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteThreadReply.Unmarshal(m, b) -} -func (m *DeleteThreadReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteThreadReply.Marshal(b, m, deterministic) -} -func (m *DeleteThreadReply) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteThreadReply.Merge(m, src) -} -func (m *DeleteThreadReply) XXX_Size() int { - return xxx_messageInfo_DeleteThreadReply.Size(m) -} -func (m *DeleteThreadReply) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteThreadReply.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteThreadReply proto.InternalMessageInfo - -type AddReplicatorRequest struct { - ThreadID []byte `protobuf:"bytes,1,opt,name=threadID,proto3" json:"threadID,omitempty"` - Addr []byte `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AddReplicatorRequest) Reset() { *m = AddReplicatorRequest{} } -func (m *AddReplicatorRequest) String() string { return proto.CompactTextString(m) } -func (*AddReplicatorRequest) ProtoMessage() {} -func (*AddReplicatorRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_0a395cd12426f651, []int{14} -} - -func (m *AddReplicatorRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_AddReplicatorRequest.Unmarshal(m, b) -} -func (m *AddReplicatorRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_AddReplicatorRequest.Marshal(b, m, deterministic) -} -func (m *AddReplicatorRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_AddReplicatorRequest.Merge(m, src) -} -func (m *AddReplicatorRequest) XXX_Size() int { - return xxx_messageInfo_AddReplicatorRequest.Size(m) -} -func (m *AddReplicatorRequest) XXX_DiscardUnknown() { - xxx_messageInfo_AddReplicatorRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_AddReplicatorRequest proto.InternalMessageInfo - -func (m *AddReplicatorRequest) GetThreadID() []byte { - if m != nil { - return m.ThreadID - } - return nil -} - -func (m *AddReplicatorRequest) GetAddr() []byte { - if m != nil { - return m.Addr - } - return nil -} - -type AddReplicatorReply struct { - PeerID []byte `protobuf:"bytes,1,opt,name=peerID,proto3" json:"peerID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AddReplicatorReply) Reset() { *m = AddReplicatorReply{} } -func (m *AddReplicatorReply) String() string { return proto.CompactTextString(m) } -func (*AddReplicatorReply) ProtoMessage() {} -func (*AddReplicatorReply) Descriptor() ([]byte, []int) { - return fileDescriptor_0a395cd12426f651, []int{15} -} - -func (m *AddReplicatorReply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_AddReplicatorReply.Unmarshal(m, b) -} -func (m *AddReplicatorReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_AddReplicatorReply.Marshal(b, m, deterministic) -} -func (m *AddReplicatorReply) XXX_Merge(src proto.Message) { - xxx_messageInfo_AddReplicatorReply.Merge(m, src) -} -func (m *AddReplicatorReply) XXX_Size() int { - return xxx_messageInfo_AddReplicatorReply.Size(m) -} -func (m *AddReplicatorReply) XXX_DiscardUnknown() { - xxx_messageInfo_AddReplicatorReply.DiscardUnknown(m) -} - -var xxx_messageInfo_AddReplicatorReply proto.InternalMessageInfo - -func (m *AddReplicatorReply) GetPeerID() []byte { - if m != nil { - return m.PeerID - } - return nil -} - -type CreateRecordRequest struct { - ThreadID []byte `protobuf:"bytes,1,opt,name=threadID,proto3" json:"threadID,omitempty"` - Body []byte `protobuf:"bytes,2,opt,name=body,proto3" json:"body,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CreateRecordRequest) Reset() { *m = CreateRecordRequest{} } -func (m *CreateRecordRequest) String() string { return proto.CompactTextString(m) } -func (*CreateRecordRequest) ProtoMessage() {} -func (*CreateRecordRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_0a395cd12426f651, []int{16} -} - -func (m *CreateRecordRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CreateRecordRequest.Unmarshal(m, b) -} -func (m *CreateRecordRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CreateRecordRequest.Marshal(b, m, deterministic) -} -func (m *CreateRecordRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateRecordRequest.Merge(m, src) -} -func (m *CreateRecordRequest) XXX_Size() int { - return xxx_messageInfo_CreateRecordRequest.Size(m) -} -func (m *CreateRecordRequest) XXX_DiscardUnknown() { - xxx_messageInfo_CreateRecordRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateRecordRequest proto.InternalMessageInfo - -func (m *CreateRecordRequest) GetThreadID() []byte { - if m != nil { - return m.ThreadID - } - return nil -} - -func (m *CreateRecordRequest) GetBody() []byte { - if m != nil { - return m.Body - } - return nil -} - -type NewRecordReply struct { - ThreadID []byte `protobuf:"bytes,1,opt,name=threadID,proto3" json:"threadID,omitempty"` - LogID []byte `protobuf:"bytes,2,opt,name=logID,proto3" json:"logID,omitempty"` - Record *Record `protobuf:"bytes,3,opt,name=record,proto3" json:"record,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NewRecordReply) Reset() { *m = NewRecordReply{} } -func (m *NewRecordReply) String() string { return proto.CompactTextString(m) } -func (*NewRecordReply) ProtoMessage() {} -func (*NewRecordReply) Descriptor() ([]byte, []int) { - return fileDescriptor_0a395cd12426f651, []int{17} -} - -func (m *NewRecordReply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NewRecordReply.Unmarshal(m, b) -} -func (m *NewRecordReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NewRecordReply.Marshal(b, m, deterministic) -} -func (m *NewRecordReply) XXX_Merge(src proto.Message) { - xxx_messageInfo_NewRecordReply.Merge(m, src) -} -func (m *NewRecordReply) XXX_Size() int { - return xxx_messageInfo_NewRecordReply.Size(m) -} -func (m *NewRecordReply) XXX_DiscardUnknown() { - xxx_messageInfo_NewRecordReply.DiscardUnknown(m) -} - -var xxx_messageInfo_NewRecordReply proto.InternalMessageInfo - -func (m *NewRecordReply) GetThreadID() []byte { - if m != nil { - return m.ThreadID - } - return nil -} - -func (m *NewRecordReply) GetLogID() []byte { - if m != nil { - return m.LogID - } - return nil -} - -func (m *NewRecordReply) GetRecord() *Record { - if m != nil { - return m.Record - } - return nil -} - -type AddRecordRequest struct { - ThreadID []byte `protobuf:"bytes,1,opt,name=threadID,proto3" json:"threadID,omitempty"` - LogID []byte `protobuf:"bytes,2,opt,name=logID,proto3" json:"logID,omitempty"` - Record *Record `protobuf:"bytes,3,opt,name=record,proto3" json:"record,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AddRecordRequest) Reset() { *m = AddRecordRequest{} } -func (m *AddRecordRequest) String() string { return proto.CompactTextString(m) } -func (*AddRecordRequest) ProtoMessage() {} -func (*AddRecordRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_0a395cd12426f651, []int{18} -} - -func (m *AddRecordRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_AddRecordRequest.Unmarshal(m, b) -} -func (m *AddRecordRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_AddRecordRequest.Marshal(b, m, deterministic) -} -func (m *AddRecordRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_AddRecordRequest.Merge(m, src) -} -func (m *AddRecordRequest) XXX_Size() int { - return xxx_messageInfo_AddRecordRequest.Size(m) -} -func (m *AddRecordRequest) XXX_DiscardUnknown() { - xxx_messageInfo_AddRecordRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_AddRecordRequest proto.InternalMessageInfo - -func (m *AddRecordRequest) GetThreadID() []byte { - if m != nil { - return m.ThreadID - } - return nil -} - -func (m *AddRecordRequest) GetLogID() []byte { - if m != nil { - return m.LogID - } - return nil -} - -func (m *AddRecordRequest) GetRecord() *Record { - if m != nil { - return m.Record - } - return nil -} - -type Record struct { - RecordNode []byte `protobuf:"bytes,1,opt,name=recordNode,proto3" json:"recordNode,omitempty"` - EventNode []byte `protobuf:"bytes,2,opt,name=eventNode,proto3" json:"eventNode,omitempty"` - HeaderNode []byte `protobuf:"bytes,3,opt,name=headerNode,proto3" json:"headerNode,omitempty"` - BodyNode []byte `protobuf:"bytes,4,opt,name=bodyNode,proto3" json:"bodyNode,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Record) Reset() { *m = Record{} } -func (m *Record) String() string { return proto.CompactTextString(m) } -func (*Record) ProtoMessage() {} -func (*Record) Descriptor() ([]byte, []int) { - return fileDescriptor_0a395cd12426f651, []int{19} -} - -func (m *Record) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Record.Unmarshal(m, b) -} -func (m *Record) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Record.Marshal(b, m, deterministic) -} -func (m *Record) XXX_Merge(src proto.Message) { - xxx_messageInfo_Record.Merge(m, src) -} -func (m *Record) XXX_Size() int { - return xxx_messageInfo_Record.Size(m) -} -func (m *Record) XXX_DiscardUnknown() { - xxx_messageInfo_Record.DiscardUnknown(m) -} - -var xxx_messageInfo_Record proto.InternalMessageInfo - -func (m *Record) GetRecordNode() []byte { - if m != nil { - return m.RecordNode - } - return nil -} - -func (m *Record) GetEventNode() []byte { - if m != nil { - return m.EventNode - } - return nil -} - -func (m *Record) GetHeaderNode() []byte { - if m != nil { - return m.HeaderNode - } - return nil -} - -func (m *Record) GetBodyNode() []byte { - if m != nil { - return m.BodyNode - } - return nil -} - -type AddRecordReply struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AddRecordReply) Reset() { *m = AddRecordReply{} } -func (m *AddRecordReply) String() string { return proto.CompactTextString(m) } -func (*AddRecordReply) ProtoMessage() {} -func (*AddRecordReply) Descriptor() ([]byte, []int) { - return fileDescriptor_0a395cd12426f651, []int{20} -} - -func (m *AddRecordReply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_AddRecordReply.Unmarshal(m, b) -} -func (m *AddRecordReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_AddRecordReply.Marshal(b, m, deterministic) -} -func (m *AddRecordReply) XXX_Merge(src proto.Message) { - xxx_messageInfo_AddRecordReply.Merge(m, src) -} -func (m *AddRecordReply) XXX_Size() int { - return xxx_messageInfo_AddRecordReply.Size(m) -} -func (m *AddRecordReply) XXX_DiscardUnknown() { - xxx_messageInfo_AddRecordReply.DiscardUnknown(m) -} - -var xxx_messageInfo_AddRecordReply proto.InternalMessageInfo - -type GetRecordRequest struct { - ThreadID []byte `protobuf:"bytes,1,opt,name=threadID,proto3" json:"threadID,omitempty"` - RecordID []byte `protobuf:"bytes,2,opt,name=recordID,proto3" json:"recordID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetRecordRequest) Reset() { *m = GetRecordRequest{} } -func (m *GetRecordRequest) String() string { return proto.CompactTextString(m) } -func (*GetRecordRequest) ProtoMessage() {} -func (*GetRecordRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_0a395cd12426f651, []int{21} -} - -func (m *GetRecordRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetRecordRequest.Unmarshal(m, b) -} -func (m *GetRecordRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetRecordRequest.Marshal(b, m, deterministic) -} -func (m *GetRecordRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetRecordRequest.Merge(m, src) -} -func (m *GetRecordRequest) XXX_Size() int { - return xxx_messageInfo_GetRecordRequest.Size(m) -} -func (m *GetRecordRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetRecordRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetRecordRequest proto.InternalMessageInfo - -func (m *GetRecordRequest) GetThreadID() []byte { - if m != nil { - return m.ThreadID - } - return nil -} - -func (m *GetRecordRequest) GetRecordID() []byte { - if m != nil { - return m.RecordID - } - return nil -} - -type GetRecordReply struct { - Record *Record `protobuf:"bytes,1,opt,name=record,proto3" json:"record,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetRecordReply) Reset() { *m = GetRecordReply{} } -func (m *GetRecordReply) String() string { return proto.CompactTextString(m) } -func (*GetRecordReply) ProtoMessage() {} -func (*GetRecordReply) Descriptor() ([]byte, []int) { - return fileDescriptor_0a395cd12426f651, []int{22} -} - -func (m *GetRecordReply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetRecordReply.Unmarshal(m, b) -} -func (m *GetRecordReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetRecordReply.Marshal(b, m, deterministic) -} -func (m *GetRecordReply) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetRecordReply.Merge(m, src) -} -func (m *GetRecordReply) XXX_Size() int { - return xxx_messageInfo_GetRecordReply.Size(m) -} -func (m *GetRecordReply) XXX_DiscardUnknown() { - xxx_messageInfo_GetRecordReply.DiscardUnknown(m) -} - -var xxx_messageInfo_GetRecordReply proto.InternalMessageInfo - -func (m *GetRecordReply) GetRecord() *Record { - if m != nil { - return m.Record - } - return nil -} - -type SubscribeRequest struct { - ThreadIDs [][]byte `protobuf:"bytes,1,rep,name=threadIDs,proto3" json:"threadIDs,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SubscribeRequest) Reset() { *m = SubscribeRequest{} } -func (m *SubscribeRequest) String() string { return proto.CompactTextString(m) } -func (*SubscribeRequest) ProtoMessage() {} -func (*SubscribeRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_0a395cd12426f651, []int{23} -} - -func (m *SubscribeRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SubscribeRequest.Unmarshal(m, b) -} -func (m *SubscribeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SubscribeRequest.Marshal(b, m, deterministic) -} -func (m *SubscribeRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_SubscribeRequest.Merge(m, src) -} -func (m *SubscribeRequest) XXX_Size() int { - return xxx_messageInfo_SubscribeRequest.Size(m) -} -func (m *SubscribeRequest) XXX_DiscardUnknown() { - xxx_messageInfo_SubscribeRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_SubscribeRequest proto.InternalMessageInfo - -func (m *SubscribeRequest) GetThreadIDs() [][]byte { - if m != nil { - return m.ThreadIDs - } - return nil -} - -func init() { - proto.RegisterType((*GetHostIDRequest)(nil), "threads.net.pb.GetHostIDRequest") - proto.RegisterType((*GetHostIDReply)(nil), "threads.net.pb.GetHostIDReply") - proto.RegisterType((*GetTokenRequest)(nil), "threads.net.pb.GetTokenRequest") - proto.RegisterType((*GetTokenReply)(nil), "threads.net.pb.GetTokenReply") - proto.RegisterType((*CreateThreadRequest)(nil), "threads.net.pb.CreateThreadRequest") - proto.RegisterType((*Keys)(nil), "threads.net.pb.Keys") - proto.RegisterType((*ThreadInfoReply)(nil), "threads.net.pb.ThreadInfoReply") - proto.RegisterType((*LogInfo)(nil), "threads.net.pb.LogInfo") - proto.RegisterType((*AddThreadRequest)(nil), "threads.net.pb.AddThreadRequest") - proto.RegisterType((*GetThreadRequest)(nil), "threads.net.pb.GetThreadRequest") - proto.RegisterType((*PullThreadRequest)(nil), "threads.net.pb.PullThreadRequest") - proto.RegisterType((*PullThreadReply)(nil), "threads.net.pb.PullThreadReply") - proto.RegisterType((*DeleteThreadRequest)(nil), "threads.net.pb.DeleteThreadRequest") - proto.RegisterType((*DeleteThreadReply)(nil), "threads.net.pb.DeleteThreadReply") - proto.RegisterType((*AddReplicatorRequest)(nil), "threads.net.pb.AddReplicatorRequest") - proto.RegisterType((*AddReplicatorReply)(nil), "threads.net.pb.AddReplicatorReply") - proto.RegisterType((*CreateRecordRequest)(nil), "threads.net.pb.CreateRecordRequest") - proto.RegisterType((*NewRecordReply)(nil), "threads.net.pb.NewRecordReply") - proto.RegisterType((*AddRecordRequest)(nil), "threads.net.pb.AddRecordRequest") - proto.RegisterType((*Record)(nil), "threads.net.pb.Record") - proto.RegisterType((*AddRecordReply)(nil), "threads.net.pb.AddRecordReply") - proto.RegisterType((*GetRecordRequest)(nil), "threads.net.pb.GetRecordRequest") - proto.RegisterType((*GetRecordReply)(nil), "threads.net.pb.GetRecordReply") - proto.RegisterType((*SubscribeRequest)(nil), "threads.net.pb.SubscribeRequest") -} - -func init() { proto.RegisterFile("threadsnet.proto", fileDescriptor_0a395cd12426f651) } - -var fileDescriptor_0a395cd12426f651 = []byte{ - // 872 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xcd, 0x72, 0xda, 0x48, - 0x10, 0x46, 0xfc, 0x5a, 0x6d, 0x8c, 0xf1, 0x98, 0xf2, 0x52, 0xec, 0x2e, 0x8b, 0x67, 0xf7, 0x40, - 0xd5, 0xa6, 0x88, 0x43, 0x2e, 0x39, 0xe4, 0x10, 0x1c, 0x1c, 0x43, 0x9c, 0x22, 0x44, 0x26, 0xa9, - 0x54, 0xf9, 0xe0, 0x12, 0x68, 0x82, 0x29, 0xab, 0x18, 0x22, 0x0d, 0x4e, 0xb8, 0xe6, 0x01, 0xf2, - 0x10, 0x79, 0xcd, 0x5c, 0x52, 0x33, 0x23, 0x09, 0xfd, 0x19, 0xe4, 0xaa, 0xdc, 0xd4, 0x3d, 0xdd, - 0x5f, 0xff, 0x4c, 0xf7, 0x37, 0x82, 0x32, 0xbb, 0xb1, 0x88, 0x6e, 0xd8, 0x73, 0xc2, 0x5a, 0x0b, - 0x8b, 0x32, 0x8a, 0x4a, 0x8e, 0xa6, 0x25, 0x54, 0x63, 0x8c, 0xa0, 0x7c, 0x4e, 0x58, 0x8f, 0xda, - 0xac, 0xdf, 0xd5, 0xc8, 0xe7, 0x25, 0xb1, 0x19, 0x6e, 0x42, 0xc9, 0xa7, 0x5b, 0x98, 0x2b, 0x74, - 0x04, 0xf9, 0x05, 0x21, 0x56, 0xbf, 0x5b, 0x55, 0x1a, 0x4a, 0xb3, 0xa8, 0x39, 0x12, 0x1e, 0xc2, - 0xfe, 0x39, 0x61, 0x23, 0x7a, 0x4b, 0xe6, 0x8e, 0x33, 0x42, 0x90, 0xb9, 0x25, 0x2b, 0x61, 0xa7, - 0xf6, 0x52, 0x1a, 0x17, 0x50, 0x1d, 0x54, 0x7b, 0x36, 0x9d, 0xeb, 0x6c, 0x69, 0x91, 0x6a, 0x9a, - 0x23, 0xf4, 0x52, 0xda, 0x5a, 0x75, 0xaa, 0x42, 0x61, 0xa1, 0xaf, 0x4c, 0xaa, 0x1b, 0x58, 0x83, - 0xbd, 0x35, 0x22, 0x0f, 0x5d, 0x07, 0x75, 0x72, 0xa3, 0x9b, 0x26, 0x99, 0x4f, 0x89, 0x8c, 0xce, - 0x7d, 0x3d, 0x15, 0x3a, 0x82, 0x1c, 0xe3, 0xd6, 0x02, 0x97, 0x47, 0x94, 0xa2, 0x1f, 0xf3, 0x0a, - 0x0e, 0x5f, 0x5a, 0x44, 0x67, 0x64, 0x24, 0x6a, 0x77, 0x33, 0xad, 0xc1, 0x8e, 0x6c, 0x86, 0x57, - 0x96, 0x27, 0xa3, 0x26, 0x64, 0x6f, 0xc9, 0xca, 0x16, 0xa0, 0xbb, 0xed, 0x4a, 0x2b, 0xd8, 0xb5, - 0xd6, 0x05, 0x59, 0xd9, 0x9a, 0xb0, 0xc0, 0xcf, 0x21, 0xcb, 0x25, 0xf4, 0x17, 0xa8, 0xd2, 0xe8, - 0xc2, 0xa9, 0xbe, 0xa8, 0xad, 0x15, 0xbc, 0x81, 0x26, 0x9d, 0xf2, 0xa3, 0xb4, 0x6c, 0xa0, 0x94, - 0xf0, 0x77, 0x05, 0xf6, 0x65, 0x56, 0xfd, 0xf9, 0x27, 0x2a, 0x2b, 0xde, 0x94, 0x57, 0x20, 0x4a, - 0x3a, 0x1c, 0xe5, 0x7f, 0xc8, 0x9a, 0x74, 0x6a, 0x57, 0x33, 0x8d, 0x4c, 0x73, 0xb7, 0xfd, 0x47, - 0x38, 0xeb, 0x37, 0x74, 0x2a, 0xa2, 0x08, 0x23, 0x54, 0x81, 0x9c, 0x6e, 0x18, 0x96, 0x5d, 0xcd, - 0x36, 0x32, 0xcd, 0xa2, 0x26, 0x05, 0xbc, 0x84, 0x82, 0x63, 0x86, 0x4a, 0x90, 0xf6, 0x32, 0x48, - 0xf7, 0xbb, 0x62, 0x08, 0x96, 0x63, 0x5f, 0x0d, 0x52, 0x42, 0x55, 0x28, 0x2c, 0xac, 0xd9, 0x1d, - 0x3f, 0xc8, 0x88, 0x03, 0x57, 0x8c, 0x0f, 0x81, 0x10, 0x64, 0x6f, 0x88, 0x6e, 0x54, 0x73, 0xc2, - 0x58, 0x7c, 0xe3, 0x21, 0x94, 0x3b, 0x86, 0x11, 0xbc, 0x1f, 0x04, 0x59, 0xee, 0xe0, 0x64, 0x20, - 0xbe, 0x1f, 0x70, 0x2f, 0x2d, 0x31, 0xd8, 0x89, 0x6f, 0x1c, 0x3f, 0x86, 0x83, 0xe1, 0xd2, 0x34, - 0x93, 0x3b, 0x1c, 0xc0, 0xbe, 0xdf, 0x61, 0x61, 0xae, 0xf0, 0x13, 0x38, 0xec, 0x12, 0x93, 0x3c, - 0x60, 0xd0, 0xf0, 0x21, 0x1c, 0x04, 0x5d, 0x38, 0xce, 0x2b, 0xa8, 0x74, 0x0c, 0xf1, 0x3d, 0x9b, - 0xe8, 0x8c, 0x5a, 0x49, 0x26, 0xd6, 0xed, 0x56, 0x7a, 0xdd, 0x2d, 0xfc, 0x08, 0x50, 0x08, 0x67, - 0xd3, 0x32, 0x9f, 0xb9, 0x6b, 0xa2, 0x91, 0x09, 0xb5, 0x8c, 0x84, 0x41, 0xc7, 0xd4, 0x70, 0x07, - 0x42, 0x7c, 0x63, 0x0b, 0x4a, 0x03, 0xf2, 0xc5, 0xc5, 0xd8, 0x36, 0xd0, 0x15, 0xc8, 0x99, 0x74, - 0xda, 0xef, 0x3a, 0x10, 0x52, 0x40, 0x2d, 0xc8, 0x5b, 0x02, 0x40, 0x4c, 0xd4, 0x6e, 0xfb, 0x28, - 0x7c, 0xd1, 0x0e, 0xbc, 0x63, 0x85, 0x99, 0x18, 0x9f, 0xe4, 0x79, 0xff, 0x9e, 0xa8, 0xdf, 0x14, - 0xc8, 0x4b, 0x15, 0xaa, 0x03, 0x48, 0xe5, 0x80, 0x1a, 0x0e, 0x4d, 0x69, 0x3e, 0x0d, 0xdf, 0x5b, - 0x72, 0x47, 0xe6, 0x4c, 0x1c, 0x3b, 0x7b, 0xeb, 0x29, 0xb8, 0x37, 0xdf, 0x02, 0x62, 0x89, 0x63, - 0xb9, 0x44, 0x3e, 0x0d, 0x2f, 0x85, 0xb7, 0x56, 0x9c, 0x66, 0x65, 0x29, 0xae, 0x8c, 0xcb, 0x50, - 0xf2, 0x95, 0xce, 0xa7, 0xe7, 0xb5, 0x98, 0xfc, 0xe4, 0xcd, 0xa8, 0xc1, 0x8e, 0xcc, 0xd4, 0xeb, - 0x87, 0x27, 0xe3, 0x17, 0xe2, 0x29, 0xf0, 0x5f, 0xe6, 0xba, 0x49, 0x4a, 0xa2, 0x26, 0x9d, 0x40, - 0xf9, 0x72, 0x39, 0xb6, 0x27, 0xd6, 0x6c, 0x4c, 0xdc, 0x6c, 0x3c, 0x16, 0xeb, 0x77, 0xed, 0xaa, - 0x22, 0xb8, 0x61, 0xad, 0x68, 0xff, 0x2c, 0x40, 0xa6, 0x33, 0xec, 0xa3, 0xb7, 0xa0, 0x7a, 0xcf, - 0x10, 0x6a, 0x84, 0xc3, 0x84, 0x5f, 0xad, 0x5a, 0x7d, 0x83, 0x05, 0x6f, 0x4b, 0x0a, 0x0d, 0x61, - 0xc7, 0x7d, 0x5b, 0xd0, 0x3f, 0x31, 0xd6, 0xfe, 0x77, 0xac, 0xf6, 0xf7, 0xfd, 0x06, 0x02, 0xad, - 0xa9, 0x9c, 0x28, 0xe8, 0x03, 0x14, 0xfd, 0x2f, 0x0b, 0xfa, 0x37, 0xec, 0x14, 0xf3, 0xee, 0xd4, - 0x22, 0xa1, 0x43, 0x0f, 0x80, 0xc8, 0x54, 0xf5, 0xe8, 0x30, 0x5a, 0x7a, 0x98, 0x29, 0x13, 0x22, - 0x7a, 0x74, 0x18, 0xdb, 0xcc, 0x07, 0x23, 0x6a, 0x00, 0x6b, 0xfe, 0x43, 0xc7, 0x61, 0x87, 0x08, - 0x99, 0x46, 0x31, 0xc3, 0xf4, 0x99, 0x42, 0x1f, 0xa1, 0xe8, 0x67, 0xc3, 0x68, 0x3f, 0x63, 0xe8, - 0xb5, 0x76, 0xbc, 0xd9, 0x48, 0x22, 0x5f, 0xc1, 0x5e, 0x80, 0x0a, 0xd1, 0x7f, 0x31, 0x5d, 0x8d, - 0x30, 0x6e, 0x0d, 0x6f, 0xb1, 0x92, 0xe0, 0xef, 0xdd, 0x31, 0x70, 0xd8, 0xe0, 0x9e, 0x31, 0x08, - 0xac, 0x64, 0x74, 0x5e, 0x83, 0xac, 0x89, 0x53, 0x7c, 0x01, 0xbc, 0xd5, 0x8e, 0x9d, 0x82, 0x2d, - 0x80, 0x21, 0x5e, 0x48, 0x39, 0x1b, 0x75, 0x1f, 0x60, 0x98, 0x34, 0x62, 0x37, 0x2a, 0x08, 0xf8, - 0x0e, 0x54, 0x6f, 0xb9, 0xa3, 0x80, 0xe1, 0xbd, 0xdf, 0x5e, 0xf2, 0x89, 0x72, 0xfa, 0x0c, 0xfe, - 0x9c, 0xd1, 0x16, 0x23, 0x5f, 0xd9, 0xcc, 0x24, 0xae, 0xfd, 0xf5, 0x9c, 0xb0, 0xeb, 0xa9, 0xb5, - 0x98, 0x9c, 0x82, 0xbc, 0x56, 0x7b, 0x40, 0xd8, 0x50, 0xf9, 0x91, 0x86, 0x51, 0x4f, 0x3b, 0xeb, - 0x74, 0x2f, 0x07, 0x67, 0xa3, 0x71, 0x5e, 0xfc, 0xe1, 0x3e, 0xfd, 0x15, 0x00, 0x00, 0xff, 0xff, - 0xc0, 0xd3, 0x78, 0x20, 0xf5, 0x0a, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// APIClient is the client API for API service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type APIClient interface { - GetHostID(ctx context.Context, in *GetHostIDRequest, opts ...grpc.CallOption) (*GetHostIDReply, error) - GetToken(ctx context.Context, opts ...grpc.CallOption) (API_GetTokenClient, error) - CreateThread(ctx context.Context, in *CreateThreadRequest, opts ...grpc.CallOption) (*ThreadInfoReply, error) - AddThread(ctx context.Context, in *AddThreadRequest, opts ...grpc.CallOption) (*ThreadInfoReply, error) - GetThread(ctx context.Context, in *GetThreadRequest, opts ...grpc.CallOption) (*ThreadInfoReply, error) - PullThread(ctx context.Context, in *PullThreadRequest, opts ...grpc.CallOption) (*PullThreadReply, error) - DeleteThread(ctx context.Context, in *DeleteThreadRequest, opts ...grpc.CallOption) (*DeleteThreadReply, error) - AddReplicator(ctx context.Context, in *AddReplicatorRequest, opts ...grpc.CallOption) (*AddReplicatorReply, error) - CreateRecord(ctx context.Context, in *CreateRecordRequest, opts ...grpc.CallOption) (*NewRecordReply, error) - AddRecord(ctx context.Context, in *AddRecordRequest, opts ...grpc.CallOption) (*AddRecordReply, error) - GetRecord(ctx context.Context, in *GetRecordRequest, opts ...grpc.CallOption) (*GetRecordReply, error) - Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (API_SubscribeClient, error) -} - -type aPIClient struct { - cc *grpc.ClientConn -} - -func NewAPIClient(cc *grpc.ClientConn) APIClient { - return &aPIClient{cc} -} - -func (c *aPIClient) GetHostID(ctx context.Context, in *GetHostIDRequest, opts ...grpc.CallOption) (*GetHostIDReply, error) { - out := new(GetHostIDReply) - err := c.cc.Invoke(ctx, "/threads.net.pb.API/GetHostID", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aPIClient) GetToken(ctx context.Context, opts ...grpc.CallOption) (API_GetTokenClient, error) { - stream, err := c.cc.NewStream(ctx, &_API_serviceDesc.Streams[0], "/threads.net.pb.API/GetToken", opts...) - if err != nil { - return nil, err - } - x := &aPIGetTokenClient{stream} - return x, nil -} - -type API_GetTokenClient interface { - Send(*GetTokenRequest) error - Recv() (*GetTokenReply, error) - grpc.ClientStream -} - -type aPIGetTokenClient struct { - grpc.ClientStream -} - -func (x *aPIGetTokenClient) Send(m *GetTokenRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *aPIGetTokenClient) Recv() (*GetTokenReply, error) { - m := new(GetTokenReply) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *aPIClient) CreateThread(ctx context.Context, in *CreateThreadRequest, opts ...grpc.CallOption) (*ThreadInfoReply, error) { - out := new(ThreadInfoReply) - err := c.cc.Invoke(ctx, "/threads.net.pb.API/CreateThread", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aPIClient) AddThread(ctx context.Context, in *AddThreadRequest, opts ...grpc.CallOption) (*ThreadInfoReply, error) { - out := new(ThreadInfoReply) - err := c.cc.Invoke(ctx, "/threads.net.pb.API/AddThread", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aPIClient) GetThread(ctx context.Context, in *GetThreadRequest, opts ...grpc.CallOption) (*ThreadInfoReply, error) { - out := new(ThreadInfoReply) - err := c.cc.Invoke(ctx, "/threads.net.pb.API/GetThread", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aPIClient) PullThread(ctx context.Context, in *PullThreadRequest, opts ...grpc.CallOption) (*PullThreadReply, error) { - out := new(PullThreadReply) - err := c.cc.Invoke(ctx, "/threads.net.pb.API/PullThread", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aPIClient) DeleteThread(ctx context.Context, in *DeleteThreadRequest, opts ...grpc.CallOption) (*DeleteThreadReply, error) { - out := new(DeleteThreadReply) - err := c.cc.Invoke(ctx, "/threads.net.pb.API/DeleteThread", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aPIClient) AddReplicator(ctx context.Context, in *AddReplicatorRequest, opts ...grpc.CallOption) (*AddReplicatorReply, error) { - out := new(AddReplicatorReply) - err := c.cc.Invoke(ctx, "/threads.net.pb.API/AddReplicator", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aPIClient) CreateRecord(ctx context.Context, in *CreateRecordRequest, opts ...grpc.CallOption) (*NewRecordReply, error) { - out := new(NewRecordReply) - err := c.cc.Invoke(ctx, "/threads.net.pb.API/CreateRecord", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aPIClient) AddRecord(ctx context.Context, in *AddRecordRequest, opts ...grpc.CallOption) (*AddRecordReply, error) { - out := new(AddRecordReply) - err := c.cc.Invoke(ctx, "/threads.net.pb.API/AddRecord", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aPIClient) GetRecord(ctx context.Context, in *GetRecordRequest, opts ...grpc.CallOption) (*GetRecordReply, error) { - out := new(GetRecordReply) - err := c.cc.Invoke(ctx, "/threads.net.pb.API/GetRecord", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aPIClient) Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (API_SubscribeClient, error) { - stream, err := c.cc.NewStream(ctx, &_API_serviceDesc.Streams[1], "/threads.net.pb.API/Subscribe", opts...) - if err != nil { - return nil, err - } - x := &aPISubscribeClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type API_SubscribeClient interface { - Recv() (*NewRecordReply, error) - grpc.ClientStream -} - -type aPISubscribeClient struct { - grpc.ClientStream -} - -func (x *aPISubscribeClient) Recv() (*NewRecordReply, error) { - m := new(NewRecordReply) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// APIServer is the server API for API service. -type APIServer interface { - GetHostID(context.Context, *GetHostIDRequest) (*GetHostIDReply, error) - GetToken(API_GetTokenServer) error - CreateThread(context.Context, *CreateThreadRequest) (*ThreadInfoReply, error) - AddThread(context.Context, *AddThreadRequest) (*ThreadInfoReply, error) - GetThread(context.Context, *GetThreadRequest) (*ThreadInfoReply, error) - PullThread(context.Context, *PullThreadRequest) (*PullThreadReply, error) - DeleteThread(context.Context, *DeleteThreadRequest) (*DeleteThreadReply, error) - AddReplicator(context.Context, *AddReplicatorRequest) (*AddReplicatorReply, error) - CreateRecord(context.Context, *CreateRecordRequest) (*NewRecordReply, error) - AddRecord(context.Context, *AddRecordRequest) (*AddRecordReply, error) - GetRecord(context.Context, *GetRecordRequest) (*GetRecordReply, error) - Subscribe(*SubscribeRequest, API_SubscribeServer) error -} - -// UnimplementedAPIServer can be embedded to have forward compatible implementations. -type UnimplementedAPIServer struct { -} - -func (*UnimplementedAPIServer) GetHostID(ctx context.Context, req *GetHostIDRequest) (*GetHostIDReply, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetHostID not implemented") -} -func (*UnimplementedAPIServer) GetToken(srv API_GetTokenServer) error { - return status.Errorf(codes.Unimplemented, "method GetToken not implemented") -} -func (*UnimplementedAPIServer) CreateThread(ctx context.Context, req *CreateThreadRequest) (*ThreadInfoReply, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateThread not implemented") -} -func (*UnimplementedAPIServer) AddThread(ctx context.Context, req *AddThreadRequest) (*ThreadInfoReply, error) { - return nil, status.Errorf(codes.Unimplemented, "method AddThread not implemented") -} -func (*UnimplementedAPIServer) GetThread(ctx context.Context, req *GetThreadRequest) (*ThreadInfoReply, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetThread not implemented") -} -func (*UnimplementedAPIServer) PullThread(ctx context.Context, req *PullThreadRequest) (*PullThreadReply, error) { - return nil, status.Errorf(codes.Unimplemented, "method PullThread not implemented") -} -func (*UnimplementedAPIServer) DeleteThread(ctx context.Context, req *DeleteThreadRequest) (*DeleteThreadReply, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteThread not implemented") -} -func (*UnimplementedAPIServer) AddReplicator(ctx context.Context, req *AddReplicatorRequest) (*AddReplicatorReply, error) { - return nil, status.Errorf(codes.Unimplemented, "method AddReplicator not implemented") -} -func (*UnimplementedAPIServer) CreateRecord(ctx context.Context, req *CreateRecordRequest) (*NewRecordReply, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateRecord not implemented") -} -func (*UnimplementedAPIServer) AddRecord(ctx context.Context, req *AddRecordRequest) (*AddRecordReply, error) { - return nil, status.Errorf(codes.Unimplemented, "method AddRecord not implemented") -} -func (*UnimplementedAPIServer) GetRecord(ctx context.Context, req *GetRecordRequest) (*GetRecordReply, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetRecord not implemented") -} -func (*UnimplementedAPIServer) Subscribe(req *SubscribeRequest, srv API_SubscribeServer) error { - return status.Errorf(codes.Unimplemented, "method Subscribe not implemented") -} - -func RegisterAPIServer(s *grpc.Server, srv APIServer) { - s.RegisterService(&_API_serviceDesc, srv) -} - -func _API_GetHostID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetHostIDRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(APIServer).GetHostID(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/threads.net.pb.API/GetHostID", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(APIServer).GetHostID(ctx, req.(*GetHostIDRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _API_GetToken_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(APIServer).GetToken(&aPIGetTokenServer{stream}) -} - -type API_GetTokenServer interface { - Send(*GetTokenReply) error - Recv() (*GetTokenRequest, error) - grpc.ServerStream -} - -type aPIGetTokenServer struct { - grpc.ServerStream -} - -func (x *aPIGetTokenServer) Send(m *GetTokenReply) error { - return x.ServerStream.SendMsg(m) -} - -func (x *aPIGetTokenServer) Recv() (*GetTokenRequest, error) { - m := new(GetTokenRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _API_CreateThread_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateThreadRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(APIServer).CreateThread(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/threads.net.pb.API/CreateThread", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(APIServer).CreateThread(ctx, req.(*CreateThreadRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _API_AddThread_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AddThreadRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(APIServer).AddThread(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/threads.net.pb.API/AddThread", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(APIServer).AddThread(ctx, req.(*AddThreadRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _API_GetThread_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetThreadRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(APIServer).GetThread(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/threads.net.pb.API/GetThread", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(APIServer).GetThread(ctx, req.(*GetThreadRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _API_PullThread_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PullThreadRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(APIServer).PullThread(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/threads.net.pb.API/PullThread", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(APIServer).PullThread(ctx, req.(*PullThreadRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _API_DeleteThread_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteThreadRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(APIServer).DeleteThread(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/threads.net.pb.API/DeleteThread", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(APIServer).DeleteThread(ctx, req.(*DeleteThreadRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _API_AddReplicator_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AddReplicatorRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(APIServer).AddReplicator(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/threads.net.pb.API/AddReplicator", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(APIServer).AddReplicator(ctx, req.(*AddReplicatorRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _API_CreateRecord_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateRecordRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(APIServer).CreateRecord(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/threads.net.pb.API/CreateRecord", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(APIServer).CreateRecord(ctx, req.(*CreateRecordRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _API_AddRecord_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AddRecordRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(APIServer).AddRecord(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/threads.net.pb.API/AddRecord", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(APIServer).AddRecord(ctx, req.(*AddRecordRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _API_GetRecord_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetRecordRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(APIServer).GetRecord(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/threads.net.pb.API/GetRecord", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(APIServer).GetRecord(ctx, req.(*GetRecordRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _API_Subscribe_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(SubscribeRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(APIServer).Subscribe(m, &aPISubscribeServer{stream}) -} - -type API_SubscribeServer interface { - Send(*NewRecordReply) error - grpc.ServerStream -} - -type aPISubscribeServer struct { - grpc.ServerStream -} - -func (x *aPISubscribeServer) Send(m *NewRecordReply) error { - return x.ServerStream.SendMsg(m) -} - -var _API_serviceDesc = grpc.ServiceDesc{ - ServiceName: "threads.net.pb.API", - HandlerType: (*APIServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetHostID", - Handler: _API_GetHostID_Handler, - }, - { - MethodName: "CreateThread", - Handler: _API_CreateThread_Handler, - }, - { - MethodName: "AddThread", - Handler: _API_AddThread_Handler, - }, - { - MethodName: "GetThread", - Handler: _API_GetThread_Handler, - }, - { - MethodName: "PullThread", - Handler: _API_PullThread_Handler, - }, - { - MethodName: "DeleteThread", - Handler: _API_DeleteThread_Handler, - }, - { - MethodName: "AddReplicator", - Handler: _API_AddReplicator_Handler, - }, - { - MethodName: "CreateRecord", - Handler: _API_CreateRecord_Handler, - }, - { - MethodName: "AddRecord", - Handler: _API_AddRecord_Handler, - }, - { - MethodName: "GetRecord", - Handler: _API_GetRecord_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "GetToken", - Handler: _API_GetToken_Handler, - ServerStreams: true, - ClientStreams: true, - }, - { - StreamName: "Subscribe", - Handler: _API_Subscribe_Handler, - ServerStreams: true, - }, - }, - Metadata: "threadsnet.proto", -} diff --git a/net/api/service.go b/net/api/service.go index bbf6329e..6aff0229 100644 --- a/net/api/service.go +++ b/net/api/service.go @@ -2,16 +2,18 @@ package api import ( "context" + "encoding/json" "fmt" "github.com/ipfs/go-cid" cbornode "github.com/ipfs/go-ipld-cbor" - logging "github.com/ipfs/go-log" + logging "github.com/ipfs/go-log/v2" "github.com/libp2p/go-libp2p-core/crypto" "github.com/libp2p/go-libp2p-core/peer" ma "github.com/multiformats/go-multiaddr" mh "github.com/multiformats/go-multihash" "github.com/textileio/go-threads/cbor" + d "github.com/textileio/go-threads/core/did" "github.com/textileio/go-threads/core/net" "github.com/textileio/go-threads/core/thread" pb "github.com/textileio/go-threads/net/api/pb" @@ -21,9 +23,7 @@ import ( "google.golang.org/grpc/status" ) -var ( - log = logging.Logger("netapi") -) +var log = logging.Logger("threads/net/api") // Service is a gRPC service for a thread network. type Service struct { @@ -40,7 +40,7 @@ func NewService(network net.Net, conf Config) (*Service, error) { var err error if conf.Debug { err = tutil.SetLogLevels(map[string]logging.LogLevel{ - "netapi": logging.LevelDebug, + "threads/net/api": logging.LevelDebug, }) if err != nil { return nil, err @@ -49,109 +49,37 @@ func NewService(network net.Net, conf Config) (*Service, error) { return &Service{net: network}, nil } -func (s *Service) GetHostID(_ context.Context, _ *pb.GetHostIDRequest) (*pb.GetHostIDReply, error) { - log.Debugf("received get host ID request") - - return &pb.GetHostIDReply{ - PeerID: marshalPeerID(s.net.Host().ID()), - }, nil -} - -type remoteIdentity struct { - pk thread.PubKey - server pb.API_GetTokenServer -} - -func (i *remoteIdentity) MarshalBinary() ([]byte, error) { - return nil, nil -} - -func (i *remoteIdentity) UnmarshalBinary([]byte) error { - return nil -} +func (s *Service) GetServices(ctx context.Context, _ *pb.GetServicesRequest) (*pb.GetServicesReply, error) { + log.Debugf("received get services request") -func (i *remoteIdentity) Sign(ctx context.Context, msg []byte) ([]byte, error) { - if err := i.server.Send(&pb.GetTokenReply{ - Payload: &pb.GetTokenReply_Challenge{ - Challenge: msg, - }, - }); err != nil { + doc, err := s.net.GetServices(ctx) + if err != nil { return nil, err } - - var req *pb.GetTokenRequest - done := make(chan error) - go func() { - defer close(done) - var err error - req, err = i.server.Recv() - if err != nil { - done <- err - return - } - }() - select { - case <-ctx.Done(): - return nil, status.Error(codes.DeadlineExceeded, "Challenge deadline exceeded") - case err, ok := <-done: - if ok { - return nil, err - } - } - - var sig []byte - switch payload := req.Payload.(type) { - case *pb.GetTokenRequest_Signature: - sig = payload.Signature - default: - return nil, status.Error(codes.InvalidArgument, "Signature is required") + docb, err := json.Marshal(doc) + if err != nil { + return nil, err } - return sig, nil -} - -func (i *remoteIdentity) GetPublic() thread.PubKey { - return i.pk -} - -func (i *remoteIdentity) Decrypt(context.Context, []byte) ([]byte, error) { - return nil, nil // no-op -} - -func (i *remoteIdentity) Equals(thread.Identity) bool { - return false + return &pb.GetServicesReply{ + Doc: docb, + }, nil } -func (s *Service) GetToken(server pb.API_GetTokenServer) error { - log.Debugf("received get token request") +func (s *Service) ValidateIdentity(ctx context.Context, req *pb.ValidateIdentityRequest) (*pb.ValidateIdentityReply, error) { + log.Debugf("received validate request") - req, err := server.Recv() + pk, did, err := s.net.ValidateIdentity(ctx, d.Token(req.Identity)) if err != nil { - return err - } - key := &thread.Libp2pPubKey{} - switch payload := req.Payload.(type) { - case *pb.GetTokenRequest_Key: - err = key.UnmarshalString(payload.Key) - if err != nil { - return err - } - default: - return status.Error(codes.InvalidArgument, "Key is required") - } - - identity := &remoteIdentity{ - pk: key, - server: server, + return nil, err } - tok, err := s.net.GetToken(server.Context(), identity) + pkb, err := pk.MarshalBinary() if err != nil { - return err + return nil, err } - return server.Send(&pb.GetTokenReply{ - Payload: &pb.GetTokenReply_Token{ - Token: string(tok), - }, - }) + return &pb.ValidateIdentityReply{ + PubKey: pkb, + Did: string(did), + }, nil } func (s *Service) CreateThread(ctx context.Context, req *pb.CreateThreadRequest) (*pb.ThreadInfoReply, error) { @@ -165,7 +93,7 @@ func (s *Service) CreateThread(ctx context.Context, req *pb.CreateThreadRequest) if err != nil { return nil, status.Error(codes.InvalidArgument, err.Error()) } - token, err := thread.NewTokenFromMD(ctx) + token, err := d.NewTokenFromMD(ctx) if err != nil { return nil, err } @@ -188,7 +116,7 @@ func (s *Service) AddThread(ctx context.Context, req *pb.AddThreadRequest) (*pb. if err != nil { return nil, status.Error(codes.InvalidArgument, err.Error()) } - token, err := thread.NewTokenFromMD(ctx) + token, err := d.NewTokenFromMD(ctx) if err != nil { return nil, err } @@ -212,7 +140,7 @@ func (s *Service) GetThread(ctx context.Context, req *pb.GetThreadRequest) (*pb. if err != nil { return nil, status.Error(codes.InvalidArgument, err.Error()) } - token, err := thread.NewTokenFromMD(ctx) + token, err := d.NewTokenFromMD(ctx) if err != nil { return nil, err } @@ -230,7 +158,7 @@ func (s *Service) PullThread(ctx context.Context, req *pb.PullThreadRequest) (*p if err != nil { return nil, status.Error(codes.InvalidArgument, err.Error()) } - token, err := thread.NewTokenFromMD(ctx) + token, err := d.NewTokenFromMD(ctx) if err != nil { return nil, err } @@ -247,7 +175,7 @@ func (s *Service) DeleteThread(ctx context.Context, req *pb.DeleteThreadRequest) if err != nil { return nil, status.Error(codes.InvalidArgument, err.Error()) } - token, err := thread.NewTokenFromMD(ctx) + token, err := d.NewTokenFromMD(ctx) if err != nil { return nil, err } @@ -268,7 +196,7 @@ func (s *Service) AddReplicator(ctx context.Context, req *pb.AddReplicatorReques if err != nil { return nil, status.Error(codes.InvalidArgument, err.Error()) } - token, err := thread.NewTokenFromMD(ctx) + token, err := d.NewTokenFromMD(ctx) if err != nil { return nil, err } @@ -292,7 +220,7 @@ func (s *Service) CreateRecord(ctx context.Context, req *pb.CreateRecordRequest) if err != nil { return nil, status.Error(codes.InvalidArgument, err.Error()) } - token, err := thread.NewTokenFromMD(ctx) + token, err := d.NewTokenFromMD(ctx) if err != nil { return nil, err } @@ -318,7 +246,7 @@ func (s *Service) AddRecord(ctx context.Context, req *pb.AddRecordRequest) (*pb. if err != nil { return nil, status.Error(codes.InvalidArgument, err.Error()) } - token, err := thread.NewTokenFromMD(ctx) + token, err := d.NewTokenFromMD(ctx) if err != nil { return nil, err } @@ -351,7 +279,7 @@ func (s *Service) GetRecord(ctx context.Context, req *pb.GetRecordRequest) (*pb. if err != nil { return nil, status.Error(codes.InvalidArgument, err.Error()) } - token, err := thread.NewTokenFromMD(ctx) + token, err := d.NewTokenFromMD(ctx) if err != nil { return nil, err } @@ -368,7 +296,7 @@ func (s *Service) GetRecord(ctx context.Context, req *pb.GetRecordRequest) (*pb. }, nil } -func (s *Service) Subscribe(req *pb.SubscribeRequest, server pb.API_SubscribeServer) error { +func (s *Service) Subscribe(req *pb.SubscribeRequest, server pb.APIService_SubscribeServer) error { log.Debugf("received subscribe request") opts := make([]net.SubOption, len(req.ThreadIDs)) @@ -380,7 +308,7 @@ func (s *Service) Subscribe(req *pb.SubscribeRequest, server pb.API_SubscribeSer opts[i] = net.WithSubFilter(id) } - token, err := thread.NewTokenFromMD(server.Context()) + token, err := d.NewTokenFromMD(server.Context()) if err != nil { return err } diff --git a/net/net.go b/net/net.go index 50953fbf..6553feb0 100644 --- a/net/net.go +++ b/net/net.go @@ -13,20 +13,22 @@ import ( "github.com/ipfs/go-cid" bs "github.com/ipfs/go-ipfs-blockstore" format "github.com/ipfs/go-ipld-format" - logging "github.com/ipfs/go-log" + logging "github.com/ipfs/go-log/v2" "github.com/libp2p/go-libp2p-core/crypto" "github.com/libp2p/go-libp2p-core/host" "github.com/libp2p/go-libp2p-core/peer" pstore "github.com/libp2p/go-libp2p-core/peerstore" gostream "github.com/libp2p/go-libp2p-gostream" - ma "github.com/multiformats/go-multiaddr" + maddr "github.com/multiformats/go-multiaddr" "github.com/textileio/go-threads/broadcast" "github.com/textileio/go-threads/cbor" "github.com/textileio/go-threads/core/app" + "github.com/textileio/go-threads/core/did" lstore "github.com/textileio/go-threads/core/logstore" core "github.com/textileio/go-threads/core/net" "github.com/textileio/go-threads/core/thread" sym "github.com/textileio/go-threads/crypto/symmetric" + "github.com/textileio/go-threads/did/registry" pb "github.com/textileio/go-threads/net/pb" "github.com/textileio/go-threads/net/util" tu "github.com/textileio/go-threads/util" @@ -34,7 +36,7 @@ import ( ) var ( - log = logging.Logger("net") + log = logging.Logger("threads/net") // MaxPullLimit is the maximum page size for pulling records. MaxPullLimit = 10000 @@ -53,12 +55,6 @@ var ( // notifyTimeout is the duration to wait for a subscriber to read a new record. notifyTimeout = time.Second * 5 - - // tokenChallengeBytes is the byte length of token challenges. - tokenChallengeBytes = 32 - - // tokenChallengeTimeout is the duration of time given to an identity to complete a token challenge. - tokenChallengeTimeout = time.Minute ) var ( @@ -88,6 +84,8 @@ type net struct { store lstore.Logstore + registry *registry.Registry + rpc *grpc.Server server *server bus *broadcast.Broadcaster @@ -114,6 +112,7 @@ func NewNetwork( bstore bs.Blockstore, ds format.DAGService, ls lstore.Logstore, + reg *registry.Registry, conf Config, serverOptions []grpc.ServerOption, dialOptions []grpc.DialOption, @@ -121,19 +120,20 @@ func NewNetwork( var err error if conf.Debug { if err = tu.SetLogLevels(map[string]logging.LogLevel{ - "net": logging.LevelDebug, - "logstore": logging.LevelDebug, + "threads/net": logging.LevelDebug, + "threads/logstore": logging.LevelDebug, }); err != nil { return nil, err } } ctx, cancel := context.WithCancel(ctx) - t := &net{ + n := &net{ DAGService: ds, host: h, bstore: bstore, store: ls, + registry: reg, rpc: grpc.NewServer(serverOptions...), bus: broadcast.NewBroadcaster(EventBusCapacity), connectors: make(map[thread.ID]*app.Connector), @@ -142,7 +142,7 @@ func NewNetwork( semaphores: util.NewSemaphorePool(1), } - t.server, err = newServer(t, conf.PubSub, dialOptions...) + n.server, err = newServer(n, conf.PubSub, dialOptions...) if err != nil { return nil, err } @@ -152,14 +152,14 @@ func NewNetwork( return nil, err } go func() { - pb.RegisterServiceServer(t.rpc, t.server) - if err := t.rpc.Serve(listener); err != nil && !errors.Is(err, grpc.ErrServerStopped) { + pb.RegisterServiceServer(n.rpc, n.server) + if err := n.rpc.Serve(listener); err != nil && !errors.Is(err, grpc.ErrServerStopped) { log.Fatalf("serve error: %v", err) } }() - go t.startPulling() - return t, nil + go n.startPulling() + return n, nil } func (n *net) Close() (err error) { @@ -196,38 +196,70 @@ func (n *net) Close() (err error) { return nil } -func (n *net) Host() host.Host { - return n.host -} - func (n *net) Store() lstore.Logstore { return n.store } -func (n *net) GetHostID(_ context.Context) (peer.ID, error) { - return n.host.ID(), nil +func (n *net) Host() host.Host { + return n.host +} + +func (n *net) Registry() *registry.Registry { + return n.registry } -func (n *net) GetToken(ctx context.Context, identity thread.Identity) (tok thread.Token, err error) { - msg := make([]byte, tokenChallengeBytes) - if _, err = rand.Read(msg); err != nil { - return +func (n *net) GetServices(_ context.Context) (doc did.Document, err error) { + identity := &thread.Libp2pIdentity{ + PrivKey: n.host.Peerstore().PrivKey(n.host.ID()), } - sctx, cancel := context.WithTimeout(ctx, tokenChallengeTimeout) - defer cancel() - sig, err := identity.Sign(sctx, msg) + id, err := identity.GetPublic().DID() if err != nil { - return + return doc, err } - key := identity.GetPublic() - if ok, err := key.Verify(msg, sig); !ok || err != nil { - return tok, fmt.Errorf("bad signature") + + pc, err := maddr.NewComponent(maddr.ProtocolWithCode(maddr.P_P2P).Name, n.host.ID().String()) + if err != nil { + return doc, err + } + services := []did.Service{ + { + ID: id + "#threads", + Type: "ThreadService", + ServiceEndpoint: pc.String(), + ServiceProtocol: string(thread.Protocol), + }, + } + return did.Document{ + Context: []string{ + "https://www.w3.org/ns/did/v1", + }, + ID: id, + Conroller: []did.DID{ + id, + }, + Authentication: []did.VerificationMethod{ + { + ID: id + "#keys-1", + Type: "Ed25519VerificationKey2018", + Controller: id, + PublicKeyMultiBase: identity.GetPublic().String(), + }, + }, + Services: services, + }, nil +} + +func (n *net) ValidateIdentity(_ context.Context, token did.Token) (thread.PubKey, did.DID, error) { + npk := thread.NewLibp2pPubKey(n.host.Peerstore().PubKey(n.host.ID())) + pk, doc, err := npk.Validate(token) + if err != nil { + return nil, "", err } - return thread.NewToken(n.getPrivKey(), key) + return pk, doc.ID, nil } func (n *net) CreateThread( - _ context.Context, + ctx context.Context, id thread.ID, opts ...core.NewThreadOption, ) (info thread.Info, err error) { @@ -235,18 +267,14 @@ func (n *net) CreateThread( for _, opt := range opts { opt(args) } - // @todo: Check identity key against ACL. - identity, err := n.Validate(id, args.Token, false) + + pk, identity, err := n.ValidateIdentity(ctx, args.Token) if err != nil { return } - if identity != nil { - log.Debugf("creating thread with identity: %s", identity) - } else { - identity = thread.NewLibp2pPubKey(n.getPrivKey().GetPublic()) - } + log.Debugf("creating thread with identity: %s", identity) - if err = n.ensureUniqueLog(id, args.LogKey, identity); err != nil { + if err = n.ensureUniqueLog(id, args.LogKey, pk); err != nil { return } @@ -260,7 +288,7 @@ func (n *net) CreateThread( if err = n.store.AddThread(info); err != nil { return } - if _, err = n.createLog(id, args.LogKey, identity); err != nil { + if _, err = n.createLog(id, args.LogKey, pk); err != nil { return } if n.server.ps != nil { @@ -273,7 +301,7 @@ func (n *net) CreateThread( func (n *net) AddThread( ctx context.Context, - addr ma.Multiaddr, + addr maddr.Multiaddr, opts ...core.NewThreadOption, ) (info thread.Info, err error) { args := &core.NewThreadOptions{} @@ -285,21 +313,19 @@ func (n *net) AddThread( if err != nil { return } - identity, err := n.Validate(id, args.Token, false) + + // @todo: Check read access against thread did. + pk, identity, err := n.ValidateIdentity(ctx, args.Token) if err != nil { return } - if identity != nil { - log.Debugf("adding thread with identity: %s", identity) - } else { - identity = thread.NewLibp2pPubKey(n.getPrivKey().GetPublic()) - } + log.Debugf("adding thread with identity: %s", identity) - if err = n.ensureUniqueLog(id, args.LogKey, identity); err != nil { + if err = n.ensureUniqueLog(id, args.LogKey, pk); err != nil { return } - threadComp, err := ma.NewComponent(thread.Name, id.String()) + threadComp, err := maddr.NewComponent(thread.ProtocolName, id.String()) if err != nil { return } @@ -327,7 +353,7 @@ func (n *net) AddThread( return } if args.ThreadKey.CanRead() || args.LogKey != nil { - if _, err = n.createLog(id, args.LogKey, identity); err != nil { + if _, err = n.createLog(id, args.LogKey, pk); err != nil { return } } @@ -356,40 +382,40 @@ func (n *net) AddThread( return n.getThreadWithAddrs(id) } -func (n *net) GetThread(_ context.Context, id thread.ID, opts ...core.ThreadOption) (info thread.Info, err error) { +func (n *net) GetThread(ctx context.Context, id thread.ID, opts ...core.ThreadOption) (info thread.Info, err error) { args := &core.ThreadOptions{} for _, opt := range opts { opt(args) } - if _, err = n.Validate(id, args.Token, true); err != nil { + + // @todo: Check read access against thread did. + if _, _, err = n.ValidateIdentity(ctx, args.Token); err != nil { return } + return n.getThreadWithAddrs(id) } func (n *net) getThreadWithAddrs(id thread.ID) (info thread.Info, err error) { - var tinfo thread.Info - var peerID *ma.Component - var threadID *ma.Component - tinfo, err = n.store.GetThread(id) + info, err = n.store.GetThread(id) if err != nil { return } - peerID, err = ma.NewComponent("p2p", n.host.ID().String()) + pc, err := maddr.NewComponent(maddr.ProtocolWithCode(maddr.P_P2P).Name, n.host.ID().String()) if err != nil { return } - threadID, err = ma.NewComponent("thread", tinfo.ID.String()) + tc, err := maddr.NewComponent(thread.ProtocolName, info.ID.String()) if err != nil { return } addrs := n.host.Addrs() - res := make([]ma.Multiaddr, len(addrs)) + res := make([]maddr.Multiaddr, len(addrs)) for i := range addrs { - res[i] = addrs[i].Encapsulate(peerID).Encapsulate(threadID) + res[i] = addrs[i].Encapsulate(pc).Encapsulate(tc) } - tinfo.Addrs = res - return tinfo, nil + info.Addrs = res + return info, nil } func (n *net) PullThread(ctx context.Context, id thread.ID, opts ...core.ThreadOption) error { @@ -397,9 +423,12 @@ func (n *net) PullThread(ctx context.Context, id thread.ID, opts ...core.ThreadO for _, opt := range opts { opt(args) } - if _, err := n.Validate(id, args.Token, true); err != nil { + + // @todo: Check read access against thread did. + if _, _, err := n.ValidateIdentity(ctx, args.Token); err != nil { return err } + return n.pullThread(ctx, id) } @@ -440,9 +469,12 @@ func (n *net) DeleteThread(ctx context.Context, id thread.ID, opts ...core.Threa for _, opt := range opts { opt(args) } - if _, err := n.Validate(id, args.Token, false); err != nil { + + // @todo: Check write access against thread did. + if _, _, err := n.ValidateIdentity(ctx, args.Token); err != nil { return err } + if _, ok := n.getConnectorProtected(id, args.APIToken); !ok { return fmt.Errorf("cannot delete thread: %w", app.ErrThreadInUse) } @@ -491,14 +523,16 @@ func (n *net) deleteThread(ctx context.Context, id thread.ID) error { func (n *net) AddReplicator( ctx context.Context, id thread.ID, - paddr ma.Multiaddr, + paddr maddr.Multiaddr, opts ...core.ThreadOption, ) (pid peer.ID, err error) { args := &core.ThreadOptions{} for _, opt := range opts { opt(args) } - if _, err = n.Validate(id, args.Token, true); err != nil { + + // @todo: Check read access against thread did. + if _, _, err = n.ValidateIdentity(ctx, args.Token); err != nil { return } @@ -508,7 +542,7 @@ func (n *net) AddReplicator( } // Extract peer portion - p2p, err := paddr.ValueForProtocol(ma.P_P2P) + p2p, err := paddr.ValueForProtocol(maddr.P_P2P) if err != nil { return } @@ -518,7 +552,7 @@ func (n *net) AddReplicator( } // Update local addresses - addr, err := ma.NewMultiaddr("/" + ma.ProtocolWithCode(ma.P_P2P).Name + "/" + p2p) + addr, err := maddr.NewMultiaddr("/" + maddr.ProtocolWithCode(maddr.P_P2P).Name + "/" + p2p) if err != nil { return } @@ -539,7 +573,7 @@ func (n *net) AddReplicator( // Check if we're dialing ourselves (regardless of addr) if pid != n.host.ID() { // If not, update peerstore address - var dialable ma.Multiaddr + var dialable maddr.Multiaddr dialable, err = getDialable(paddr) if err == nil { n.host.Peerstore().AddAddr(pid, dialable, pstore.PermanentAddrTTL) @@ -565,7 +599,7 @@ func (n *net) AddReplicator( } // Send the updated log(s) to peers - var addrs []ma.Multiaddr + var addrs []maddr.Multiaddr for _, l := range info.Logs { addrs = append(addrs, l.Addrs...) } @@ -573,7 +607,7 @@ func (n *net) AddReplicator( wg := sync.WaitGroup{} for _, addr := range addrs { wg.Add(1) - go func(addr ma.Multiaddr) { + go func(addr maddr.Multiaddr) { defer wg.Done() pid, ok, err := n.callablePeer(addr) if err != nil { @@ -597,8 +631,8 @@ func (n *net) AddReplicator( } // callablePeer attempts to obtain external peer ID from the multiaddress. -func (n *net) callablePeer(addr ma.Multiaddr) (peer.ID, bool, error) { - p, err := addr.ValueForProtocol(ma.P_P2P) +func (n *net) callablePeer(addr maddr.Multiaddr) (peer.ID, bool, error) { + p, err := addr.ValueForProtocol(maddr.P_P2P) if err != nil { return "", false, err } @@ -615,9 +649,9 @@ func (n *net) callablePeer(addr ma.Multiaddr) (peer.ID, bool, error) { return pid, true, nil } -func getDialable(addr ma.Multiaddr) (ma.Multiaddr, error) { - parts := strings.Split(addr.String(), "/"+ma.ProtocolWithCode(ma.P_P2P).Name) - return ma.NewMultiaddr(parts[0]) +func getDialable(addr maddr.Multiaddr) (maddr.Multiaddr, error) { + parts := strings.Split(addr.String(), "/"+maddr.ProtocolWithCode(maddr.P_P2P).Name) + return maddr.NewMultiaddr(parts[0]) } func (n *net) CreateRecord( @@ -630,13 +664,12 @@ func (n *net) CreateRecord( for _, opt := range opts { opt(args) } - identity, err := n.Validate(id, args.Token, false) + + // @todo: Check write access against thread did. + pk, identity, err := n.ValidateIdentity(ctx, args.Token) if err != nil { return } - if identity == nil { - identity = thread.NewLibp2pPubKey(n.getPrivKey().GetPublic()) - } con, ok := n.getConnectorProtected(id, args.APIToken) if !ok { return nil, fmt.Errorf("cannot create record: %w", app.ErrThreadInUse) @@ -646,11 +679,11 @@ func (n *net) CreateRecord( } } - lg, err := n.getOrCreateLog(id, identity) + lg, err := n.getOrCreateLog(id, pk) if err != nil { return } - r, err := n.newRecord(ctx, id, lg, body, identity) + r, err := n.newRecord(ctx, id, lg, body, pk) if err != nil { return } @@ -679,7 +712,9 @@ func (n *net) AddRecord( for _, opt := range opts { opt(args) } - if _, err := n.Validate(id, args.Token, false); err != nil { + + // @todo: Check write access against thread did. + if _, _, err := n.ValidateIdentity(ctx, args.Token); err != nil { return err } @@ -716,9 +751,12 @@ func (n *net) GetRecord( for _, opt := range opts { opt(args) } - if _, err := n.Validate(id, args.Token, true); err != nil { + + // @todo: Check read access against thread did. + if _, _, err := n.ValidateIdentity(ctx, args.Token); err != nil { return nil, err } + return n.getRecord(ctx, id, rid) } @@ -769,9 +807,12 @@ func (n *net) Subscribe(ctx context.Context, opts ...core.SubOption) (<-chan cor return nil, err } if id.Defined() { - if _, err := n.Validate(id, args.Token, true); err != nil { + + // @todo: Check read access against thread did. + if _, _, err := n.ValidateIdentity(ctx, args.Token); err != nil { return nil, err } + filter[id] = struct{}{} } } @@ -825,14 +866,6 @@ func (n *net) ConnectApp(a app.App, id thread.ID) (*app.Connector, error) { return con, nil } -// @todo: Handle thread ACL checks against ID and readOnly. -func (n *net) Validate(id thread.ID, token thread.Token, readOnly bool) (thread.PubKey, error) { - if err := id.Validate(); err != nil { - return nil, err - } - return token.Validate(n.getPrivKey()) -} - func (n *net) addConnector(id thread.ID, conn *app.Connector) { n.connLock.Lock() n.connectors[id] = conn @@ -1016,7 +1049,7 @@ func (n *net) loadUnknownRecords( return nil, head, err } - if err = connector.ValidateNetRecordBody(ctx, dbody, identity); err != nil { + if err = connector.ValidateNetRecordBody(ctx, dbody, did.NewKeyDID("foo")); err != nil { return nil, head, err } } @@ -1243,11 +1276,11 @@ func (n *net) createLog(id thread.ID, key crypto.Key, identity thread.PubKey) (i if err != nil { return } - addr, err := ma.NewMultiaddr("/" + ma.ProtocolWithCode(ma.P_P2P).Name + "/" + n.host.ID().String()) + addr, err := maddr.NewMultiaddr("/" + maddr.ProtocolWithCode(maddr.P_P2P).Name + "/" + n.host.ID().String()) if err != nil { return } - info.Addrs = []ma.Multiaddr{addr} + info.Addrs = []maddr.Multiaddr{addr} // If we're creating the log, we're 'managing' it info.Managed = true @@ -1267,16 +1300,16 @@ func (n *net) createLog(id thread.ID, key crypto.Key, identity thread.PubKey) (i // getOrCreateLog returns a log for identity under the given thread. // If no log exists, a new one is created. -func (n *net) getOrCreateLog(id thread.ID, identity thread.PubKey) (info thread.LogInfo, err error) { - if identity == nil { - identity = thread.NewLibp2pPubKey(n.getPrivKey().GetPublic()) +func (n *net) getOrCreateLog(id thread.ID, pk thread.PubKey) (info thread.LogInfo, err error) { + if pk == nil { + pk = thread.NewLibp2pPubKey(n.getPrivKey().GetPublic()) } - lidb, err := n.store.GetBytes(id, identity.String()) + lidb, err := n.store.GetBytes(id, pk.String()) if err != nil { return info, err } // Check if we have an old-style "own" (unindexed) log - if lidb == nil && identity.Equals(thread.NewLibp2pPubKey(n.getPrivKey().GetPublic())) { + if lidb == nil && pk.Equals(thread.NewLibp2pPubKey(n.getPrivKey().GetPublic())) { thrd, err := n.store.GetThread(id) if err != nil { return info, err @@ -1292,7 +1325,7 @@ func (n *net) getOrCreateLog(id thread.ID, identity thread.PubKey) (info thread. } return n.store.GetLog(id, lid) } - return n.createLog(id, nil, identity) + return n.createLog(id, nil, pk) } // createExternalLogIfNotExist creates an external log if doesn't exists. The created @@ -1302,7 +1335,7 @@ func (n *net) createExternalLogIfNotExist( lid peer.ID, pubKey crypto.PubKey, privKey crypto.PrivKey, - addrs []ma.Multiaddr, + addrs []maddr.Multiaddr, ) error { ts := n.semaphores.Get(semaThreadUpdate(tid)) ts.Acquire() @@ -1389,7 +1422,7 @@ func (n *net) updateRecordsFromLog(tid thread.ID, lid peer.ID) { return } - // TODO after protocol change request only new log + // @todo: After protocol change: only request new log. offsets, err := n.threadOffsets(tid) if err != nil { tps.Release() diff --git a/net/net_test.go b/net/net_test.go index c95920d7..f40a412f 100644 --- a/net/net_test.go +++ b/net/net_test.go @@ -22,29 +22,11 @@ import ( "github.com/textileio/go-threads/core/logstore" core "github.com/textileio/go-threads/core/net" "github.com/textileio/go-threads/core/thread" + "github.com/textileio/go-threads/did/registry" tstore "github.com/textileio/go-threads/logstore/lstoremem" "github.com/textileio/go-threads/util" ) -func TestNet_GetToken(t *testing.T) { - t.Parallel() - n := makeNetwork(t) - defer n.Close() - ctx := context.Background() - - sk, _, err := crypto.GenerateEd25519Key(rand.Reader) - if err != nil { - t.Fatal(err) - } - tok, err := n.GetToken(ctx, thread.NewLibp2pIdentity(sk)) - if err != nil { - t.Fatal(err) - } - if tok == "" { - t.Fatal("bad token") - } -} - func TestNet_CreateRecord(t *testing.T) { t.Parallel() n := makeNetwork(t) @@ -180,7 +162,7 @@ func TestNet_CreateThreadManaged(t *testing.T) { defer n.Close() ctx := context.Background() - info, err := n.CreateThread(ctx, thread.NewIDV1(thread.Raw, 32)) + info, err := n.CreateThread(ctx, thread.NewRandomIDV1()) if err != nil { t.Fatal(err) } @@ -220,7 +202,7 @@ func TestNet_AddThreadManaged(t *testing.T) { n2.Host().Peerstore().AddAddrs(n1.Host().ID(), n1.Host().Addrs(), peerstore.PermanentAddrTTL) ctx := context.Background() - info, err := n1.CreateThread(ctx, thread.NewIDV1(thread.Raw, 32)) + info, err := n1.CreateThread(ctx, thread.NewRandomIDV1()) if err != nil { t.Fatal(err) } @@ -332,7 +314,7 @@ func TestNet_AddReplicatorManaged(t *testing.T) { n2.Host().Peerstore().AddAddrs(n1.Host().ID(), n1.Host().Addrs(), peerstore.PermanentAddrTTL) // Create managed thread - tid := thread.NewIDV1(thread.Raw, 32) + tid := thread.NewRandomIDV1() ctx := context.Background() _, pk, err := crypto.GenerateEd25519Key(rand.Reader) if err != nil { @@ -436,6 +418,13 @@ func makeNetwork(t *testing.T) core.Net { if err != nil { t.Fatal(err) } + + ls := tstore.NewLogstore() + reg, err := registry.NewRegistry(host, ls, ds.NewMapDatastore()) + if err != nil { + t.Fatal(err) + } + bs := bstore.NewBlockstore(syncds.MutexWrap(ds.NewMapDatastore())) bsrv := bserv.New(bs, offline.Exchange(bs)) n, err := NewNetwork( @@ -443,7 +432,8 @@ func makeNetwork(t *testing.T) core.Net { host, bsrv.Blockstore(), dag.NewDAGService(bsrv), - tstore.NewLogstore(), + ls, + reg, Config{ Debug: true, PubSub: true, @@ -455,7 +445,7 @@ func makeNetwork(t *testing.T) core.Net { } func createThread(t *testing.T, ctx context.Context, api core.API) thread.Info { - info, err := api.CreateThread(ctx, thread.NewIDV1(thread.Raw, 32)) + info, err := api.CreateThread(ctx, thread.NewRandomIDV1()) if err != nil { t.Fatal(err) } diff --git a/net/pb/custom.go b/net/pb/custom.go index 1583fbbf..896c628b 100644 --- a/net/pb/custom.go +++ b/net/pb/custom.go @@ -47,7 +47,7 @@ func (id ProtoPeerID) MarshalJSON() ([]byte, error) { } func (id *ProtoPeerID) Unmarshal(data []byte) (err error) { - id.ID = peer.ID(string(data)) + id.ID = peer.ID(data) return nil } @@ -327,7 +327,7 @@ func NewPopulatedProtoCid(_ randyNet) *ProtoCid { // NewPopulatedProtoThreadID generates a populated instance of the custom gogo type ProtoThreadID. // It is required by gogo-generated tests. func NewPopulatedProtoThreadID(_ randyNet) *ProtoThreadID { - id := thread.NewIDV1(thread.Raw, 16) + id := thread.NewRandomIDV1() return &ProtoThreadID{ID: id} } diff --git a/net/pubsub.go b/net/pubsub.go index 9568d730..44c4f78f 100644 --- a/net/pubsub.go +++ b/net/pubsub.go @@ -56,11 +56,15 @@ func (s *PubSub) Add(id thread.ID) error { if err := id.Validate(); err != nil { return err } - pt, err := s.ps.Join(id.String()) + t, err := s.ps.Join(id.String()) if err != nil { return err } - h, err := pt.EventHandler() + h, err := t.EventHandler() + if err != nil { + return err + } + sub, err := t.Subscribe() if err != nil { return err } @@ -70,8 +74,9 @@ func (s *PubSub) Add(id thread.ID) error { ctx, cancel := context.WithCancel(s.ctx) topic := &topic{ - t: pt, + t: t, h: h, + s: sub, cancel: cancel, } s.m[id] = topic @@ -145,15 +150,6 @@ func (s *PubSub) watch(ctx context.Context, id thread.ID, topic *topic) { // subscribe to a topic for thread updates. func (s *PubSub) subscribe(ctx context.Context, id thread.ID, topic *topic) { - var err error - s.Lock() - topic.s, err = topic.t.Subscribe() - s.Unlock() - if err != nil { - log.Errorf("error subscribing to topic %s: %s", id, err) - return - } - for { msg, err := topic.s.Next(ctx) if err != nil { @@ -166,8 +162,7 @@ func (s *PubSub) subscribe(ctx context.Context, id thread.ID, topic *topic) { } else if req == nil { continue } - log.Debugf("received multicast record from %s", from) - + log.Debugf("received multicast record from %s in %s", from, id) s.handler(ctx, req) } } diff --git a/pubsub/pubsub.go b/pubsub/pubsub.go new file mode 100644 index 00000000..0d91c61e --- /dev/null +++ b/pubsub/pubsub.go @@ -0,0 +1,137 @@ +package pubsub + +import ( + "context" + "fmt" + "sync" + + "github.com/libp2p/go-libp2p-core/peer" + pubsub "github.com/libp2p/go-libp2p-pubsub" +) + +// Handler is used to receive topic peer events and messages. +type Handler func(from peer.ID, topic, msg string) + +// Topic provides a nice interface to a libp2p pubsub topic. +type Topic struct { + host peer.ID + eventHandler Handler + messageHandler Handler + + t *pubsub.Topic + h *pubsub.TopicEventHandler + s *pubsub.Subscription + + ctx context.Context + cancel context.CancelFunc + + lk sync.Mutex +} + +// NewTopic returns a new topic for the host. +func NewTopic(ctx context.Context, ps *pubsub.PubSub, host peer.ID, topic string, subscribe bool) (*Topic, error) { + top, err := ps.Join(topic) + if err != nil { + return nil, fmt.Errorf("joining topic: %v", err) + } + + handler, err := top.EventHandler() + if err != nil { + return nil, fmt.Errorf("getting topic handler: %v", err) + } + + var sub *pubsub.Subscription + if subscribe { + sub, err = top.Subscribe() + if err != nil { + return nil, fmt.Errorf("subscribing to topic: %v", err) + } + } + + t := &Topic{ + host: host, + t: top, + h: handler, + s: sub, + } + t.ctx, t.cancel = context.WithCancel(ctx) + + go t.watch() + if t.s != nil { + go t.listen() + } + return t, nil +} + +// Close the topic. +func (t *Topic) Close() error { + t.lk.Lock() + defer t.lk.Unlock() + t.h.Cancel() + if t.s != nil { + t.s.Cancel() + } + if err := t.t.Close(); err != nil { + return err + } + t.cancel() + return nil +} + +// SetEventHandler sets a handler func that will be called with peer events. +func (t *Topic) SetEventHandler(handler Handler) { + t.lk.Lock() + defer t.lk.Unlock() + t.eventHandler = handler +} + +// SetMessageHandler sets a handler func that will be called with topic messages. +// A subscription is required for the handler to be called. +func (t *Topic) SetMessageHandler(handler Handler) { + t.lk.Lock() + defer t.lk.Unlock() + t.messageHandler = handler +} + +// Publish data. +func (t *Topic) Publish(ctx context.Context, data []byte, opts ...pubsub.PubOpt) error { + return t.t.Publish(ctx, data, opts...) +} + +func (t *Topic) watch() { + for { + e, err := t.h.NextPeerEvent(t.ctx) + if err != nil { + break + } + var msg string + switch e.Type { + case pubsub.PeerJoin: + msg = "JOINED" + case pubsub.PeerLeave: + msg = "LEFT" + } + t.lk.Lock() + if t.eventHandler != nil { + t.eventHandler(e.Peer, t.t.String(), msg) + } + t.lk.Unlock() + } +} + +func (t *Topic) listen() { + for { + msg, err := t.s.Next(t.ctx) + if err != nil { + break + } + if msg.ReceivedFrom.String() == t.host.String() { + continue + } + t.lk.Lock() + if t.messageHandler != nil { + t.messageHandler(msg.ReceivedFrom, t.t.String(), string(msg.Data)) + } + t.lk.Unlock() + } +} diff --git a/scripts/gen_js_protos.bash b/scripts/gen_js_protos.bash new file mode 100755 index 00000000..697cd940 --- /dev/null +++ b/scripts/gen_js_protos.bash @@ -0,0 +1,30 @@ +#!/bin/bash +set -eo pipefail + +wd="$(pwd -P)" + +js_paths=() +while IFS= read -r -d $'\0'; do + js_paths+=("$REPLY") +done < <(find . -path "*/pb/javascript" ! -path "*/node_modules/*" -print0) + +echo installing dependencies +for path in "${js_paths[@]}"; do + cd "${path}" && npm install >/dev/null 2>&1 && cd "${wd}" +done + +echo generating js-protos in api/pb/javascript +./buildtools/protoc/bin/protoc \ + --proto_path=. \ + --plugin=protoc-gen-ts=api/pb/javascript/node_modules/.bin/protoc-gen-ts \ + --js_out=import_style=commonjs,binary:api/pb/javascript \ + --ts_out=service=grpc-web:api/pb/javascript \ + api/pb/threaddb.proto + +echo generating js-protos in net/api/pb/javascript +./buildtools/protoc/bin/protoc \ + --proto_path=. \ + --plugin=protoc-gen-ts=net/api/pb/javascript/node_modules/.bin/protoc-gen-ts \ + --js_out=import_style=commonjs,binary:net/api/pb/javascript \ + --ts_out=service=grpc-web:net/api/pb/javascript \ + net/api/pb/threads.proto diff --git a/scripts/protoc_gen_plugin.bash b/scripts/protoc_gen_plugin.bash new file mode 100755 index 00000000..ce149554 --- /dev/null +++ b/scripts/protoc_gen_plugin.bash @@ -0,0 +1,90 @@ +#!/bin/bash +set -eo pipefail + +# From https://github.com/bufbuild/buf/blob/master/make/go/scripts/protoc_gen_plugin.bash + +fail() { + echo "$@" >&2 + exit 1 +} + +usage() { + echo "usage: ${0} \ + --proto_path=path/to/one \ + --proto_path=path/to/two \ + --proto_include_path=path/to/one \ + --proto_include_path=path/to/two \ + --plugin_name=go \ + --plugin_out=gen/proto/go \ + --plugin_opt=plugins=grpc" +} + +check_flag_value_set() { + if [ -z "${1}" ]; then + usage + exit 1 + fi +} + +PROTO_PATHS=() +PROTO_INCLUDE_PATHS=() +PLUGIN_NAME= +PLUGIN_OUT= +PLUGIN_OPT= +while test $# -gt 0; do + case "${1}" in + -h|--help) + usage + exit 0 + ;; + --proto_path*) + PROTO_PATHS+=("$(echo ${1} | sed -e 's/^[^=]*=//g')") + shift + ;; + --proto_include_path*) + PROTO_INCLUDE_PATHS+=("$(echo ${1} | sed -e 's/^[^=]*=//g')") + shift + ;; + --plugin_name*) + PLUGIN_NAME="$(echo ${1} | sed -e 's/^[^=]*=//g')" + shift + ;; + --plugin_out*) + PLUGIN_OUT="$(echo ${1} | sed -e 's/^[^=]*=//g')" + shift + ;; + --plugin_opt*) + PLUGIN_OPT="$(echo ${1} | sed -e 's/^[^=]*=//g')" + shift + ;; + *) + usage + exit 1 + ;; + esac +done + +check_flag_value_set "${PROTO_PATHS[@]}" +check_flag_value_set "${PLUGIN_NAME}" +check_flag_value_set "${PLUGIN_OUT}" + +PROTOC_FLAGS=() +for proto_path in "${PROTO_PATHS[@]}"; do + PROTOC_FLAGS+=("--proto_path=${proto_path}") +done +for proto_path in "${PROTO_INCLUDE_PATHS[@]}"; do + PROTOC_FLAGS+=("--proto_path=${proto_path}") +done +PROTOC_FLAGS+=("--${PLUGIN_NAME}_out=${PLUGIN_OUT}") +if [ -n "${PLUGIN_OPT}" ]; then + PROTOC_FLAGS+=("--${PLUGIN_NAME}_opt=${PLUGIN_OPT}") +fi + +mkdir -p "${PLUGIN_OUT}" +for proto_path in "${PROTO_PATHS[@]}"; do + echo "${proto_path}" + for dir in $(find "${proto_path}" -type f ! -path './net/pb/*' ! -path './buildtools/*' ! -path '*/node_modules/*' -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq); do + echo protoc "${PROTOC_FLAGS[@]}" "$(find "${dir}" -name '*.proto' ! -path './net/pb/*' ! -path '*/node_modules/*')" + ./buildtools/protoc/bin/protoc "${PROTOC_FLAGS[@]}" "$(find "${dir}" -name '*.proto' ! -path './net/pb/*' ! -path '*/node_modules/*')" + done +done diff --git a/scripts/publish_js_protos.bash b/scripts/publish_js_protos.bash new file mode 100755 index 00000000..0fe56a68 --- /dev/null +++ b/scripts/publish_js_protos.bash @@ -0,0 +1,41 @@ +#!/bin/bash +set -eo pipefail + +tag="latest" + +while getopts v:t:p: option +do +case "${option}" +in +v) version=${OPTARG};; +t) token=${OPTARG};; +p) + if [[ "$OPTARG" == "true" ]]; + then + tag="next" + fi + ;; +esac +done + +[[ -z "$version" ]] && { echo "Please specify a new version, e.g., -v v1.0.0" ; exit 1; } +[[ -z "$token" ]] && { echo "Please specify an NPM auth token, e.g., -t mytoken" ; exit 1; } + +wd="$(pwd -P)" + +js_paths=() +while IFS= read -r -d $'\0'; do + js_paths+=("$REPLY") +done < <(find . -path "*/pb/javascript" ! -path "*/node_modules/*" -print0) + +echo installing dependencies +npm install -g json >/dev/null 2>&1 + +for path in "${js_paths[@]}"; do + cd "${path}" + json -I -f package.json -e "this.version=('$version').replace('v', '')" >/dev/null 2>&1 + echo publishing js-protos in "${path}" with version "${version}" and token "${token}" + NODE_AUTH_TOKEN="${token}" npm publish --access=public --tag ${tag} + json -I -f package.json -e "this.version=('0.0.0')" >/dev/null 2>&1 + cd "${wd}" +done diff --git a/test/addr_book_suite.go b/test/addr_book_suite.go index 48a93b42..eaad9252 100644 --- a/test/addr_book_suite.go +++ b/test/addr_book_suite.go @@ -43,7 +43,7 @@ func AddrBookTest(t *testing.T, factory AddrBookFactory) { func testAddAddress(ab core.AddrBook) func(*testing.T) { return func(t *testing.T) { - tid := thread.NewIDV1(thread.Raw, 24) + tid := thread.NewRandomIDV1() t.Run("add a single address", func(t *testing.T) { id := GeneratePeerIDs(1)[0] @@ -140,7 +140,7 @@ func testAddAddress(ab core.AddrBook) func(*testing.T) { func testClearWorks(ab core.AddrBook) func(t *testing.T) { return func(t *testing.T) { - tid := thread.NewIDV1(thread.Raw, 24) + tid := thread.NewRandomIDV1() ids := GeneratePeerIDs(2) addrs := GenerateAddrs(5) @@ -163,7 +163,7 @@ func testClearWorks(ab core.AddrBook) func(t *testing.T) { func testSetNegativeTTLClears(ab core.AddrBook) func(t *testing.T) { return func(t *testing.T) { - tid := thread.NewIDV1(thread.Raw, 24) + tid := thread.NewRandomIDV1() id := GeneratePeerIDs(1)[0] addrs := GenerateAddrs(100) @@ -185,7 +185,7 @@ func testSetNegativeTTLClears(ab core.AddrBook) func(t *testing.T) { func testUpdateTTLs(ab core.AddrBook) func(t *testing.T) { return func(t *testing.T) { - tid := thread.NewIDV1(thread.Raw, 24) + tid := thread.NewRandomIDV1() t.Run("update ttl of log with no addrs", func(t *testing.T) { id := GeneratePeerIDs(1)[0] @@ -241,7 +241,7 @@ func testUpdateTTLs(ab core.AddrBook) func(t *testing.T) { func testNilAddrsDontBreak(ab core.AddrBook) func(t *testing.T) { return func(t *testing.T) { - tid := thread.NewIDV1(thread.Raw, 24) + tid := thread.NewRandomIDV1() id := GeneratePeerIDs(1)[0] @@ -252,7 +252,7 @@ func testNilAddrsDontBreak(ab core.AddrBook) func(t *testing.T) { func testAddressesExpire(ab core.AddrBook) func(t *testing.T) { return func(t *testing.T) { - tid := thread.NewIDV1(thread.Raw, 24) + tid := thread.NewRandomIDV1() ids := GeneratePeerIDs(2) addrs1 := GenerateAddrs(3) @@ -299,7 +299,7 @@ func testAddressesExpire(ab core.AddrBook) func(t *testing.T) { func testClearWithIterator(ab core.AddrBook) func(t *testing.T) { return func(t *testing.T) { - tid := thread.NewIDV1(thread.Raw, 24) + tid := thread.NewRandomIDV1() ids := GeneratePeerIDs(2) addrs := GenerateAddrs(100) @@ -328,7 +328,7 @@ func testClearWithIterator(ab core.AddrBook) func(t *testing.T) { func testLogsWithAddrs(ab core.AddrBook) func(t *testing.T) { return func(t *testing.T) { - tid := thread.NewIDV1(thread.Raw, 24) + tid := thread.NewRandomIDV1() // cannot run in parallel as the store is modified. // go runs sequentially in the specified order @@ -371,7 +371,7 @@ func testThreadsFromAddrs(ab core.AddrBook) func(t *testing.T) { t.Run("non-empty addrbook", func(t *testing.T) { tids := make([]thread.ID, 3) for i := range tids { - tids[i] = thread.NewIDV1(thread.Raw, 24) + tids[i] = thread.NewRandomIDV1() ids := GeneratePeerIDs(2) addrs := GenerateAddrs(4) @@ -390,7 +390,7 @@ func testThreadsFromAddrs(ab core.AddrBook) func(t *testing.T) { func testExportAddressBook(ab core.AddrBook) func(*testing.T) { return func(t *testing.T) { - tid := thread.NewIDV1(thread.Raw, 24) + tid := thread.NewRandomIDV1() t.Run("dump and restore", func(t *testing.T) { ids := GeneratePeerIDs(2) diff --git a/test/benchmarks_suite.go b/test/benchmarks_suite.go index 48e8ec50..698becf9 100644 --- a/test/benchmarks_suite.go +++ b/test/benchmarks_suite.go @@ -67,7 +67,7 @@ func BenchmarkLogstore(b *testing.B, factory LogstoreFactory, variant string) { func benchmarkAddAddrs(ls core.Logstore, addrs chan *logpair) func(*testing.B) { return func(b *testing.B) { - tid := thread.NewIDV1(thread.Raw, 24) + tid := thread.NewRandomIDV1() b.ResetTimer() for i := 0; i < b.N; i++ { pp := <-addrs @@ -78,7 +78,7 @@ func benchmarkAddAddrs(ls core.Logstore, addrs chan *logpair) func(*testing.B) { func benchmarkSetAddrs(ls core.Logstore, addrs chan *logpair) func(*testing.B) { return func(b *testing.B) { - tid := thread.NewIDV1(thread.Raw, 24) + tid := thread.NewRandomIDV1() b.ResetTimer() for i := 0; i < b.N; i++ { pp := <-addrs @@ -89,7 +89,7 @@ func benchmarkSetAddrs(ls core.Logstore, addrs chan *logpair) func(*testing.B) { func benchmarkGetAddrs(ls core.Logstore, addrs chan *logpair) func(*testing.B) { return func(b *testing.B) { - tid := thread.NewIDV1(thread.Raw, 24) + tid := thread.NewRandomIDV1() pp := <-addrs _ = ls.SetAddrs(tid, pp.ID, pp.Addr, pstore.PermanentAddrTTL) @@ -102,7 +102,7 @@ func benchmarkGetAddrs(ls core.Logstore, addrs chan *logpair) func(*testing.B) { func benchmarkAddGetAndClearAddrs(ls core.Logstore, addrs chan *logpair) func(*testing.B) { return func(b *testing.B) { - tid := thread.NewIDV1(thread.Raw, 24) + tid := thread.NewRandomIDV1() b.ResetTimer() for i := 0; i < b.N; i++ { pp := <-addrs @@ -115,7 +115,7 @@ func benchmarkAddGetAndClearAddrs(ls core.Logstore, addrs chan *logpair) func(*t func benchmarkGet1000LogsWithAddrs(ls core.Logstore, addrs chan *logpair) func(*testing.B) { return func(b *testing.B) { - tid := thread.NewIDV1(thread.Raw, 24) + tid := thread.NewRandomIDV1() var logs = make([]*logpair, 1000) for i := range logs { pp := <-addrs diff --git a/test/headbook_suite.go b/test/headbook_suite.go index c485d4ac..f0ce623d 100644 --- a/test/headbook_suite.go +++ b/test/headbook_suite.go @@ -299,7 +299,7 @@ func benchmarkClearHeads(hb core.HeadBook) func(*testing.B) { func genHeads(numLogs, numHeads int) (thread.ID, map[peer.ID][]cid.Cid) { var ( logs = make(map[peer.ID][]cid.Cid) - tid = thread.NewIDV1(thread.Raw, 32) + tid = thread.NewRandomIDV1() ) for i := 0; i < numLogs; i++ { diff --git a/test/keybook_suite.go b/test/keybook_suite.go index a98bf19e..6fa027ce 100644 --- a/test/keybook_suite.go +++ b/test/keybook_suite.go @@ -47,7 +47,7 @@ func KeyBookTest(t *testing.T, factory KeyBookFactory) { func testKeyBookPrivKey(kb core.KeyBook) func(t *testing.T) { return func(t *testing.T) { - tid := thread.NewIDV1(thread.Raw, 24) + tid := thread.NewRandomIDV1() if logs, err := kb.LogsWithKeys(tid); err != nil || len(logs) > 0 { t.Error("expected logs to be empty on init without erros") @@ -84,7 +84,7 @@ func testKeyBookPrivKey(kb core.KeyBook) func(t *testing.T) { func testKeyBookPubKey(kb core.KeyBook) func(t *testing.T) { return func(t *testing.T) { - tid := thread.NewIDV1(thread.Raw, 24) + tid := thread.NewRandomIDV1() if logs, err := kb.LogsWithKeys(tid); err != nil || len(logs) > 0 { t.Error("expected logs to be empty on init without errors") @@ -121,7 +121,7 @@ func testKeyBookPubKey(kb core.KeyBook) func(t *testing.T) { func testKeyBookReadKey(kb core.KeyBook) func(t *testing.T) { return func(t *testing.T) { - tid := thread.NewIDV1(thread.Raw, 24) + tid := thread.NewRandomIDV1() if logs, err := kb.LogsWithKeys(tid); err != nil || len(logs) > 0 { t.Error("expected logs to be empty on init without errors") @@ -145,7 +145,7 @@ func testKeyBookReadKey(kb core.KeyBook) func(t *testing.T) { func testKeyBookServiceKey(kb core.KeyBook) func(t *testing.T) { return func(t *testing.T) { - tid := thread.NewIDV1(thread.Raw, 24) + tid := thread.NewRandomIDV1() if logs, err := kb.LogsWithKeys(tid); err != nil || len(logs) > 0 { t.Error("expected logs to be empty on init without errors") @@ -169,7 +169,7 @@ func testKeyBookServiceKey(kb core.KeyBook) func(t *testing.T) { func testKeyBookClearKeys(kb core.KeyBook) func(t *testing.T) { return func(t *testing.T) { - tid := thread.NewIDV1(thread.Raw, 24) + tid := thread.NewRandomIDV1() key1, err := sym.NewRandom() if err != nil { @@ -239,7 +239,7 @@ func testKeyBookClearKeys(kb core.KeyBook) func(t *testing.T) { func testKeyBookClearLogKeys(kb core.KeyBook) func(t *testing.T) { return func(t *testing.T) { - tid := thread.NewIDV1(thread.Raw, 24) + tid := thread.NewRandomIDV1() key1, err := sym.NewRandom() if err != nil { @@ -303,7 +303,7 @@ func testKeyBookClearLogKeys(kb core.KeyBook) func(t *testing.T) { func testKeyBookLogs(kb core.KeyBook) func(t *testing.T) { return func(t *testing.T) { - tid := thread.NewIDV1(thread.Raw, 24) + tid := thread.NewRandomIDV1() if logs, err := kb.LogsWithKeys(tid); err != nil || len(logs) > 0 { t.Error("expected logs to be empty on init without errors") @@ -351,9 +351,9 @@ func testKeyBookThreads(kb core.KeyBook) func(t *testing.T) { } threads := thread.IDSlice{ - thread.NewIDV1(thread.Raw, 16), - thread.NewIDV1(thread.Raw, 24), - thread.NewIDV1(thread.AccessControlled, 32), + thread.NewRandomIDV1(), + thread.NewRandomIDV1(), + thread.NewRandomIDV1(), } rand.Seed(time.Now().Unix()) for i := 0; i < 10; i++ { @@ -394,7 +394,7 @@ func testInlinedPubKeyAddedOnRetrieve(kb core.KeyBook) func(t *testing.T) { return func(t *testing.T) { t.Skip("key inlining disabled for now: see libp2p/specs#111") - tid := thread.NewIDV1(thread.Raw, 24) + tid := thread.NewRandomIDV1() if logs, err := kb.LogsWithKeys(tid); err != nil || len(logs) > 0 { t.Error("expected logs to be empty on init without errors") @@ -435,7 +435,7 @@ func testKeyBookExport(kb core.KeyBook) func(t *testing.T) { // generate key set for i := 0; i < numThreads; i++ { - tid := thread.NewIDV1(thread.Raw, 24) + tid := thread.NewRandomIDV1() readKey, err := sym.NewRandom() if err != nil { @@ -571,7 +571,7 @@ func BenchmarkKeyBook(b *testing.B, factory KeyBookFactory) { func benchmarkPubKey(kb core.KeyBook) func(*testing.B) { return func(b *testing.B) { - tid := thread.NewIDV1(thread.Raw, 24) + tid := thread.NewRandomIDV1() _, pub, err := pt.RandTestKeyPair(crypto.RSA, crypto.MinRsaKeyBits) if err != nil { @@ -597,7 +597,7 @@ func benchmarkPubKey(kb core.KeyBook) func(*testing.B) { func benchmarkAddPubKey(kb core.KeyBook) func(*testing.B) { return func(b *testing.B) { - tid := thread.NewIDV1(thread.Raw, 24) + tid := thread.NewRandomIDV1() _, pub, err := pt.RandTestKeyPair(crypto.RSA, crypto.MinRsaKeyBits) if err != nil { @@ -618,7 +618,7 @@ func benchmarkAddPubKey(kb core.KeyBook) func(*testing.B) { func benchmarkPrivKey(kb core.KeyBook) func(*testing.B) { return func(b *testing.B) { - tid := thread.NewIDV1(thread.Raw, 24) + tid := thread.NewRandomIDV1() priv, _, err := pt.RandTestKeyPair(crypto.RSA, crypto.MinRsaKeyBits) if err != nil { @@ -644,7 +644,7 @@ func benchmarkPrivKey(kb core.KeyBook) func(*testing.B) { func benchmarkAddPrivKey(kb core.KeyBook) func(*testing.B) { return func(b *testing.B) { - tid := thread.NewIDV1(thread.Raw, 24) + tid := thread.NewRandomIDV1() priv, _, err := pt.RandTestKeyPair(crypto.RSA, crypto.MinRsaKeyBits) if err != nil { @@ -665,7 +665,7 @@ func benchmarkAddPrivKey(kb core.KeyBook) func(*testing.B) { func benchmarkLogsWithKeys(kb core.KeyBook) func(*testing.B) { return func(b *testing.B) { - tid := thread.NewIDV1(thread.Raw, 24) + tid := thread.NewRandomIDV1() for i := 0; i < 10; i++ { priv, pub, err := pt.RandTestKeyPair(crypto.RSA, crypto.MinRsaKeyBits) if err != nil { diff --git a/test/logstore_suite.go b/test/logstore_suite.go index aa86ccad..191452b3 100644 --- a/test/logstore_suite.go +++ b/test/logstore_suite.go @@ -43,7 +43,7 @@ func LogstoreTest(t *testing.T, factory LogstoreFactory) { func testAddrStream(ls core.Logstore) func(t *testing.T) { return func(t *testing.T) { - tid := thread.NewIDV1(thread.Raw, 24) + tid := thread.NewRandomIDV1() addrs, pid := getAddrs(t, 100), peer.ID("testlog") err := ls.AddAddrs(tid, pid, addrs[:10], time.Hour) @@ -129,7 +129,7 @@ func testAddrStream(ls core.Logstore) func(t *testing.T) { func testGetStreamBeforeLogAdded(ls core.Logstore) func(t *testing.T) { return func(t *testing.T) { - tid := thread.NewIDV1(thread.Raw, 24) + tid := thread.NewRandomIDV1() addrs, pid := getAddrs(t, 10), peer.ID("testlog") @@ -184,7 +184,7 @@ func testGetStreamBeforeLogAdded(ls core.Logstore) func(t *testing.T) { func testAddrStreamDuplicates(ls core.Logstore) func(t *testing.T) { return func(t *testing.T) { - tid := thread.NewIDV1(thread.Raw, 24) + tid := thread.NewRandomIDV1() addrs, pid := getAddrs(t, 10), peer.ID("testlog") @@ -233,7 +233,7 @@ func testBasicLogstore(ls core.Logstore) func(t *testing.T) { addrs := getAddrs(t, 10) for _, a := range addrs { - tid := thread.NewIDV1(thread.Raw, 24) + tid := thread.NewRandomIDV1() tids = append(tids, tid) err := ls.AddServiceKey(tid, sym.New()) check(t, err) @@ -272,7 +272,7 @@ func testBasicLogstore(ls core.Logstore) func(t *testing.T) { } // Test add entire log - tid := thread.NewIDV1(thread.Raw, 24) + tid := thread.NewRandomIDV1() priv, pub, _ := crypto.GenerateKeyPair(crypto.RSA, crypto.MinRsaKeyBits) p, _ := peer.IDFromPrivateKey(priv) err = ls.AddLog(tid, thread.LogInfo{ @@ -313,7 +313,7 @@ func testBasicLogstore(ls core.Logstore) func(t *testing.T) { func testLogstoreManaged(ls core.Logstore) func(t *testing.T) { return func(t *testing.T) { - tid := thread.NewIDV1(thread.Raw, 24) + tid := thread.NewRandomIDV1() addrs := getAddrs(t, 1) err := ls.AddServiceKey(tid, sym.New()) check(t, err) @@ -371,7 +371,7 @@ func testMetadata(ls core.Logstore) func(t *testing.T) { return func(t *testing.T) { tids := make([]thread.ID, 10) for i := range tids { - tids[i] = thread.NewIDV1(thread.Raw, 24) + tids[i] = thread.NewRandomIDV1() } for _, p := range tids { if err := ls.PutString(p, "AgentVersion", "string"); err != nil { diff --git a/test/metadata_suite.go b/test/metadata_suite.go index c6f7b8e4..49f5d78f 100644 --- a/test/metadata_suite.go +++ b/test/metadata_suite.go @@ -42,7 +42,7 @@ func testMetadataBookInt64(mb core.ThreadMetadata) func(*testing.T) { return func(t *testing.T) { t.Run("Put&Get", func(t *testing.T) { t.Parallel() - tid := thread.NewIDV1(thread.Raw, 24) + tid := thread.NewRandomIDV1() key, value := "key1", int64(42) if err := mb.PutInt64(tid, key, value); err != nil { @@ -67,7 +67,7 @@ func testMetadataBookString(mb core.ThreadMetadata) func(*testing.T) { return func(t *testing.T) { t.Run("Put&Get", func(t *testing.T) { t.Parallel() - tid := thread.NewIDV1(thread.Raw, 24) + tid := thread.NewRandomIDV1() key, value := "key1", "textile" if err := mb.PutString(tid, key, value); err != nil { @@ -92,7 +92,7 @@ func testMetadataBookBytes(mb core.ThreadMetadata) func(*testing.T) { return func(t *testing.T) { t.Run("Put&Get", func(t *testing.T) { t.Parallel() - tid := thread.NewIDV1(thread.Raw, 24) + tid := thread.NewRandomIDV1() key, value := "key1", []byte("textile") if err := mb.PutBytes(tid, key, value); err != nil { @@ -111,7 +111,7 @@ func testMetadataBookBytes(mb core.ThreadMetadata) func(*testing.T) { }) t.Run("Immutable Put", func(t *testing.T) { t.Parallel() - tid := thread.NewIDV1(thread.Raw, 24) + tid := thread.NewRandomIDV1() key, value := "key1", []byte("textile") if err := mb.PutBytes(tid, key, value); err != nil { @@ -137,7 +137,7 @@ func testMetadataBookNotFound(mb core.ThreadMetadata) func(*testing.T) { return func(t *testing.T) { t.Run("Int64", func(t *testing.T) { t.Parallel() - tid := thread.NewIDV1(thread.Raw, 24) + tid := thread.NewRandomIDV1() if v, err := mb.GetInt64(tid, "textile"); v != nil || err != nil { t.Fatalf(errStrNotFoundKey) @@ -145,7 +145,7 @@ func testMetadataBookNotFound(mb core.ThreadMetadata) func(*testing.T) { }) t.Run("String", func(t *testing.T) { t.Parallel() - tid := thread.NewIDV1(thread.Raw, 24) + tid := thread.NewRandomIDV1() if v, err := mb.GetInt64(tid, "textile"); v != nil || err != nil { t.Fatalf(errStrNotFoundKey) @@ -153,7 +153,7 @@ func testMetadataBookNotFound(mb core.ThreadMetadata) func(*testing.T) { }) t.Run("Bytes", func(t *testing.T) { t.Parallel() - tid := thread.NewIDV1(thread.Raw, 24) + tid := thread.NewRandomIDV1() if v, err := mb.GetInt64(tid, "textile"); v != nil || err != nil { t.Fatalf(errStrNotFoundKey) @@ -164,7 +164,7 @@ func testMetadataBookNotFound(mb core.ThreadMetadata) func(*testing.T) { func testClearMetadata(mb core.ThreadMetadata) func(*testing.T) { return func(t *testing.T) { - tid := thread.NewIDV1(thread.Raw, 24) + tid := thread.NewRandomIDV1() key, value := "key", []byte("textile") if err := mb.PutBytes(tid, key, value); err != nil { @@ -186,7 +186,7 @@ func testClearMetadata(mb core.ThreadMetadata) func(*testing.T) { func testMetadataBookExport(mb core.ThreadMetadata) func(*testing.T) { return func(t *testing.T) { var ( - tid = thread.NewIDV1(thread.Raw, 24) + tid = thread.NewRandomIDV1() k1, v1 = "k1", int64(123) k2, v2 = "k2", int64(-612) diff --git a/util/dscopy/main.go b/util/dscopy/main.go index e6069bd7..8f7af582 100644 --- a/util/dscopy/main.go +++ b/util/dscopy/main.go @@ -14,7 +14,7 @@ import ( "github.com/ipfs/go-datastore/query" logging "github.com/ipfs/go-log/v2" "github.com/namsral/flag" - badger "github.com/textileio/go-ds-badger" + badger "github.com/textileio/go-ds-badger3" mongods "github.com/textileio/go-ds-mongo" ) diff --git a/util/finalizer.go b/util/finalizer.go index 61835a20..3e706a0a 100644 --- a/util/finalizer.go +++ b/util/finalizer.go @@ -7,11 +7,12 @@ import ( "github.com/hashicorp/go-multierror" ) -// Finalizer collects resources for convenient cleanup. +// NewFinalizer returns a new Finalizer. func NewFinalizer() *Finalizer { return &Finalizer{} } +// Finalizer collects resources for convenient cleanup. type Finalizer struct { resources []io.Closer } @@ -21,15 +22,17 @@ func (r *Finalizer) Add(cs ...io.Closer) { } func (r *Finalizer) Cleanup(err error) error { - // release resources in a reverse order + var errs []error for i := len(r.resources) - 1; i >= 0; i-- { - err = multierror.Append(r.resources[i].Close()) + // release resources in a reverse order + if e := r.resources[i].Close(); e != nil { + errs = append(errs, e) + } } - - return err.(*multierror.Error).ErrorOrNil() + return multierror.Append(err, errs...).ErrorOrNil() } -// Transform context cancellation function to be used with finalizer. +// NewContextCloser transforms context cancellation function to be used with finalizer. func NewContextCloser(cancel context.CancelFunc) io.Closer { return &ContextCloser{cf: cancel} } diff --git a/util/util.go b/util/util.go index b90557ec..96c00d68 100644 --- a/util/util.go +++ b/util/util.go @@ -2,23 +2,19 @@ package util import ( "crypto/rand" - "encoding/json" "fmt" "os" "path/filepath" + "strings" - "github.com/alecthomas/jsonschema" - "github.com/dgraph-io/badger/options" ipfslite "github.com/hsanjuan/ipfs-lite" logging "github.com/ipfs/go-log/v2" "github.com/libp2p/go-libp2p-core/peer" ma "github.com/multiformats/go-multiaddr" - mbase "github.com/multiformats/go-multibase" + "github.com/oklog/ulid/v2" "github.com/phayes/freeport" - badger "github.com/textileio/go-ds-badger" - core "github.com/textileio/go-threads/core/db" + badger "github.com/textileio/go-ds-badger3" kt "github.com/textileio/go-threads/db/keytransform" - "github.com/tidwall/sjson" "go.uber.org/zap/zapcore" ) @@ -28,43 +24,32 @@ var ( "/ip4/40.76.153.74/tcp/4001/p2p/QmR69wtWUMm1TWnmuD4JqC1TWLZcc8iR2KrTenfZZbiztd", // hub-production hub-0 threads host "/ip4/52.186.99.239/tcp/4006/p2p/12D3KooWQEtCBXMKjVas6Ph1pUHG2T4Lc9j1KvnAipojP2xcKU7n", - // go-ipfs 0.7.0 default bootstrap peers - "/dnsaddr/bootstrap.libp2p.io/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN", - "/dnsaddr/bootstrap.libp2p.io/p2p/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa", - "/dnsaddr/bootstrap.libp2p.io/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb", - "/dnsaddr/bootstrap.libp2p.io/p2p/QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt", - "/ip4/104.131.131.82/tcp/4001/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ", - "/ip4/104.131.131.82/udp/4001/quic/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ", } ) // NewBadgerDatastore returns a badger based datastore. -func NewBadgerDatastore(dirPath, name string, lowMem bool) (kt.TxnDatastoreExtended, error) { +func NewBadgerDatastore(dirPath, name string) (kt.TxnDatastoreExtended, error) { path := filepath.Join(dirPath, name) if err := os.MkdirAll(path, os.ModePerm); err != nil { return nil, err } - opts := badger.DefaultOptions - if lowMem { - opts.TableLoadingMode = options.FileIO - } - return badger.NewDatastore(path, &opts) + return badger.NewDatastore(path, &badger.DefaultOptions) } // SetupDefaultLoggingConfig sets up a standard logging configuration. -func SetupDefaultLoggingConfig(repoPath string) error { - folder := filepath.Join(repoPath, "log") - if err := os.MkdirAll(folder, os.ModePerm); err != nil { - return err +func SetupDefaultLoggingConfig(file string) error { + if file != "" { + if err := os.MkdirAll(filepath.Dir(file), os.ModePerm); err != nil { + return err + } } c := logging.Config{ Format: logging.ColorizedOutput, Stderr: true, - File: filepath.Join(folder, "threads.log"), + File: file, Level: logging.LevelError, } logging.SetupLogging(c) - return nil } @@ -139,46 +124,6 @@ func FreeLocalAddr() ma.Multiaddr { return MustParseAddr(fmt.Sprintf("/ip4/127.0.0.1/tcp/%d", hostPort)) } -func SchemaFromInstance(i interface{}, expandedStruct bool) *jsonschema.Schema { - reflector := jsonschema.Reflector{ExpandedStruct: expandedStruct} - return reflector.Reflect(i) -} - -func SchemaFromSchemaString(s string) *jsonschema.Schema { - schemaBytes := []byte(s) - schema := &jsonschema.Schema{} - if err := json.Unmarshal(schemaBytes, schema); err != nil { - panic(err) - } - return schema -} - -func JSONFromInstance(i interface{}) []byte { - JSON, err := json.Marshal(i) - if err != nil { - panic(err) - } - return JSON -} - -func InstanceFromJSON(b []byte, i interface{}) { - if err := json.Unmarshal(b, i); err != nil { - panic(err) - } -} - -func SetJSONProperty(name string, value interface{}, json []byte) []byte { - updated, err := sjson.SetBytes(json, name, value) - if err != nil { - panic(err) - } - return updated -} - -func SetJSONID(id core.InstanceID, json []byte) []byte { - return SetJSONProperty("_id", id.String(), json) -} - func GenerateRandomBytes(n int) []byte { b := make([]byte, n) _, err := rand.Read(b) @@ -188,11 +133,6 @@ func GenerateRandomBytes(n int) []byte { return b } -func MakeToken(n int) string { - bytes := GenerateRandomBytes(n) - encoded, err := mbase.Encode(mbase.Base32, bytes) - if err != nil { - panic(err) - } - return encoded +func MakeToken() string { + return strings.ToLower(ulid.MustNew(ulid.Now(), rand.Reader).String()) }