diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d6a6f96..5a7615b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -38,21 +38,3 @@ jobs: args: --timeout 5m - name: 'Run unit tests core module' run: go test -v ./core/... - #Model module - - name: 'Run linters model module' - uses: golangci/golangci-lint-action@v3 - with: - working-directory: 'model' - version: v1.50 - args: --timeout 5m - - name: 'Run unit tests model module' - run: go test -v ./model/... - #Contentadrstorage module - - name: 'Run linters contentadrstorage module' - uses: golangci/golangci-lint-action@v3 - with: - working-directory: 'contentadrstorage' - version: v1.50 - args: --timeout 5m - - name: 'Run unit tests contentadrstorage module' - run: go test -v ./contentadrstorage/... diff --git a/Makefile b/Makefile index bb17f94..9a1198a 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -packages = ./model/... ./core/... ./contract/... ./contentadrstorage/... +packages = ./core/... ./contract/... .PHONY: test test: @@ -6,19 +6,3 @@ test: lint: docker run --rm -v ${PWD}:/app -w /app golangci/golangci-lint:v1.50 golangci-lint run ${packages} - -protobuf: - docker run --rm \ - -v ${PWD}/ddc-schemas/storage/protobuf:/proto_path \ - -v ${PWD}/model:/go_out \ - rvolosatovs/protoc:3.3 \ - --experimental_allow_proto3_optional \ - --proto_path=/proto_path \ - --go_out=/go_out \ - $$(find ddc-schemas/storage/protobuf -name '*.proto' -type f | sed 's/.*\///') - -protoc: - protoc --proto_path=./ddc-schemas/storage/protobuf --go_out=./model ./ddc-schemas/storage/**/*.proto - -fix-docker-mess: - sudo chown $$(whoami) -R model/pb/ diff --git a/README.md b/README.md index 2b4a7e9..cf6b9ec 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,3 @@ # cere-ddc-sdk-go The Cere DDC SDK for Go. - - -## How to update the Protobuf schema - -Clone the ddc-schemas repo: - - git submodule update --init - -Checkout a particular version of the schema: - - cd ddc-schemas && git checkout storage-vX.X.X - -Regenerate the code through a Docker image - - make protobuf - - … or through the `protoc` command … - - make protoc - -Freeze the schema version and generated code - - git add ddc-schemas model/pb - diff --git a/contentadrstorage/go.mod b/contentadrstorage/go.mod deleted file mode 100644 index fc47a8d..0000000 --- a/contentadrstorage/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -module github.com/cerebellum-network/cere-ddc-sdk-go/contentadrstorage - -go 1.18 diff --git a/contentadrstorage/go.sum b/contentadrstorage/go.sum deleted file mode 100644 index e69de29..0000000 diff --git a/contentadrstorage/pkg/pieceuri.go b/contentadrstorage/pkg/pieceuri.go deleted file mode 100644 index 0d78154..0000000 --- a/contentadrstorage/pkg/pieceuri.go +++ /dev/null @@ -1,6 +0,0 @@ -package pkg - -type PieceUri struct { - BucketId uint32 - Cid string -} diff --git a/contentadrstorage/pkg/storage.go b/contentadrstorage/pkg/storage.go deleted file mode 100644 index e871300..0000000 --- a/contentadrstorage/pkg/storage.go +++ /dev/null @@ -1,142 +0,0 @@ -package pkg - -import ( - "bytes" - "context" - "fmt" - "io" - "net/http" - "strconv" - - "github.com/cerebellum-network/cere-ddc-sdk-go/core/pkg/cid" - "github.com/cerebellum-network/cere-ddc-sdk-go/core/pkg/crypto" - "github.com/cerebellum-network/cere-ddc-sdk-go/model/domain" -) - -type ContentAddressableStorage interface { - Store(ctx context.Context, piece *domain.Piece) (*PieceUri, error) - Read(ctx context.Context, bucketId uint32, cid string) (*domain.Piece, error) - Search(ctx context.Context, query *domain.Query) (*domain.SearchResult, error) -} - -type contentAddressableStorage struct { - scheme crypto.Scheme - cdnNodeUrl string - cidBuilder *cid.Builder - client *http.Client -} - -const basePath = "/api/rest/pieces" - -func NewContentAddressableStorage(scheme crypto.Scheme, cdnNodeUrl string, cidBuilder *cid.Builder) ContentAddressableStorage { - return &contentAddressableStorage{scheme: scheme, cdnNodeUrl: cdnNodeUrl, cidBuilder: cidBuilder, client: http.DefaultClient} -} - -func (c *contentAddressableStorage) Store(ctx context.Context, piece *domain.Piece) (*PieceUri, error) { - signPiece, pieceCid, err := c.signPiece(piece) - if err != nil { - return nil, err - } - body, err := signPiece.MarshalProto() - if err != nil { - return nil, err - } - - _, err = c.sendRequest(ctx, "PUT", c.cdnNodeUrl+basePath, body, http.StatusCreated) - if err != nil { - return nil, fmt.Errorf("failed to store: %w", err) - } - - pieceUri := &PieceUri{BucketId: piece.BucketId, Cid: pieceCid} - return pieceUri, nil -} - -func (c *contentAddressableStorage) Read(ctx context.Context, bucketId uint32, cid string) (*domain.Piece, error) { - url := c.cdnNodeUrl + basePath + "/" + cid + "?bucketId=" + strconv.FormatUint(uint64(bucketId), 10) - - data, err := c.sendRequest(ctx, "GET", url, nil, http.StatusOK) - if err != nil { - return nil, fmt.Errorf("failed to read: %w", err) - } - - signedPiece := &domain.SignedPiece{} - err = signedPiece.UnmarshalProto(data) - if err != nil { - return nil, err - } - - piece := signedPiece.Piece() - return piece, nil -} - -func (c *contentAddressableStorage) Search(ctx context.Context, query *domain.Query) (*domain.SearchResult, error) { - body, err := query.MarshalProto() - if err != nil { - return nil, err - } - - data, err := c.sendRequest(ctx, "GET", c.cdnNodeUrl+basePath, body, http.StatusOK) - if err != nil { - return nil, fmt.Errorf("failed to search: %w", err) - } - - searchResult := &domain.SearchResult{} - err = searchResult.UnmarshalProto(data) - if err != nil { - return nil, err - } - - return searchResult, nil -} - -func (c *contentAddressableStorage) sendRequest(ctx context.Context, method string, url string, body []byte, expectedStatus int) ([]byte, error) { - req, err := http.NewRequestWithContext(ctx, method, url, bytes.NewBuffer(body)) - if err != nil { - return nil, fmt.Errorf("failed to create request: %w", err) - } - - resp, err := c.client.Do(req) - if err != nil { - return nil, fmt.Errorf("failed to send request: %w", err) - } - defer resp.Body.Close() - - if resp.StatusCode != expectedStatus { - _, _ = io.Copy(io.Discard, resp.Body) - return nil, fmt.Errorf("fail status %s", resp.Status) - } - - result, err := io.ReadAll(resp.Body) - if err != nil { - return nil, fmt.Errorf("failed to read response body: %w", err) - } - - return result, err -} - -func (c *contentAddressableStorage) signPiece(piece *domain.Piece) (*domain.SignedPiece, string, error) { - pieceBytes, err := piece.MarshalProto() - if err != nil { - return nil, "", fmt.Errorf("failed marshal piece proto: %w", err) - } - - signedPiece := domain.NewSignedPiece( - piece, - pieceBytes, - &domain.Signature{Signer: c.scheme.PublicKey(), Scheme: c.scheme.Name()}, - ) - - signeable, pieceCid, err := signedPiece.SigneableCid() - if err != nil { - return nil, "", err - } - - signature, err := c.scheme.Sign(signeable) - if err != nil { - return nil, "", fmt.Errorf("failed to sign piece: %w", err) - } - - signedPiece.SetSignature(signature) - - return signedPiece, pieceCid, nil -} diff --git a/go.work b/go.work index daadeba..6a2fcdf 100644 --- a/go.work +++ b/go.work @@ -2,10 +2,8 @@ go 1.18 use ( ./blockchain - ./contentadrstorage ./contract ./core - ./model ./test dac ) diff --git a/go.work.sum b/go.work.sum index dfab2de..d763451 100644 --- a/go.work.sum +++ b/go.work.sum @@ -144,8 +144,6 @@ github.com/AzureAD/microsoft-authentication-library-for-go v0.6.0 h1:XMEdVDFxgul github.com/AzureAD/microsoft-authentication-library-for-go v0.6.0/go.mod h1:BDJ5qMFKx9DugEg3+uQSDCdbYPr5s9vBTrL9P8TpqOU= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802 h1:1BDTz0u9nC3//pOCMdNH+CiXJVYJh5UQNCOBG7jbELc= -github.com/Cerebellum-Network/cere-substrate-rpc-client-go/v4 v4.0.0-20240528103741-c0b9d7116ed4 h1:JN3HK887OsgrpAuinStxbsVHpdiVFgAFdizDnRjE1qU= -github.com/Cerebellum-Network/cere-substrate-rpc-client-go/v4 v4.0.0-20240528103741-c0b9d7116ed4/go.mod h1:k61SBXqYmnZO4frAJyH3iuqjolYrYsq79r8EstmklDY= github.com/DATA-DOG/go-sqlmock v1.3.3 h1:CWUqKXe0s8A2z6qCgkP4Kru7wC11YoAnoupUKFDnH08= github.com/Microsoft/hcsshim v0.9.7 h1:mKNHW/Xvv1aFH87Jb6ERDzXTJTLPlmzfZ28VBFD/bfg= github.com/Microsoft/hcsshim v0.9.7/go.mod h1:7pLA8lDk46WKDWlVsENo92gC0XFa8rbKfyFRBqxEbCc= @@ -664,6 +662,7 @@ golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= gonum.org/v1/gonum v0.6.0 h1:DJy6UzXbahnGUf1ujUNkh/NEtK14qMo2nvlBPs4U5yw= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0 h1:OE9mWmgKkjJyEmDAAtGMPjXu+YNeGvK9VTSHY6+Qihc= gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b h1:Qh4dB5D/WpoUUp3lSod7qgoyEHbDGPUWjIbnqdqqe1k= diff --git a/model/ddcuri/ddcuri.go b/model/ddcuri/ddcuri.go deleted file mode 100644 index d46935f..0000000 --- a/model/ddcuri/ddcuri.go +++ /dev/null @@ -1,54 +0,0 @@ -// Package ddcuri is an implementation of DDC URI v0.2 -// -// Reference: https://docs.cere.network/ddc/protocols/ddc-url -package ddcuri - -import ( - "fmt" - "strings" -) - -type DdcQuery struct { - Organization string - - BucketName string - BucketId uint32 - BucketIdSet bool - - Protocol string - Cid string - Path []string - Extension string - - Options string -} - -func Parse(uri string) (q DdcQuery, err error) { - uri = consumeOptions(&q, uri) - err = consumeMain(&q, uri) - return q, err -} - -func ParseWebUrl(url string) (q DdcQuery, err error) { - position := strings.Index(url, "/ddc/") - if position == -1 { - return q, fmt.Errorf("not a DDC URL (%s)", url) - } - uri := url[position:] - return Parse(uri) -} - -func (q *DdcQuery) String() string { - return q.toUri() -} - -const ( - DDC_PREFIX = "/ddc/" - DDC = "ddc" - ORG = "org" - BUC = "buc" - IPIECE = "ipiece" - IFILE = "ifile" - PIECE = "piece" - FILE = "file" -) diff --git a/model/ddcuri/ddcuri_gen.go b/model/ddcuri/ddcuri_gen.go deleted file mode 100644 index 84d2588..0000000 --- a/model/ddcuri/ddcuri_gen.go +++ /dev/null @@ -1,41 +0,0 @@ -package ddcuri - -import ( - "strconv" - "strings" -) - -func (q *DdcQuery) toUri() string { - parts := []string{"/" + DDC} - - if q.Organization != "" { - parts = append(parts, ORG, q.Organization) - } - // Example output: /ddc/org/my_org - - if q.BucketIdSet { - bucketId := strconv.Itoa(int(q.BucketId)) - parts = append(parts, BUC, bucketId) - // Example output: /ddc/org/my_org/buc/123 - } else if q.BucketName != "" { - parts = append(parts, BUC, q.BucketName) - // Example output: /ddc/org/my_org/buc/my_bucket - } - - if q.Protocol == IPIECE || q.Protocol == IFILE { - parts = append(parts, q.Protocol, q.Cid+q.Extension) - // Example output: /ddc/org/my_org/buc/my_bucket/ifile/cid123.js - } else if q.Protocol == PIECE || q.Protocol == FILE { - parts = append(parts, q.Protocol) - parts = append(parts, q.Path...) - // Example output: /ddc/org/my_org/buc/my_bucket/file/folder/image.png - } - - uri := strings.Join(parts, "/") - - if q.Options != "" { - uri = uri + "?" + q.Options - } - // Example output: /ddc/org/my_org/buc/my_bucket/file/folder/image.png?options - return uri -} diff --git a/model/ddcuri/ddcuri_parser.go b/model/ddcuri/ddcuri_parser.go deleted file mode 100644 index 208a527..0000000 --- a/model/ddcuri/ddcuri_parser.go +++ /dev/null @@ -1,105 +0,0 @@ -package ddcuri - -import ( - "fmt" - "path/filepath" - "strconv" - "strings" - "unicode" - "unicode/utf8" -) - -func consumeOptions(q *DdcQuery, uri string) string { - // Example input: /ddc/org/my_org/buc/my_bucket/ifile/my_cid?option=yes - uri = strings.TrimSpace(uri) - mainUri, options, _ := strings.Cut(uri, "?") - q.Options = options - return mainUri -} - -func consumeMain(q *DdcQuery, uri string) error { - // Example input: /ddc/org/my_org/buc/my_bucket/ifile/my_cid - if !strings.HasPrefix(uri, DDC_PREFIX) { - return fmt.Errorf("DDC URI must start with " + DDC_PREFIX) - } - uri = uri[len(DDC_PREFIX):] - - // Example input: org/my_org/buc/my_bucket/ifile/my_cid - parts := strings.Split(uri, "/") - return consumeOrg(q, parts) -} - -func consumeOrg(q *DdcQuery, parts []string) error { - // Example input: [org my_org buc my_bucket ifile my_cid] - if len(parts) >= 2 && parts[0] == ORG { - q.Organization = parts[1] - parts = parts[2:] - } - - return consumeBuc(q, parts) -} - -func consumeBuc(q *DdcQuery, parts []string) error { - // Example input: [buc my_bucket ifile my_cid] - if len(parts) >= 2 && parts[0] == BUC { - value := parts[1] - parts = parts[2:] - - if startsWithDigit(value) { - bucketId, err := strconv.ParseUint(value, 10, 32) - if err != nil { - return fmt.Errorf("invalid bucket ID (%s)", value) - } - q.BucketId = uint32(bucketId) - q.BucketIdSet = true - } else { - if len(value) == 0 { - return fmt.Errorf("invalid bucket name (%s)", value) - } - q.BucketName = value - } - } - - return consumeProtocol(q, parts) -} - -func consumeProtocol(q *DdcQuery, parts []string) error { - // Example input: [ifile my_cid] - if len(parts) >= 2 { - field := parts[0] - if field == IPIECE || field == IFILE { - q.Protocol = field - q.Cid, q.Extension = splitExtension(parts[1]) - parts = parts[2:] - } else if field == PIECE || field == FILE { - q.Protocol = field - q.Path = parts[1:] - _, q.Extension = splitExtension(parts[len(parts)-1]) - parts = nil - } - } - - return consumeEnd(q, parts) -} - -func consumeEnd(q *DdcQuery, parts []string) error { - // Example input: [] - if len(parts) != 0 { - return fmt.Errorf("unrecognized field %s", parts) - } - return nil -} - -func startsWithDigit(s string) bool { - first, _ := utf8.DecodeRuneInString(s) - return unicode.IsDigit(first) -} - -func splitExtension(name string) (string, string) { - ext := filepath.Ext(name) - if ext != "" { - // Remove the extension. - name = name[:len(name)-len(ext)] - } - return name, ext -} diff --git a/model/ddcuri/ddcuri_test.go b/model/ddcuri/ddcuri_test.go deleted file mode 100644 index f0e01c7..0000000 --- a/model/ddcuri/ddcuri_test.go +++ /dev/null @@ -1,155 +0,0 @@ -package ddcuri - -import ( - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestGoodDdcUri(t *testing.T) { - goodDdcUri(t, - "/ddc/buc/123/ipiece/cid123", - "", - DdcQuery{ - Protocol: "ipiece", - BucketId: 123, - BucketIdSet: true, - Cid: "cid123", - }) - - goodDdcUri(t, - "/ddc/buc/123/ipiece/cid123.js", - "", - DdcQuery{ - Protocol: "ipiece", - BucketId: 123, - BucketIdSet: true, - Cid: "cid123", - Extension: ".js", - }) - - goodDdcUri(t, - " /ddc/buc/123/ipiece/cid123 ", - "/ddc/buc/123/ipiece/cid123", // canonical - DdcQuery{ - Protocol: "ipiece", - BucketId: 123, - BucketIdSet: true, - Cid: "cid123", - }) - - goodDdcUri(t, - "/ddc/org/my_org/buc/my_bucket/ifile/cid123", - "", - DdcQuery{ - Organization: "my_org", - BucketName: "my_bucket", - Protocol: "ifile", - Cid: "cid123", - }) - - goodDdcUri(t, - "/ddc/org/my_org/buc/my_bucket/ifile/cid123?option=yes", - "", - DdcQuery{ - Organization: "my_org", - BucketName: "my_bucket", - Protocol: "ifile", - Cid: "cid123", - Options: "option=yes", - }) - - goodDdcUri(t, - "/ddc/org/my_org/buc/my_bucket/file/my_folder/image.png?option=yes", - "", - DdcQuery{ - Organization: "my_org", - BucketName: "my_bucket", - Protocol: "file", - Path: []string{"my_folder", "image.png"}, - Options: "option=yes", - Extension: ".png", - }) - - goodDdcUri(t, - "/ddc/org/my_org/buc/my_bucket/file/", - "", - DdcQuery{ - Organization: "my_org", - BucketName: "my_bucket", - Protocol: "file", - Path: []string{""}, - }) -} - -func TestBadDdcUri(t *testing.T) { - badDdcUri(t, "", "DDC URI must start with /ddc/") - badDdcUri(t, "ddc/buc/123/ifile/cid123", "DDC URI must start with /ddc/") - badDdcUri(t, "http://something", "DDC URI must start with /ddc/") - badDdcUri(t, "/ddc/org/my_org/buc//ifile/cid123", "invalid bucket name ()") - badDdcUri(t, "/ddc/org/my_org/buc/?my_bucket/ifile/cid123", "invalid bucket name ()") - badDdcUri(t, "/ddc/buc/5000000000/ipiece/too_big", "invalid bucket ID (5000000000)") - badDdcUri(t, "/ddc/org/my_org/buc/my_bucket/file", "unrecognized field [file]") -} - -func goodDdcUri(t *testing.T, inputUri string, canonicalUri string, expected DdcQuery) { - parsed, err := Parse(inputUri) - assert.NoError(t, err) - assert.Equal(t, expected, parsed) - - rebuilt := expected.String() - if canonicalUri == "" { - canonicalUri = inputUri - } - assert.Equal(t, rebuilt, canonicalUri) -} - -func badDdcUri(t *testing.T, uri string, errMsg string) { - _, err := Parse(uri) - assert.EqualError(t, err, errMsg) -} - -func TestGoodWebUrl(t *testing.T) { - uri := "/ddc/buc/123/ipiece/cid123?options" - parsed1, err1 := Parse(uri) - parsed2, err2 := ParseWebUrl(uri) - parsed3, err3 := ParseWebUrl("htts://cdn" + uri) - assert.Equal(t, parsed1, parsed2) - assert.Equal(t, parsed1, parsed3) - assert.NoError(t, err1) - assert.NoError(t, err2) - assert.NoError(t, err3) -} - -func TestBadWebUrl(t *testing.T) { - uri := "/ddc/xyz" - parsed1, err1 := Parse(uri) - parsed2, err2 := ParseWebUrl("htts://cdn" + uri) - assert.Equal(t, parsed1, parsed2) - assert.Equal(t, err1, err2) - assert.EqualError(t, err2, "unrecognized field [xyz]") - - _, err := ParseWebUrl("") - if assert.Error(t, err) { - assert.Equal(t, err.Error(), "not a DDC URL ()") - } - - _, err = ParseWebUrl("htts://cdn-ddc/buc/123") - if assert.Error(t, err) { - assert.Equal(t, err.Error(), "not a DDC URL (htts://cdn-ddc/buc/123)") - } -} - -func TestSplitExtension(t *testing.T) { - - check := func(name, expectBase, expectExt string) { - base, ext := splitExtension(name) - assert.Equal(t, expectBase, base) - assert.Equal(t, expectExt, ext) - } - - check("", "", "") - check("name", "name", "") - check("name.js", "name", ".js") - check("name.", "name", ".") -} diff --git a/model/domain/ack.go b/model/domain/ack.go deleted file mode 100644 index 357b3ae..0000000 --- a/model/domain/ack.go +++ /dev/null @@ -1,74 +0,0 @@ -package domain - -import ( - "github.com/cerebellum-network/cere-ddc-sdk-go/model/pb" - "google.golang.org/protobuf/proto" - "time" -) - -type Ack struct { - Timestamp *time.Time - Gas uint64 - PublicKey []byte - Nonce []byte - RequestId string - SessionId []byte - Cid string - Signature []byte - Schema string - MultiHashType uint64 - Chunks []string -} - -var _ Protobufable = (*Ack)(nil) - -func (a *Ack) MarshalProto() ([]byte, error) { - return proto.Marshal(a.ToProto()) -} - -func (a *Ack) UnmarshalProto(bytes []byte) error { - ack := &pb.Ack{} - if err := proto.Unmarshal(bytes, ack); err != nil { - return err - } - - a.ToDomain(ack) - return nil -} - -func (a *Ack) ToDomain(ack *pb.Ack) { - timestamp := time.UnixMilli(int64(ack.Timestamp)) - a.Timestamp = ×tamp - - a.PublicKey = ack.PublicKey - a.Gas = ack.Gas - a.Nonce = ack.Nonce - a.RequestId = ack.RequestId - a.SessionId = ack.SessionId - a.Cid = ack.Cid - a.Signature = ack.Signature - a.Schema = ack.Scheme - a.MultiHashType = ack.MultiHashType - a.Chunks = make([]string, len(ack.Chunks)) - copy(a.Chunks, ack.Chunks) -} - -func (a *Ack) ToProto() *pb.Ack { - return func() *pb.Ack { - ack := &pb.Ack{ - PublicKey: a.PublicKey, - Gas: a.Gas, - Nonce: a.Nonce, - RequestId: a.RequestId, - SessionId: a.SessionId, - Cid: a.Cid, - Signature: a.Signature, - Scheme: a.Schema, - MultiHashType: a.MultiHashType, - Timestamp: uint64(a.Timestamp.UnixMilli()), - } - ack.Chunks = make([]string, len(a.Chunks)) - copy(ack.Chunks, a.Chunks) - return ack - }() -} diff --git a/model/domain/ackrecord.go b/model/domain/ackrecord.go deleted file mode 100644 index 2ca2bbc..0000000 --- a/model/domain/ackrecord.go +++ /dev/null @@ -1,87 +0,0 @@ -package domain - -import ( - "github.com/cerebellum-network/cere-ddc-sdk-go/model/pb" - "google.golang.org/protobuf/proto" - "time" -) - -type ( - AckRecordList []*AckRecord - - AckRecord struct { - Ack *Ack - PublicKey []byte - Timestamp *time.Time - } -) - -var _ Protobufable = (*AckRecord)(nil) -var _ Protobufable = (*AckRecordList)(nil) - -func (a *AckRecord) MarshalProto() ([]byte, error) { - return proto.Marshal(a.ToProto()) -} - -func (a *AckRecord) UnmarshalProto(bytes []byte) error { - ackRecord := &pb.AckRecord{} - if err := proto.Unmarshal(bytes, ackRecord); err != nil { - return err - } - - a.ToDomain(ackRecord) - return nil -} - -func (a *AckRecord) ToProto() *pb.AckRecord { - return &pb.AckRecord{ - Ack: a.Ack.ToProto(), - PublicKey: a.PublicKey, - Timestamp: uint64(a.Timestamp.UnixNano()), - } -} - -func (a *AckRecord) ToDomain(record *pb.AckRecord) { - ack := &Ack{} - ack.ToDomain(record.Ack) - timestamp := time.Unix(0, int64(record.Timestamp)) - - a.Ack = ack - a.PublicKey = record.PublicKey - a.Timestamp = ×tamp -} - -func (a *AckRecordList) MarshalProto() ([]byte, error) { - return proto.Marshal(a.ToProto()) -} - -func (a *AckRecordList) UnmarshalProto(bytes []byte) error { - pbAckRecords := &pb.AckRecordList{} - if err := proto.Unmarshal(bytes, pbAckRecords); err != nil { - return err - } - - a.ToDomain(pbAckRecords) - return nil -} - -func (a *AckRecordList) ToProto() *pb.AckRecordList { - list := *a - result := make([]*pb.AckRecord, 0, len(list)) - for _, v := range list { - result = append(result, v.ToProto()) - } - - return &pb.AckRecordList{AckRecords: result} -} - -func (a *AckRecordList) ToDomain(records *pb.AckRecordList) { - result := AckRecordList(make([]*AckRecord, 0, len(records.AckRecords))) - for _, v := range records.AckRecords { - record := &AckRecord{} - record.ToDomain(v) - result = append(result, record) - } - - *a = result -} diff --git a/model/domain/link.go b/model/domain/link.go deleted file mode 100644 index 1a97711..0000000 --- a/model/domain/link.go +++ /dev/null @@ -1,42 +0,0 @@ -package domain - -import ( - "github.com/cerebellum-network/cere-ddc-sdk-go/model/pb" - "google.golang.org/protobuf/proto" -) - -type Link struct { - Cid string - Size uint64 - Name string -} - -var _ Protobufable = (*Link)(nil) - -func (l *Link) ToProto() *pb.Link { - return &pb.Link{ - Cid: l.Cid, - Size: l.Size, - Name: l.Name, - } -} - -func (l *Link) ToDomain(pbLink *pb.Link) { - l.Cid = pbLink.Cid - l.Size = pbLink.Size - l.Name = pbLink.Name -} - -func (l *Link) MarshalProto() ([]byte, error) { - return proto.Marshal(l.ToProto()) -} - -func (l *Link) UnmarshalProto(linkAsBytes []byte) error { - link := &pb.Link{} - if err := proto.Unmarshal(linkAsBytes, link); err != nil { - return err - } - - l.ToDomain(link) - return nil -} diff --git a/model/domain/logrecord.go b/model/domain/logrecord.go deleted file mode 100644 index 9963943..0000000 --- a/model/domain/logrecord.go +++ /dev/null @@ -1,210 +0,0 @@ -package domain - -import ( - "github.com/cerebellum-network/cere-ddc-sdk-go/model/pb" - "google.golang.org/protobuf/proto" - "time" -) - -type ( - LogRecordList []*LogRecord - - LogRecord struct { - Request IsRequest - Timestamp *time.Time - Address string - Gas uint32 - PublicKey []byte - SessionId []byte - RequestId string - Signature *Signature - ResponsePieces []*ResponsePiece - } - - WriteRequest struct { - Cid string - BucketId uint32 - Size uint32 - } - - ReadRequest struct { - Cid string - BucketId uint32 - } - - QueryRequest struct { - Query *Query - } - - IsRequest interface { - isRequest() - } - - ResponsePiece struct { - Cid string - Size uint32 - } -) - -var _ Protobufable = (*LogRecord)(nil) -var _ Protobufable = (*LogRecordList)(nil) - -func (l *LogRecord) ToProto() *pb.LogRecord { - responsePieces := make([]*pb.ResponsePiece, 0, len(l.ResponsePieces)) - for _, piece := range l.ResponsePieces { - responsePieces = append(responsePieces, responsePieceToProto(piece)) - } - - result := &pb.LogRecord{ - Timestamp: uint64(l.Timestamp.UnixNano()), - Address: l.Address, - Gas: l.Gas, - SessionId: l.SessionId, - PublicKey: l.PublicKey, - RequestId: l.RequestId, - ResponsePieces: responsePieces, - } - - l.requestToProto(result) - - return result -} - -func (l *LogRecord) ToDomain(pbLogRecord *pb.LogRecord) { - timestamp := time.Unix(0, int64(pbLogRecord.Timestamp)) - l.Timestamp = ×tamp - - var signature *Signature - - l.Address = pbLogRecord.Address - l.Gas = pbLogRecord.Gas - l.SessionId = pbLogRecord.SessionId - l.PublicKey = pbLogRecord.PublicKey - l.RequestId = pbLogRecord.RequestId - l.Request = requestToDomain(pbLogRecord) - l.Signature = signature - l.ResponsePieces = make([]*ResponsePiece, 0, len(pbLogRecord.ResponsePieces)) - for _, item := range pbLogRecord.ResponsePieces { - l.ResponsePieces = append(l.ResponsePieces, responsePieceToDomain(item)) - } -} - -func (l *LogRecord) MarshalProto() ([]byte, error) { - return proto.Marshal(l.ToProto()) -} - -func (l *LogRecord) UnmarshalProto(logRecordAsBytes []byte) error { - pbLogRecord := &pb.LogRecord{} - if err := proto.Unmarshal(logRecordAsBytes, pbLogRecord); err != nil { - return err - } - - l.ToDomain(pbLogRecord) - return nil -} - -func (l *LogRecordList) MarshalProto() ([]byte, error) { - return proto.Marshal(l.ToProto()) -} - -func (l *LogRecordList) UnmarshalProto(logRecordAsBytes []byte) error { - pbLogRecords := &pb.LogRecordList{} - if err := proto.Unmarshal(logRecordAsBytes, pbLogRecords); err != nil { - return err - } - - l.ToDomain(pbLogRecords) - return nil -} - -func (l *LogRecordList) ToProto() *pb.LogRecordList { - list := *l - result := make([]*pb.LogRecord, 0, len(list)) - for _, v := range list { - result = append(result, v.ToProto()) - } - - return &pb.LogRecordList{LogRecords: result} -} - -func (l *LogRecordList) ToDomain(pbLogRecordList *pb.LogRecordList) { - result := LogRecordList(make([]*LogRecord, 0, len(pbLogRecordList.LogRecords))) - for _, v := range pbLogRecordList.LogRecords { - record := &LogRecord{} - record.ToDomain(v) - result = append(result, record) - } - - *l = result -} - -func (l *LogRecord) requestToProto(pbLogRecord *pb.LogRecord) { - switch record := l.Request.(type) { - case *WriteRequest: - pbLogRecord.Request = &pb.LogRecord_WriteRequest{WriteRequest: &pb.WriteRequest{ - BucketId: record.BucketId, - Size: record.Size, - Cid: record.Cid, - }} - case *ReadRequest: - pbLogRecord.Request = &pb.LogRecord_ReadRequest{ReadRequest: &pb.ReadRequest{ - Cid: record.Cid, - BucketId: record.BucketId, - }} - case *QueryRequest: - var query *pb.Query - if record.Query != nil { - query = record.Query.ToProto() - } - - pbLogRecord.Request = &pb.LogRecord_QueryRequest{QueryRequest: &pb.QueryRequest{ - Query: query, - }} - } -} - -func requestToDomain(pbLogRecord *pb.LogRecord) IsRequest { - switch record := pbLogRecord.Request.(type) { - case *pb.LogRecord_WriteRequest: - writeRecord := record.WriteRequest - - return &WriteRequest{ - BucketId: writeRecord.BucketId, - Size: writeRecord.Size, - Cid: writeRecord.Cid, - } - case *pb.LogRecord_ReadRequest: - readRecord := record.ReadRequest - return &ReadRequest{Cid: readRecord.Cid, BucketId: readRecord.BucketId} - case *pb.LogRecord_QueryRequest: - queryRecord := record.QueryRequest - - var query *Query - if queryRecord.Query != nil { - query = &Query{} - query.ToDomain(queryRecord.Query) - } - - return &QueryRequest{Query: query} - } - - return nil -} - -func (w *WriteRequest) isRequest() {} -func (q *QueryRequest) isRequest() {} -func (r *ReadRequest) isRequest() {} - -func responsePieceToDomain(pbResponsePiece *pb.ResponsePiece) *ResponsePiece { - return &ResponsePiece{ - Cid: pbResponsePiece.Cid, - Size: pbResponsePiece.Size, - } -} - -func responsePieceToProto(responsePiece *ResponsePiece) *pb.ResponsePiece { - return &pb.ResponsePiece{ - Cid: responsePiece.Cid, - Size: responsePiece.Size, - } -} diff --git a/model/domain/piece.go b/model/domain/piece.go deleted file mode 100644 index c692524..0000000 --- a/model/domain/piece.go +++ /dev/null @@ -1,67 +0,0 @@ -package domain - -import ( - "github.com/cerebellum-network/cere-ddc-sdk-go/model/pb" - "google.golang.org/protobuf/proto" -) - -type Piece struct { - Data []byte - BucketId uint32 - Tags []*Tag - Links []*Link -} - -var _ Protobufable = (*Piece)(nil) - -func (p *Piece) ToProto() *pb.Piece { - pbPiece := &pb.Piece{ - Data: p.Data, - BucketId: p.BucketId, - Tags: make([]*pb.Tag, len(p.Tags)), - Links: make([]*pb.Link, len(p.Links)), - } - - for i, tag := range p.Tags { - pbPiece.Tags[i] = tag.ToProto() - } - - for i, link := range p.Links { - pbPiece.Links[i] = link.ToProto() - } - - return pbPiece -} - -func (p *Piece) ToDomain(pbPiece *pb.Piece) { - p.Data = pbPiece.Data - p.BucketId = pbPiece.BucketId - p.Tags = make([]*Tag, len(pbPiece.Tags)) - p.Links = make([]*Link, len(pbPiece.Links)) - - for i, pbTag := range pbPiece.Tags { - tag := &Tag{} - tag.ToDomain(pbTag) - p.Tags[i] = tag - } - - for i, pbLink := range pbPiece.Links { - link := &Link{} - link.ToDomain(pbLink) - p.Links[i] = link - } -} - -func (p *Piece) MarshalProto() ([]byte, error) { - return proto.Marshal(p.ToProto()) -} - -func (p *Piece) UnmarshalProto(pieceAsBytes []byte) error { - pbPiece := &pb.Piece{} - if err := proto.Unmarshal(pieceAsBytes, pbPiece); err != nil { - return err - } - - p.ToDomain(pbPiece) - return nil -} diff --git a/model/domain/protobufable.go b/model/domain/protobufable.go deleted file mode 100644 index adc861e..0000000 --- a/model/domain/protobufable.go +++ /dev/null @@ -1,6 +0,0 @@ -package domain - -type Protobufable interface { - MarshalProto() ([]byte, error) - UnmarshalProto(bytes []byte) error -} diff --git a/model/domain/query.go b/model/domain/query.go deleted file mode 100644 index 9db5cbe..0000000 --- a/model/domain/query.go +++ /dev/null @@ -1,54 +0,0 @@ -package domain - -import ( - "github.com/cerebellum-network/cere-ddc-sdk-go/model/pb" - "google.golang.org/protobuf/proto" -) - -type Query struct { - BucketId uint32 - Tags []*Tag - SkipData bool -} - -var _ Protobufable = (*Query)(nil) - -func (q *Query) ToProto() *pb.Query { - pbQuery := &pb.Query{ - BucketId: q.BucketId, - Tags: make([]*pb.Tag, len(q.Tags)), - SkipData: q.SkipData, - } - - for i, tag := range q.Tags { - pbQuery.Tags[i] = tag.ToProto() - } - - return pbQuery -} - -func (q *Query) ToDomain(pbQuery *pb.Query) { - q.BucketId = pbQuery.BucketId - q.Tags = make([]*Tag, len(pbQuery.Tags)) - q.SkipData = pbQuery.SkipData - - for i, pbTag := range pbQuery.Tags { - tag := &Tag{} - tag.ToDomain(pbTag) - q.Tags[i] = tag - } -} - -func (q *Query) MarshalProto() ([]byte, error) { - return proto.Marshal(q.ToProto()) -} - -func (q *Query) UnmarshalProto(queryAsBytes []byte) error { - pbQuery := &pb.Query{} - if err := proto.Unmarshal(queryAsBytes, pbQuery); err != nil { - return err - } - - q.ToDomain(pbQuery) - return nil -} diff --git a/model/domain/request.go b/model/domain/request.go deleted file mode 100644 index c6dda7f..0000000 --- a/model/domain/request.go +++ /dev/null @@ -1,54 +0,0 @@ -package domain - -import ( - "github.com/cerebellum-network/cere-ddc-sdk-go/model/pb" - "google.golang.org/protobuf/proto" -) - -type Request struct { - Body []byte - PublicKey []byte - Signature []byte - Scheme string - MultiHashType uint64 - SessionId []byte - RequestId string -} - -var _ Protobufable = (*Request)(nil) - -func (r *Request) MarshalProto() ([]byte, error) { - return proto.Marshal(r.ToProto()) -} - -func (r *Request) UnmarshalProto(bytes []byte) error { - pbRequest := &pb.Request{} - if err := proto.Unmarshal(bytes, pbRequest); err != nil { - return err - } - - r.ToDomain(pbRequest) - return nil -} - -func (r *Request) ToProto() *pb.Request { - return &pb.Request{ - Body: r.Body, - PublicKey: r.PublicKey, - Signature: r.Signature, - Scheme: r.Scheme, - MultiHashType: r.MultiHashType, - SessionId: r.SessionId, - RequestId: r.RequestId, - } -} - -func (r *Request) ToDomain(pbRequest *pb.Request) { - r.Body = pbRequest.Body - r.PublicKey = pbRequest.PublicKey - r.Signature = pbRequest.Signature - r.Scheme = pbRequest.Scheme - r.MultiHashType = pbRequest.MultiHashType - r.SessionId = pbRequest.SessionId - r.RequestId = pbRequest.RequestId -} diff --git a/model/domain/response.go b/model/domain/response.go deleted file mode 100644 index ced03cb..0000000 --- a/model/domain/response.go +++ /dev/null @@ -1,79 +0,0 @@ -package domain - -import ( - "github.com/cerebellum-network/cere-ddc-sdk-go/model/pb" - "google.golang.org/protobuf/proto" -) - -const ( - Code_SUCCESS Code = 0 - Code_CREATED Code = 1 - Code_NOT_FOUND Code = 2 - Code_FAILED_READ_BODY Code = 3 - Code_FAILED_UNMARSHAL_BODY Code = 4 - Code_FAILED_MARSHAL_BODY Code = 5 - Code_FAILED_GET_BLOCKCHAIN_DATA Code = 6 - Code_BUCKET_RENT_EXPIRED Code = 7 - Code_INVALID_PUBLIC_KEY Code = 8 - Code_INVALID_SIGNATURE Code = 9 - Code_INVALID_PARAMETER Code = 10 - Code_BUCKET_NO_ACCESS Code = 11 - Code_INTERNAL_ERROR Code = 12 - Code_BAD_GATEWAY Code = 13 - Code_INVALID_SESSION_ID Code = 14 - Code_ACCOUNT_DEPOSIT_REQUIRED Code = 15 - Code_GAS_EXPIRED Code = 16 - Code_REQUEST_TOO_LARGE Code = 17 -) - -type ( - Code = pb.Code - - Response struct { - Body []byte - PublicKey []byte - Signature []byte - Scheme string - Gas uint32 - ResponseCode Code - MultiHashType uint64 - } -) - -var _ Protobufable = (*Response)(nil) - -func (r *Response) MarshalProto() ([]byte, error) { - return proto.Marshal(r.ToProto()) -} - -func (r *Response) UnmarshalProto(bytes []byte) error { - pbRequest := &pb.Response{} - if err := proto.Unmarshal(bytes, pbRequest); err != nil { - return err - } - - r.ToDomain(pbRequest) - return nil -} - -func (r *Response) ToProto() *pb.Response { - return &pb.Response{ - Body: r.Body, - PublicKey: r.PublicKey, - Signature: r.Signature, - Scheme: r.Scheme, - MultiHashType: r.MultiHashType, - ResponseCode: r.ResponseCode, - Gas: r.Gas, - } -} - -func (r *Response) ToDomain(pbRequest *pb.Response) { - r.Body = pbRequest.Body - r.PublicKey = pbRequest.PublicKey - r.Signature = pbRequest.Signature - r.Scheme = pbRequest.Scheme - r.MultiHashType = pbRequest.MultiHashType - r.ResponseCode = pbRequest.ResponseCode - r.Gas = pbRequest.Gas -} diff --git a/model/domain/searchresult.go b/model/domain/searchresult.go deleted file mode 100644 index e30be54..0000000 --- a/model/domain/searchresult.go +++ /dev/null @@ -1,84 +0,0 @@ -package domain - -import ( - "github.com/cerebellum-network/cere-ddc-sdk-go/model/pb" - "google.golang.org/protobuf/proto" -) - -type SearchResult struct { - SearchedPieces []*SearchedPiece -} - -var _ Protobufable = (*SearchResult)(nil) - -func (sr *SearchResult) ToProto() *pb.SearchResult { - pbSearchResult := &pb.SearchResult{ - SearchedPieces: make([]*pb.SearchedPiece, len(sr.SearchedPieces)), - } - - for i, searchedPiece := range sr.SearchedPieces { - pbSearchResult.SearchedPieces[i] = searchedPiece.ToProto() - } - - return pbSearchResult -} - -func (sr *SearchResult) ToDomain(pbSearchResult *pb.SearchResult) error { - sr.SearchedPieces = make([]*SearchedPiece, len(pbSearchResult.SearchedPieces)) - - for i, pbSearchedPiece := range pbSearchResult.SearchedPieces { - searchedPiece := &SearchedPiece{} - if err := searchedPiece.ToDomain(pbSearchedPiece); err != nil { - return err - } - sr.SearchedPieces[i] = searchedPiece - } - return nil -} - -func (sr *SearchResult) MarshalProto() ([]byte, error) { - return proto.Marshal(sr.ToProto()) -} - -func (sr *SearchResult) UnmarshalProto(searchResultAsBytes []byte) error { - pbSearchResult := &pb.SearchResult{} - if err := proto.Unmarshal(searchResultAsBytes, pbSearchResult); err != nil { - return err - } - - return sr.ToDomain(pbSearchResult) -} - -type SearchedPiece struct { - SignedPiece *SignedPiece - Cid string -} - -var _ Protobufable = (*SearchedPiece)(nil) - -func (sp *SearchedPiece) ToProto() *pb.SearchedPiece { - return &pb.SearchedPiece{ - Cid: sp.Cid, - SignedPiece: sp.SignedPiece.ToProto(), - } -} - -func (sp *SearchedPiece) ToDomain(pbSearchPiece *pb.SearchedPiece) error { - sp.Cid = pbSearchPiece.Cid - sp.SignedPiece = &SignedPiece{} - - return sp.SignedPiece.ToDomain(pbSearchPiece.SignedPiece) -} - -func (sp *SearchedPiece) MarshalProto() ([]byte, error) { - return proto.Marshal(sp.ToProto()) -} - -func (sp *SearchedPiece) UnmarshalProto(searchedPieceAsBytes []byte) error { - pbSearchedPiece := &pb.SearchedPiece{} - if err := proto.Unmarshal(searchedPieceAsBytes, pbSearchedPiece); err != nil { - return err - } - - return sp.ToDomain(pbSearchedPiece) -} diff --git a/model/domain/sessionstatus.go b/model/domain/sessionstatus.go deleted file mode 100644 index 8af740c..0000000 --- a/model/domain/sessionstatus.go +++ /dev/null @@ -1,48 +0,0 @@ -package domain - -import ( - "github.com/cerebellum-network/cere-ddc-sdk-go/model/pb" - "google.golang.org/protobuf/proto" -) - -type SessionStatus struct { - PublicKey []byte - Gas uint32 - SessionId []byte - EndOfEpoch uint64 - BucketId uint32 -} - -var _ Protobufable = (*SessionStatus)(nil) - -func (s *SessionStatus) MarshalProto() ([]byte, error) { - return proto.Marshal(s.ToProto()) -} - -func (s *SessionStatus) UnmarshalProto(bytes []byte) error { - pbSessionStatus := &pb.SessionStatus{} - if err := proto.Unmarshal(bytes, pbSessionStatus); err != nil { - return err - } - - s.ToDomain(pbSessionStatus) - return nil -} - -func (s *SessionStatus) ToProto() *pb.SessionStatus { - return &pb.SessionStatus{ - PublicKey: s.PublicKey, - Gas: s.Gas, - SessionId: s.SessionId, - EndOfEpoch: s.EndOfEpoch, - BucketId: s.BucketId, - } -} - -func (s *SessionStatus) ToDomain(pbSessionStatus *pb.SessionStatus) { - s.PublicKey = pbSessionStatus.PublicKey - s.Gas = pbSessionStatus.Gas - s.SessionId = pbSessionStatus.SessionId - s.EndOfEpoch = pbSessionStatus.EndOfEpoch - s.BucketId = pbSessionStatus.BucketId -} diff --git a/model/domain/sessionstatusrecord.go b/model/domain/sessionstatusrecord.go deleted file mode 100644 index 87c1aaf..0000000 --- a/model/domain/sessionstatusrecord.go +++ /dev/null @@ -1,48 +0,0 @@ -package domain - -import ( - "github.com/cerebellum-network/cere-ddc-sdk-go/model/pb" - "google.golang.org/protobuf/proto" -) - -type SessionStatusRecord struct { - SessionStatus *SessionStatus - PublicKey []byte - Signature []byte - Timestamp uint64 -} - -var _ Protobufable = (*SessionStatusRecord)(nil) - -func (s *SessionStatusRecord) MarshalProto() ([]byte, error) { - return proto.Marshal(s.ToProto()) -} - -func (s *SessionStatusRecord) UnmarshalProto(bytes []byte) error { - pbSessionStatusRecord := &pb.SessionStatusRecord{} - if err := proto.Unmarshal(bytes, pbSessionStatusRecord); err != nil { - return err - } - - s.ToDomain(pbSessionStatusRecord) - return nil -} - -func (s *SessionStatusRecord) ToProto() *pb.SessionStatusRecord { - return &pb.SessionStatusRecord{ - SessionStatus: s.SessionStatus.ToProto(), - PublicKey: s.PublicKey, - Signature: s.Signature, - Timestamp: s.Timestamp, - } -} - -func (s *SessionStatusRecord) ToDomain(pbSessionStatusRecord *pb.SessionStatusRecord) { - sessionStatus := &SessionStatus{} - sessionStatus.ToDomain(pbSessionStatusRecord.SessionStatus) - - s.SessionStatus = sessionStatus - s.PublicKey = pbSessionStatusRecord.PublicKey - s.Signature = pbSessionStatusRecord.Signature - s.Timestamp = pbSessionStatusRecord.Timestamp -} diff --git a/model/domain/signature.go b/model/domain/signature.go deleted file mode 100644 index 4fd88aa..0000000 --- a/model/domain/signature.go +++ /dev/null @@ -1,84 +0,0 @@ -package domain - -import ( - "bytes" - "encoding/hex" - "errors" - "github.com/cerebellum-network/cere-ddc-sdk-go/model/pb" - "google.golang.org/protobuf/proto" -) - -type Signature struct { - Value []byte - Signer []byte - Scheme string - MultiHashType uint64 - Timestamp uint64 -} - -var _ Protobufable = (*Signature)(nil) - -func (s *Signature) ToProto() *pb.Signature { - return &pb.Signature{ - Value: s.Value, - Signer: s.Signer, - Scheme: s.Scheme, - MultiHashType: s.MultiHashType, - Timestamp: s.Timestamp, - } -} - -func (s *Signature) ToDomain(pbSignature *pb.Signature) { - s.Value = pbSignature.Value - s.Signer = pbSignature.Signer - s.Scheme = pbSignature.Scheme - s.MultiHashType = pbSignature.MultiHashType - s.Timestamp = pbSignature.Timestamp -} - -func (s *Signature) MarshalProto() ([]byte, error) { - return proto.Marshal(s.ToProto()) -} - -func (s *Signature) UnmarshalProto(signatureAsBytes []byte) error { - signature := &pb.Signature{} - if err := proto.Unmarshal(signatureAsBytes, signature); err != nil { - return err - } - - s.ToDomain(signature) - return nil -} - -func (s *Signature) DecodedValue() ([]byte, error) { - if len(s.Value) > 64 { - signature, err := decodeHex(s.Value) - if err != nil { - return nil, errors.New("unable to decode hex signature") - } - - return signature, nil - } - - return s.Value, nil -} - -func (s *Signature) DecodedSigner() ([]byte, error) { - if len(s.Signer) > 32 { - signer, err := decodeHex(s.Signer) - if err != nil { - return nil, errors.New("unable to decode hex signer") - } - - return signer, nil - } - - return s.Signer, nil -} - -func decodeHex(src []byte) ([]byte, error) { - src = bytes.TrimPrefix(src, []byte("0x")) - decoded := make([]byte, hex.DecodedLen(len(src))) - _, err := hex.Decode(decoded, src) - return decoded, err -} diff --git a/model/domain/signedpiece.go b/model/domain/signedpiece.go deleted file mode 100644 index a124927..0000000 --- a/model/domain/signedpiece.go +++ /dev/null @@ -1,138 +0,0 @@ -package domain - -import ( - "errors" - "fmt" - "time" - - "github.com/cerebellum-network/cere-ddc-sdk-go/core/pkg/cid" - "github.com/cerebellum-network/cere-ddc-sdk-go/core/pkg/crypto" - "github.com/cerebellum-network/cere-ddc-sdk-go/model/pb" - "google.golang.org/protobuf/proto" -) - -// ## Generation of a SignedPiece: -// -// 1. Prepare a `Piece` structure and its ProtoBuf serialization. -// 2. Prepare a `Signature` structure with its details except `Value`. -// 3. Pass those to `NewSignedPiece(…)`. -// 4. Use `SigneableCid()` to generate a signeable message, and a CID of the piece. -// 5. Generate a signature of the `signeable` message using `crypto.CreateScheme(…)`. -// 6. Store the signature with `SetSignature()`. -// 7. Serialize the SignedPiece with `MarshalProto()` for transmission or storage. -// 8. Use the CID above as a permanent identifier of the piece. -// -// ## Verification of a SignedPiece: -// -// 1. Deserialize using `UnmarshalProto()`. -// 2. Call `Verify()`. -// 3. If the piece is to be forwarded or stored, use the original serialization (do not re-serialize). -// -type SignedPiece struct { - pieceSerial []byte - Signature *Signature - - piece *Piece -} - -var _ Protobufable = (*SignedPiece)(nil) - -func NewSignedPiece(piece *Piece, pieceSerial []byte, sig *Signature) *SignedPiece { - return &SignedPiece{ - pieceSerial: pieceSerial, - Signature: sig, - piece: piece, - } -} - -func (sp *SignedPiece) ToProto() *pb.SignedPiece { - return &pb.SignedPiece{ - Piece: sp.pieceSerial, - Signature: sp.Signature.ToProto(), - } -} - -func (sp *SignedPiece) ToDomain(pbSignedPiece *pb.SignedPiece) error { - sp.pieceSerial = pbSignedPiece.Piece - - sp.Signature = &Signature{} - sp.Signature.ToDomain(pbSignedPiece.Signature) - - sp.piece = &Piece{} - return sp.piece.UnmarshalProto(sp.pieceSerial) -} - -func (sp *SignedPiece) MarshalProto() ([]byte, error) { - return proto.Marshal(sp.ToProto()) -} - -func (sp *SignedPiece) UnmarshalProto(signedPieceAsBytes []byte) error { - pbSignedPiece := &pb.SignedPiece{} - if err := proto.Unmarshal(signedPieceAsBytes, pbSignedPiece); err != nil { - return err - } - - return sp.ToDomain(pbSignedPiece) -} - -func (sp *SignedPiece) PieceSerial() []byte { - return sp.pieceSerial -} - -func (sp *SignedPiece) Piece() *Piece { - return sp.piece -} - -func (sp *SignedPiece) PieceCid() (string, error) { - return cid.CreateBuilder(sp.Signature.MultiHashType).Build(sp.PieceSerial()) -} - -func (sp *SignedPiece) SigneableCid() (signeable []byte, pieceCid string, err error) { - pieceCid, err = sp.PieceCid() - if err != nil { - return nil, "", err - } - - if sp.Signature.Timestamp == 0 { - return []byte(pieceCid), pieceCid, nil - } - - timeText := formatTimestamp(sp.Signature.Timestamp) - message := fmt.Sprintf("DDC store %s at %s", pieceCid, timeText) - - return []byte(message), pieceCid, nil -} - -func (sp *SignedPiece) SetSignature(sig []byte) { - sp.Signature.Value = sig -} - -var ErrInvalidSignature = errors.New("invalid signature") - -func (sp *SignedPiece) Verify() (string, []byte, error) { - sig, err := sp.Signature.DecodedValue() - if err != nil { - return "", nil, err - } - signer, err := sp.Signature.DecodedSigner() - if err != nil { - return "", nil, err - } - signeable, pieceCid, err := sp.SigneableCid() - if err != nil { - return "", nil, err - } - - if ok, err := crypto.Verify(crypto.SchemeName(sp.Signature.Scheme), signer, signeable, sig); err != nil { - return "", nil, err - } else if !ok { - return "", nil, ErrInvalidSignature - } - - return pieceCid, signeable, nil -} - -// Format the time the same way as JavaScript Date.toISOString() -func formatTimestamp(unixMilli uint64) string { - return time.UnixMilli(int64(unixMilli)).UTC().Format("2006-01-02T15:04:05.000Z") -} diff --git a/model/domain/signedpiece_test.go b/model/domain/signedpiece_test.go deleted file mode 100644 index 735fec2..0000000 --- a/model/domain/signedpiece_test.go +++ /dev/null @@ -1,53 +0,0 @@ -package domain - -import ( - "encoding/hex" - "encoding/json" - "os" - "strings" - "testing" - - "github.com/cerebellum-network/cere-ddc-sdk-go/model/pb" - "github.com/stretchr/testify/require" -) - -type StoreRequest struct { - Body string - Cid string - Piece struct { - Data []byte - Tags []struct { - Searchable string - } - } -} - -func TestStoreRequest(t *testing.T) { - doTestStoreRequest(t, "../../ddc-schemas/test-vectors/store-request-sdk-js-1.1.0.json") - doTestStoreRequest(t, "../../ddc-schemas/test-vectors/store-request-sdk-js-1.2.8.json") - doTestStoreRequest(t, "../../ddc-schemas/test-vectors/store-request-sdk-js-1.2.9.json") -} - -func doTestStoreRequest(t *testing.T, vectorFile string) { - raw, err := os.ReadFile(vectorFile) - require.NoError(t, err) - - request := StoreRequest{} - err = json.Unmarshal(raw, &request) - require.NoError(t, err) - - spSerial, err := hex.DecodeString(strings.TrimPrefix(request.Body, "0x")) - require.NoError(t, err) - - sp := SignedPiece{} - err = sp.UnmarshalProto(spSerial) - require.NoError(t, err) - - cid, _, err := sp.Verify() - require.NoError(t, err) - - require.Equal(t, request.Cid, cid) - require.Equal(t, request.Piece.Data, sp.Piece().Data) - tagType := pb.SearchType_value[request.Piece.Tags[0].Searchable] - require.Equal(t, tagType, int32(sp.Piece().Tags[0].Searchable)) -} diff --git a/model/domain/tag.go b/model/domain/tag.go deleted file mode 100644 index 589a2f7..0000000 --- a/model/domain/tag.go +++ /dev/null @@ -1,42 +0,0 @@ -package domain - -import ( - "github.com/cerebellum-network/cere-ddc-sdk-go/model/pb" - "google.golang.org/protobuf/proto" -) - -type Tag struct { - Key []byte - Value []byte - Searchable pb.SearchType -} - -var _ Protobufable = (*Tag)(nil) - -func (t *Tag) ToProto() *pb.Tag { - return &pb.Tag{ - Key: t.Key, - Value: t.Value, - Searchable: t.Searchable, - } -} - -func (t *Tag) ToDomain(pbTag *pb.Tag) { - t.Key = pbTag.Key - t.Value = pbTag.Value - t.Searchable = pbTag.Searchable -} - -func (t *Tag) MarshalProto() ([]byte, error) { - return proto.Marshal(t.ToProto()) -} - -func (t *Tag) UnmarshalProto(tagAsBytes []byte) error { - tag := &pb.Tag{} - if err := proto.Unmarshal(tagAsBytes, tag); err != nil { - return err - } - - t.ToDomain(tag) - return nil -} diff --git a/model/go.mod b/model/go.mod deleted file mode 100644 index 62235b5..0000000 --- a/model/go.mod +++ /dev/null @@ -1,40 +0,0 @@ -module github.com/cerebellum-network/cere-ddc-sdk-go/model - -require ( - github.com/cerebellum-network/cere-ddc-sdk-go/core v0.1.4-0.20221130103101-ba17e0028844 - github.com/stretchr/testify v1.7.0 - google.golang.org/protobuf v1.27.1 -) - -require ( - github.com/ChainSafe/go-schnorrkel v1.0.0 // indirect - github.com/btcsuite/btcd v0.22.0-beta // indirect - github.com/cosmos/go-bip39 v1.0.0 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/decred/base58 v1.0.3 // indirect - github.com/decred/dcrd/crypto/blake256 v1.0.0 // indirect - github.com/ethereum/go-ethereum v1.10.17 // indirect - github.com/gtank/merlin v0.1.1 // indirect - github.com/gtank/ristretto255 v0.1.2 // indirect - github.com/ipfs/go-cid v0.0.7 // indirect - github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect - github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 // indirect - github.com/minio/sha256-simd v0.1.1-0.20190913151208-6de447530771 // indirect - github.com/mr-tron/base58 v1.1.3 // indirect - github.com/multiformats/go-base32 v0.0.3 // indirect - github.com/multiformats/go-base36 v0.1.0 // indirect - github.com/multiformats/go-multibase v0.0.3 // indirect - github.com/multiformats/go-multihash v0.0.13 // indirect - github.com/multiformats/go-varint v0.0.5 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/sirupsen/logrus v1.8.1 // indirect - github.com/spaolacci/murmur3 v1.1.0 // indirect - github.com/vedhavyas/go-subkey v1.0.3 // indirect - golang.org/x/crypto v0.0.0-20220214200702-86341886e292 // indirect - golang.org/x/sys v0.0.0-20211124211545-fe61309f8881 // indirect - gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect -) - -replace github.com/ethereum/go-ethereum => github.com/ethereum/go-ethereum v1.10.16 - -go 1.18 diff --git a/model/go.sum b/model/go.sum deleted file mode 100644 index 7deedfc..0000000 --- a/model/go.sum +++ /dev/null @@ -1,637 +0,0 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.43.0/go.mod h1:BOSR3VbTLkk6FDC/TcffxP4NF/FFBGA5ku+jvKOP7pg= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.51.0/go.mod h1:hWtGJ6gnXH+KgDv+V0zFGDvpi07n3z8ZNj3T1RW0Gcw= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigtable v1.2.0/go.mod h1:JcVAOl45lrTmQfLj7T6TxyMzIN/3FGGcFm+2xVAli2o= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -collectd.org v0.3.0/go.mod h1:A/8DzQBkF6abtvrT2j/AU/4tiBgJWYyh0y/oB/4MlWE= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/Azure/azure-pipeline-go v0.2.1/go.mod h1:UGSo8XybXnIGZ3epmeBw7Jdz+HiUVpqIlpz/HKHylF4= -github.com/Azure/azure-pipeline-go v0.2.2/go.mod h1:4rQ/NZncSvGqNkkOsNpOU1tgoNuIlp9AfUH5G1tvCHc= -github.com/Azure/azure-storage-blob-go v0.7.0/go.mod h1:f9YQKtsG1nMisotuTPpO0tjNuEjKRYAcJU8/ydDI++4= -github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= -github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= -github.com/Azure/go-autorest/autorest/adal v0.8.0/go.mod h1:Z6vX6WXXuyieHAXwMj0S6HY6e6wcHn37qQMBQlvY3lc= -github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= -github.com/Azure/go-autorest/autorest/date v0.2.0/go.mod h1:vcORJHLJEh643/Ioh9+vPmf1Ij9AEBM5FuBIXLmIy0g= -github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= -github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= -github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM= -github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= -github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= -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/ChainSafe/go-schnorrkel v1.0.0 h1:3aDA67lAykLaG1y3AOjs88dMxC88PgUuHRrLeDnvGIM= -github.com/ChainSafe/go-schnorrkel v1.0.0/go.mod h1:dpzHYVxLZcp8pjlV+O+UR8K0Hp/z7vcchBSbMBEhCw4= -github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= -github.com/VictoriaMetrics/fastcache v1.6.0/go.mod h1:0qHz5QP0GMX4pfmMA/zt5RgfNuXJrTP0zS7DqpHGGTw= -github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= -github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= -github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= -github.com/apache/arrow/go/arrow v0.0.0-20191024131854-af6fa24be0db/go.mod h1:VTxUBvSJ3s3eHAg65PNgrsn5BtqCRPdmyXh6rAfdxN0= -github.com/aws/aws-sdk-go-v2 v1.2.0/go.mod h1:zEQs02YRBw1DjK0PoJv3ygDYOFTre1ejlJWl8FwAuQo= -github.com/aws/aws-sdk-go-v2/config v1.1.1/go.mod h1:0XsVy9lBI/BCXm+2Tuvt39YmdHwS5unDQmxZOYe8F5Y= -github.com/aws/aws-sdk-go-v2/credentials v1.1.1/go.mod h1:mM2iIjwl7LULWtS6JCACyInboHirisUUdkBPoTHMOUo= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.2/go.mod h1:3hGg3PpiEjHnrkrlasTfxFqUsZ2GCk/fMUn4CbKgSkM= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.2/go.mod h1:45MfaXZ0cNbeuT0KQ1XJylq8A6+OpVV2E5kvY/Kq+u8= -github.com/aws/aws-sdk-go-v2/service/route53 v1.1.1/go.mod h1:rLiOUrPLW/Er5kRcQ7NkwbjlijluLsrIbu/iyl35RO4= -github.com/aws/aws-sdk-go-v2/service/sso v1.1.1/go.mod h1:SuZJxklHxLAXgLTc1iFXbEWkXs7QRTQpCLGaKIprQW0= -github.com/aws/aws-sdk-go-v2/service/sts v1.1.1/go.mod h1:Wi0EBZwiz/K44YliU0EKxqTCJGUfYTWXrrBwkq736bM= -github.com/aws/smithy-go v1.1.0/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= -github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c= -github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= -github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= -github.com/btcsuite/btcd v0.22.0-beta h1:LTDpDKUM5EeOFBPM8IXpinEcmZ6FWfNZbE3lfrfdnWo= -github.com/btcsuite/btcd v0.22.0-beta/go.mod h1:9n5ntfhhHQBIhUvlhDvD3Qg6fRUj4jkN0VB8L8svzOA= -github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= -github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= -github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce/go.mod h1:0DVlHczLPewLcPGEIeUEzfOJhqGPQ0mJJRDBtD307+o= -github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= -github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY= -github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I= -github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= -github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= -github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= -github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= -github.com/c-bata/go-prompt v0.2.2/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cerebellum-network/cere-ddc-sdk-go/core v0.1.4-0.20221130103101-ba17e0028844 h1:mQ21MPDAF+IQptgWLJDgkuBDjav8pMKD5EraadKLigQ= -github.com/cerebellum-network/cere-ddc-sdk-go/core v0.1.4-0.20221130103101-ba17e0028844/go.mod h1:/MLxUcNchFegfwzRQ+hpxgZwzRVk6/I88gp9IpuV6So= -github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudflare/cloudflare-go v0.14.0/go.mod h1:EnwdgGMaFOruiPZRFSgn+TsQ3hQ7C/YWzIGLeu5c304= -github.com/consensys/bavard v0.1.8-0.20210406032232-f3452dc9b572/go.mod h1:Bpd0/3mZuaj6Sj+PqrmIquiOKy397AKGThQPaGzNXAQ= -github.com/consensys/gnark-crypto v0.4.1-0.20210426202927-39ac3d4b3f1f/go.mod h1:815PAHg3wvysy0SyIqanF8gZ0Y1wjk/hrDHD/iT88+Q= -github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= -github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= -github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= -github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= -github.com/dave/jennifer v1.2.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg= -github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/deckarep/golang-set v1.8.0/go.mod h1:5nI87KwE7wgsBU1F4GKAw2Qod7p5kyS383rP6+o6qqo= -github.com/decred/base58 v1.0.3 h1:KGZuh8d1WEMIrK0leQRM47W85KqCAdl2N+uagbctdDI= -github.com/decred/base58 v1.0.3/go.mod h1:pXP9cXCfM2sFLb2viz2FNIdeMWmZDBKG3ZBYbiSM78E= -github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0= -github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= -github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= -github.com/deepmap/oapi-codegen v1.6.0/go.mod h1:ryDa9AgbELGeB+YEXE1dR53yAjHwFvE9iAUlWl9Al3M= -github.com/deepmap/oapi-codegen v1.8.2/go.mod h1:YLgSKSDv/bZQB7N4ws6luhozi3cEdRktEqrX88CvjIw= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dgryski/go-bitstream v0.0.0-20180413035011-3522498ce2c8/go.mod h1:VMaSuZ+SZcx/wljOQKvp5srsbCiKDEb6K2wC4+PiBmQ= -github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= -github.com/docker/docker v1.4.2-0.20180625184442-8e610b2b55bf/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/dop251/goja v0.0.0-20211011172007-d99e4b8cbf48/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk= -github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA7c8pLvoGndExHudxTDKZ84Pyvv+90pbBjbTz0Y= -github.com/eclipse/paho.mqtt.golang v1.2.0/go.mod h1:H9keYFcgq3Qr5OUJm/JZI/i6U7joQ8SYLhZwfeOo6Ts= -github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/ethereum/go-ethereum v1.10.16 h1:3oPrumn0bCW/idjcxMn5YYVCdK7VzJYIvwGZUGLEaoc= -github.com/ethereum/go-ethereum v1.10.16/go.mod h1:Anj6cxczl+AHy63o4X9O8yWNHuN5wMpfb8MAnHkWn7Y= -github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= -github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= -github.com/getkin/kin-openapi v0.53.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= -github.com/getkin/kin-openapi v0.61.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE= -github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24= -github.com/go-chi/chi/v5 v5.0.0/go.mod h1:BBug9lr0cqtdAhsu6R4AAdvufI0/XBzAQSsUqJpoZOs= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= -github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= -github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= -github.com/golang/geo v0.0.0-20190916061304-5b978397cfec/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -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= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golangci/lint-1 v0.0.0-20181222135242-d2cdd8c08219/go.mod h1:/X8TswGSh1pIozq4ZwCfxS0WA5JGXguxk94ar/4c87Y= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/flatbuffers v1.11.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/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/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.1.5/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= -github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/graph-gophers/graphql-go v1.3.0/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= -github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= -github.com/gtank/merlin v0.1.1 h1:eQ90iG7K9pOhtereWsmyRJ6RAwcP4tHTDBHXNg+u5is= -github.com/gtank/merlin v0.1.1/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= -github.com/gtank/ristretto255 v0.1.2 h1:JEqUCPA1NvLq5DwYtuzigd7ss8fwbYay9fi4/5uMzcc= -github.com/gtank/ristretto255 v0.1.2/go.mod h1:Ph5OpO6c7xKUGROZfWVLiJf9icMDwUeIvY4OmlYW69o= -github.com/hashicorp/go-bexpr v0.1.10/go.mod h1:oxlubA2vC/gFVfX1A6JGp7ls7uCDlfJn732ehYYg+g0= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA= -github.com/holiman/uint256 v1.2.0/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/huin/goupnp v1.0.2/go.mod h1:0dxJBVBHqTMjIUMkESDTNgOOx/Mw5wYIfyFmdzSamkM= -github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/influxdata/flux v0.65.1/go.mod h1:J754/zds0vvpfwuq7Gc2wRdVwEodfpCFM7mYlOw2LqY= -github.com/influxdata/influxdb v1.8.3/go.mod h1:JugdFhsvvI8gadxOI6noqNeeBHvWNTbfYGtiAn+2jhI= -github.com/influxdata/influxdb-client-go/v2 v2.4.0/go.mod h1:vLNHdxTJkIf2mSLvGrpj8TCcISApPoXkaxP8g9uRlW8= -github.com/influxdata/influxql v1.1.1-0.20200828144457-65d3ef77d385/go.mod h1:gHp9y86a/pxhjJ+zMjNXiQAA197Xk9wLxaz+fGG+kWk= -github.com/influxdata/line-protocol v0.0.0-20180522152040-32c6aa80de5e/go.mod h1:4kt73NQhadE3daL3WhR5EJ/J2ocX0PZzwxQ0gXJ7oFE= -github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo= -github.com/influxdata/line-protocol v0.0.0-20210311194329-9aa0e372d097/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo= -github.com/influxdata/promql/v2 v2.12.0/go.mod h1:fxOPu+DY0bqCTCECchSRtWfc+0X19ybifQhZoQNF5D8= -github.com/influxdata/roaring v0.4.13-0.20180809181101-fc520f41fab6/go.mod h1:bSgUQ7q5ZLSO+bKBGqJiCBGAl+9DxyW63zLTujjUlOE= -github.com/influxdata/tdigest v0.0.0-20181121200506-bf2b5ad3c0a9/go.mod h1:Js0mqiSBE6Ffsg94weZZ2c+v/ciT8QRHFOap7EKDrR0= -github.com/influxdata/usage-client v0.0.0-20160829180054-6d3895376368/go.mod h1:Wbbw6tYNvwa5dlB6304Sd+82Z3f7PmVZHVKU637d4po= -github.com/ipfs/go-cid v0.0.7 h1:ysQJVJA3fNDF1qigJbsSQOdjhVLsOEoPdh0+R97k3jY= -github.com/ipfs/go-cid v0.0.7/go.mod h1:6Ux9z5e+HpkQdckYoX1PG/6xqKspzlEIR5SDmgqgC/I= -github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= -github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e/go.mod h1:G1CVv03EnqU1wYL2dFwXxW2An0az9JTl/ZsqXQeBlkU= -github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= -github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= -github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/jsternberg/zap-logfmt v1.0.0/go.mod h1:uvPs/4X51zdkcm5jXl5SYoN+4RK21K8mysFmDaM/h+o= -github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= -github.com/jwilder/encoding v0.0.0-20170811194829-b4e1701a28ef/go.mod h1:Ct9fl0F6iIOGgxJ5npU/IUOhOhqlVrGjyIZc8/MagT0= -github.com/karalabe/usb v0.0.2/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= -github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= -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.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= -github.com/klauspost/crc32 v0.0.0-20161016154125-cb6bfca970f6/go.mod h1:+ZoRqAPRLkC4NPOvfYeR5KNOrY6TD+/sAC3HXPZgDYg= -github.com/klauspost/pgzip v1.0.2-0.20170402124221-0bf5dcad4ada/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/labstack/echo/v4 v4.2.1/go.mod h1:AA49e0DZ8kk5jTOOCKNuPR6oTnBS0dYiM4FW1e6jwpg= -github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= -github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= -github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/matryer/moq v0.0.0-20190312154309-6cfb0558e1bd/go.mod h1:9ELz6aaclSIGnZBoaSLZ3NAl1VTufbOrXBPvtcy6WiQ= -github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-ieproxy v0.0.0-20190610004146-91bb50d98149/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= -github.com/mattn/go-ieproxy v0.0.0-20190702010315-6dee0af9227d/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= -github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= -github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= -github.com/mattn/go-tty v0.0.0-20180907095812-13ff1204f104/go.mod h1:XPvLUNfbS4fJH25nqRHfWLMa1ONC8Amw+mIA639KxkE= -github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= -github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 h1:QRUSJEgZn2Snx0EmT/QLXibWjSUDjKWvXIT19NBVp94= -github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= -github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 h1:lYpkrQH5ajf0OXOcUbGjvZxxijuBwbbmlSxLiuofa+g= -github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1/go.mod h1:pD8RvIylQ358TN4wwqatJ8rNavkEINozVn9DtGI3dfQ= -github.com/minio/sha256-simd v0.1.1-0.20190913151208-6de447530771 h1:MHkK1uRtFbVqvAgvWxafZe54+5uBxLluGylDiKgdhwo= -github.com/minio/sha256-simd v0.1.1-0.20190913151208-6de447530771/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM= -github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/pointerstructure v1.2.0/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8ohIXc3tViBH44KcwB2g4= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/mr-tron/base58 v1.1.0/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8= -github.com/mr-tron/base58 v1.1.3 h1:v+sk57XuaCKGXpWtVBX8YJzO7hMGx4Aajh4TQbdEFdc= -github.com/mr-tron/base58 v1.1.3/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= -github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae/go.mod h1:qAyveg+e4CE+eKJXWVjKXM4ck2QobLqTDytGJbLLhJg= -github.com/multiformats/go-base32 v0.0.3 h1:tw5+NhuwaOjJCC5Pp82QuXbrmLzWg7uxlMFp8Nq/kkI= -github.com/multiformats/go-base32 v0.0.3/go.mod h1:pLiuGC8y0QR3Ue4Zug5UzK9LjgbkL8NSQj0zQ5Nz/AA= -github.com/multiformats/go-base36 v0.1.0 h1:JR6TyF7JjGd3m6FbLU2cOxhC0Li8z8dLNGQ89tUg4F4= -github.com/multiformats/go-base36 v0.1.0/go.mod h1:kFGE83c6s80PklsHO9sRn2NCoffoRdUUOENyW/Vv6sM= -github.com/multiformats/go-multibase v0.0.3 h1:l/B6bJDQjvQ5G52jw4QGSYeOTZoAwIO77RblWplfIqk= -github.com/multiformats/go-multibase v0.0.3/go.mod h1:5+1R4eQrT3PkYZ24C3W2Ue2tPwIdYQD509ZjSb5y9Oc= -github.com/multiformats/go-multihash v0.0.13 h1:06x+mk/zj1FoMsgNejLpy6QTvJqlSt/BhLEy87zidlc= -github.com/multiformats/go-multihash v0.0.13/go.mod h1:VdAWLKTwram9oKAatUcLxBNUjdtcVwxObEQBtRfuyjc= -github.com/multiformats/go-varint v0.0.5 h1:XVZwSo04Cs3j/jS0uAEPpT3JY6DzMcVLLoWOSnCxOjg= -github.com/multiformats/go-varint v0.0.5/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= -github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/naoina/go-stringutil v0.1.0/go.mod h1:XJ2SJL9jCtBh+P9q5btrd/Ylo8XwT/h1USek5+NqSA0= -github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416/go.mod h1:NBIhNtsFMo3G2szEBne+bO4gS192HuIYRqfvOWb4i1E= -github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/opentracing/opentracing-go v1.0.3-0.20180606204148-bd9c31933947/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/paulbellamy/ratecounter v0.2.0/go.mod h1:Hfx1hDpSGoqxkVVpBi/IlYD7kChlfo5C6hzIHwPqfFE= -github.com/peterh/liner v1.0.1-0.20180619022028-8c1271fcf47f/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc= -github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= -github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= -github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/term v0.0.0-20180730021639-bffc007b7fd5/go.mod h1:eCbImbZ95eXtAUIbLAuAVnBnwf83mjf6QIVH8SHYwqQ= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/retailnext/hllpp v1.0.1-0.20180308014038-101a6d2f8b52/go.mod h1:RDpi1RftBQPUCDRw6SmxeaREsAaRKnOclghuzp/WRzc= -github.com/rjeczalik/notify v0.9.1/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRrjvIXnJho= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= -github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/segmentio/kafka-go v0.1.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= -github.com/segmentio/kafka-go v0.2.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= -github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= -github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.0/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0/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/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.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= -github.com/tinylib/msgp v1.0.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= -github.com/tklauser/go-sysconf v0.3.5/go.mod h1:MkWzOF4RMCshBAMXuhXJs64Rte09mITnppBXY/rYEFI= -github.com/tklauser/numcpus v0.2.2/go.mod h1:x3qojaO3uyYt0i56EW/VUYs7uBvdl2fkfZFu0T9wgjM= -github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= -github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= -github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -github.com/vedhavyas/go-subkey v1.0.3 h1:iKR33BB/akKmcR2PMlXPBeeODjWLM90EL98OrOGs8CA= -github.com/vedhavyas/go-subkey v1.0.3/go.mod h1:CloUaFQSSTdWnINfBRFjVMkWXZANW+nd8+TI5jYcl6Y= -github.com/willf/bitset v1.1.3/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= -github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -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-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190909091759-094676da4a83/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20220214200702-86341886e292 h1:f+lwQ+GtmgoY+A2YaQxlSOnDjXcQ7ZRLWOHbC6HtRqE= -golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -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.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -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= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210220033124-5f55cee0dc0d/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -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= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/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/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/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= -golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/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-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200107162124-548cf772de50/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/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-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210316164454-77fc1eacc6aa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210420205809-ac73e9fd8988/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211124211545-fe61309f8881 h1:TyHqChC80pFkXWraUUf6RuB5IqFdQieMLwwCJokV2pc= -golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/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-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200108203644-89082a384178/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -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/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= -gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= -gonum.org/v1/gonum v0.0.0-20181121035319-3f7ecaa7e8ca/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= -gonum.org/v1/gonum v0.6.0/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU= -gonum.org/v1/netlib v0.0.0-20181029234149-ec6d1f5cefe6/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= -gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= -gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -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/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190716160619-c506a9f90610/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200108215221-bd8f9a0ef82f/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -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.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= -google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= -gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6/go.mod h1:uAJfkITjFhyEEuUfm7bsmCZRbW5WRq8s9EY8HZ6hCns= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/urfave/cli.v1 v1.20.0/go.mod h1:vuBzUtMdQeixQj8LVd+/98pzhxNGQoyuPBlsXHOQNO0= -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.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/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/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= diff --git a/model/pb/ack.pb.go b/model/pb/ack.pb.go deleted file mode 100644 index 002e2c1..0000000 --- a/model/pb/ack.pb.go +++ /dev/null @@ -1,405 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc v4.23.3 -// source: ack.proto - -package pb - -import ( - 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) -) - -// Acknowledgment data -type Ack struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // user timestamp of request in UNIX milliseconds. - Timestamp uint64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - // node public key where gas was used - PublicKey []byte `protobuf:"bytes,2,opt,name=publicKey,proto3" json:"publicKey,omitempty"` - // confirmed used gas - Gas uint64 `protobuf:"varint,3,opt,name=gas,proto3" json:"gas,omitempty"` - // nonce for avoiding ack duplicates - Nonce []byte `protobuf:"bytes,4,opt,name=nonce,proto3" json:"nonce,omitempty"` - // request id for log record - RequestId string `protobuf:"bytes,5,opt,name=requestId,proto3" json:"requestId,omitempty"` - // The CID of the piece. - Cid string `protobuf:"bytes,6,opt,name=cid,proto3" json:"cid,omitempty"` - // session id - SessionId []byte `protobuf:"bytes,7,opt,name=sessionId,proto3" json:"sessionId,omitempty"` - // signature of acknowledgment data - // sign(CID(requestId) + timestamp + gas + nonce + sessionID) - Signature []byte `protobuf:"bytes,8,opt,name=signature,proto3" json:"signature,omitempty"` - // The name of the signature scheme (sr25519, ed25519). - // Default and recommended value: "" or "sr25519". - Scheme string `protobuf:"bytes,9,opt,name=scheme,proto3" json:"scheme,omitempty"` - // The ID of the hashing algorithm as per multiformats/multihash. - // Default and recommended value: 0 or 0xb220, meaning blake2b-256. - MultiHashType uint64 `protobuf:"varint,10,opt,name=multiHashType,proto3" json:"multiHashType,omitempty"` - // list of chunk cIds, requested by client - Chunks []string `protobuf:"bytes,11,rep,name=chunks,proto3" json:"chunks,omitempty"` -} - -func (x *Ack) Reset() { - *x = Ack{} - if protoimpl.UnsafeEnabled { - mi := &file_ack_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Ack) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Ack) ProtoMessage() {} - -func (x *Ack) ProtoReflect() protoreflect.Message { - mi := &file_ack_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 Ack.ProtoReflect.Descriptor instead. -func (*Ack) Descriptor() ([]byte, []int) { - return file_ack_proto_rawDescGZIP(), []int{0} -} - -func (x *Ack) GetTimestamp() uint64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -func (x *Ack) GetPublicKey() []byte { - if x != nil { - return x.PublicKey - } - return nil -} - -func (x *Ack) GetGas() uint64 { - if x != nil { - return x.Gas - } - return 0 -} - -func (x *Ack) GetNonce() []byte { - if x != nil { - return x.Nonce - } - return nil -} - -func (x *Ack) GetRequestId() string { - if x != nil { - return x.RequestId - } - return "" -} - -func (x *Ack) GetCid() string { - if x != nil { - return x.Cid - } - return "" -} - -func (x *Ack) GetSessionId() []byte { - if x != nil { - return x.SessionId - } - return nil -} - -func (x *Ack) GetSignature() []byte { - if x != nil { - return x.Signature - } - return nil -} - -func (x *Ack) GetScheme() string { - if x != nil { - return x.Scheme - } - return "" -} - -func (x *Ack) GetMultiHashType() uint64 { - if x != nil { - return x.MultiHashType - } - return 0 -} - -func (x *Ack) GetChunks() []string { - if x != nil { - return x.Chunks - } - return nil -} - -type AckRecord struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // acknowledgment data - Ack *Ack `protobuf:"bytes,1,opt,name=ack,proto3" json:"ack,omitempty"` - // user public key - PublicKey []byte `protobuf:"bytes,2,opt,name=publicKey,proto3" json:"publicKey,omitempty"` - // timestamp when record was saved in UNIX nanoseconds - Timestamp uint64 `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` -} - -func (x *AckRecord) Reset() { - *x = AckRecord{} - if protoimpl.UnsafeEnabled { - mi := &file_ack_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AckRecord) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AckRecord) ProtoMessage() {} - -func (x *AckRecord) ProtoReflect() protoreflect.Message { - mi := &file_ack_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 AckRecord.ProtoReflect.Descriptor instead. -func (*AckRecord) Descriptor() ([]byte, []int) { - return file_ack_proto_rawDescGZIP(), []int{1} -} - -func (x *AckRecord) GetAck() *Ack { - if x != nil { - return x.Ack - } - return nil -} - -func (x *AckRecord) GetPublicKey() []byte { - if x != nil { - return x.PublicKey - } - return nil -} - -func (x *AckRecord) GetTimestamp() uint64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -// A ack records list -type AckRecordList struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AckRecords []*AckRecord `protobuf:"bytes,1,rep,name=ackRecords,proto3" json:"ackRecords,omitempty"` -} - -func (x *AckRecordList) Reset() { - *x = AckRecordList{} - if protoimpl.UnsafeEnabled { - mi := &file_ack_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AckRecordList) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AckRecordList) ProtoMessage() {} - -func (x *AckRecordList) ProtoReflect() protoreflect.Message { - mi := &file_ack_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 AckRecordList.ProtoReflect.Descriptor instead. -func (*AckRecordList) Descriptor() ([]byte, []int) { - return file_ack_proto_rawDescGZIP(), []int{2} -} - -func (x *AckRecordList) GetAckRecords() []*AckRecord { - if x != nil { - return x.AckRecords - } - return nil -} - -var File_ack_proto protoreflect.FileDescriptor - -var file_ack_proto_rawDesc = []byte{ - 0x0a, 0x09, 0x61, 0x63, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, - 0xab, 0x02, 0x0a, 0x03, 0x41, 0x63, 0x6b, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, - 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, - 0x4b, 0x65, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x67, 0x61, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x03, 0x67, 0x61, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x72, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x73, - 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, - 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, - 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, - 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, - 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x12, - 0x24, 0x0a, 0x0d, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x48, 0x61, 0x73, 0x68, 0x54, 0x79, 0x70, 0x65, - 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x48, 0x61, 0x73, - 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x18, - 0x0b, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x22, 0x66, 0x0a, - 0x09, 0x41, 0x63, 0x6b, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x19, 0x0a, 0x03, 0x61, 0x63, - 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x70, 0x62, 0x2e, 0x41, 0x63, 0x6b, - 0x52, 0x03, 0x61, 0x63, 0x6b, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, - 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, - 0x4b, 0x65, 0x79, 0x12, 0x20, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x02, 0x30, 0x01, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x3e, 0x0a, 0x0d, 0x41, 0x63, 0x6b, 0x52, 0x65, 0x63, 0x6f, - 0x72, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x0a, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x63, - 0x6f, 0x72, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x62, 0x2e, - 0x41, 0x63, 0x6b, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x0a, 0x61, 0x63, 0x6b, 0x52, 0x65, - 0x63, 0x6f, 0x72, 0x64, 0x73, 0x42, 0x05, 0x5a, 0x03, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_ack_proto_rawDescOnce sync.Once - file_ack_proto_rawDescData = file_ack_proto_rawDesc -) - -func file_ack_proto_rawDescGZIP() []byte { - file_ack_proto_rawDescOnce.Do(func() { - file_ack_proto_rawDescData = protoimpl.X.CompressGZIP(file_ack_proto_rawDescData) - }) - return file_ack_proto_rawDescData -} - -var file_ack_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_ack_proto_goTypes = []interface{}{ - (*Ack)(nil), // 0: pb.Ack - (*AckRecord)(nil), // 1: pb.AckRecord - (*AckRecordList)(nil), // 2: pb.AckRecordList -} -var file_ack_proto_depIdxs = []int32{ - 0, // 0: pb.AckRecord.ack:type_name -> pb.Ack - 1, // 1: pb.AckRecordList.ackRecords:type_name -> pb.AckRecord - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name -} - -func init() { file_ack_proto_init() } -func file_ack_proto_init() { - if File_ack_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_ack_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Ack); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ack_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AckRecord); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ack_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AckRecordList); 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_ack_proto_rawDesc, - NumEnums: 0, - NumMessages: 3, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_ack_proto_goTypes, - DependencyIndexes: file_ack_proto_depIdxs, - MessageInfos: file_ack_proto_msgTypes, - }.Build() - File_ack_proto = out.File - file_ack_proto_rawDesc = nil - file_ack_proto_goTypes = nil - file_ack_proto_depIdxs = nil -} diff --git a/model/pb/link.pb.go b/model/pb/link.pb.go deleted file mode 100644 index 474bfee..0000000 --- a/model/pb/link.pb.go +++ /dev/null @@ -1,163 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc v4.23.3 -// source: link.proto - -package pb - -import ( - 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) -) - -// A link is a pointer from one piece to another. -type Link struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The CID of the linked piece. - Cid string `protobuf:"bytes,1,opt,name=cid,proto3" json:"cid,omitempty"` - // The size of the payload of the linked piece. - Size uint64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` - // The name of the linked piece, in the context of the linking piece. - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` -} - -func (x *Link) Reset() { - *x = Link{} - if protoimpl.UnsafeEnabled { - mi := &file_link_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Link) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Link) ProtoMessage() {} - -func (x *Link) ProtoReflect() protoreflect.Message { - mi := &file_link_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 Link.ProtoReflect.Descriptor instead. -func (*Link) Descriptor() ([]byte, []int) { - return file_link_proto_rawDescGZIP(), []int{0} -} - -func (x *Link) GetCid() string { - if x != nil { - return x.Cid - } - return "" -} - -func (x *Link) GetSize() uint64 { - if x != nil { - return x.Size - } - return 0 -} - -func (x *Link) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -var File_link_proto protoreflect.FileDescriptor - -var file_link_proto_rawDesc = []byte{ - 0x0a, 0x0a, 0x6c, 0x69, 0x6e, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, - 0x22, 0x40, 0x0a, 0x04, 0x4c, 0x69, 0x6e, 0x6b, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, - 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x12, - 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x42, 0x05, 0x5a, 0x03, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, -} - -var ( - file_link_proto_rawDescOnce sync.Once - file_link_proto_rawDescData = file_link_proto_rawDesc -) - -func file_link_proto_rawDescGZIP() []byte { - file_link_proto_rawDescOnce.Do(func() { - file_link_proto_rawDescData = protoimpl.X.CompressGZIP(file_link_proto_rawDescData) - }) - return file_link_proto_rawDescData -} - -var file_link_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_link_proto_goTypes = []interface{}{ - (*Link)(nil), // 0: pb.Link -} -var file_link_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_link_proto_init() } -func file_link_proto_init() { - if File_link_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_link_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Link); 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_link_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_link_proto_goTypes, - DependencyIndexes: file_link_proto_depIdxs, - MessageInfos: file_link_proto_msgTypes, - }.Build() - File_link_proto = out.File - file_link_proto_rawDesc = nil - file_link_proto_goTypes = nil - file_link_proto_depIdxs = nil -} diff --git a/model/pb/log_record.pb.go b/model/pb/log_record.pb.go deleted file mode 100644 index 2f43e9b..0000000 --- a/model/pb/log_record.pb.go +++ /dev/null @@ -1,688 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc v4.23.3 -// source: log_record.proto - -package pb - -import ( - 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) -) - -// A log record is a record for logging activity of each request to node. -type LogRecord struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // request's metadata - // - // Types that are assignable to Request: - // - // *LogRecord_WriteRequest - // *LogRecord_ReadRequest - // *LogRecord_QueryRequest - Request isLogRecord_Request `protobuf_oneof:"request"` - // timestamp of request in UNIX nanoseconds. - Timestamp uint64 `protobuf:"varint,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - // ip address of user who sent request - Address string `protobuf:"bytes,5,opt,name=address,proto3" json:"address,omitempty"` - // number of used gas for processing request - Gas uint32 `protobuf:"varint,6,opt,name=gas,proto3" json:"gas,omitempty"` - // users publicKey - PublicKey []byte `protobuf:"bytes,7,opt,name=publicKey,proto3" json:"publicKey,omitempty"` - // session id - SessionId []byte `protobuf:"bytes,9,opt,name=sessionId,proto3" json:"sessionId,omitempty"` - // request id - RequestId string `protobuf:"bytes,10,opt,name=requestId,proto3" json:"requestId,omitempty"` - // list of pieces returned by request - ResponsePieces []*ResponsePiece `protobuf:"bytes,12,rep,name=responsePieces,proto3" json:"responsePieces,omitempty"` -} - -func (x *LogRecord) Reset() { - *x = LogRecord{} - if protoimpl.UnsafeEnabled { - mi := &file_log_record_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *LogRecord) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LogRecord) ProtoMessage() {} - -func (x *LogRecord) ProtoReflect() protoreflect.Message { - mi := &file_log_record_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 LogRecord.ProtoReflect.Descriptor instead. -func (*LogRecord) Descriptor() ([]byte, []int) { - return file_log_record_proto_rawDescGZIP(), []int{0} -} - -func (m *LogRecord) GetRequest() isLogRecord_Request { - if m != nil { - return m.Request - } - return nil -} - -func (x *LogRecord) GetWriteRequest() *WriteRequest { - if x, ok := x.GetRequest().(*LogRecord_WriteRequest); ok { - return x.WriteRequest - } - return nil -} - -func (x *LogRecord) GetReadRequest() *ReadRequest { - if x, ok := x.GetRequest().(*LogRecord_ReadRequest); ok { - return x.ReadRequest - } - return nil -} - -func (x *LogRecord) GetQueryRequest() *QueryRequest { - if x, ok := x.GetRequest().(*LogRecord_QueryRequest); ok { - return x.QueryRequest - } - return nil -} - -func (x *LogRecord) GetTimestamp() uint64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -func (x *LogRecord) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - -func (x *LogRecord) GetGas() uint32 { - if x != nil { - return x.Gas - } - return 0 -} - -func (x *LogRecord) GetPublicKey() []byte { - if x != nil { - return x.PublicKey - } - return nil -} - -func (x *LogRecord) GetSessionId() []byte { - if x != nil { - return x.SessionId - } - return nil -} - -func (x *LogRecord) GetRequestId() string { - if x != nil { - return x.RequestId - } - return "" -} - -func (x *LogRecord) GetResponsePieces() []*ResponsePiece { - if x != nil { - return x.ResponsePieces - } - return nil -} - -type isLogRecord_Request interface { - isLogRecord_Request() -} - -type LogRecord_WriteRequest struct { - // write request metadata - WriteRequest *WriteRequest `protobuf:"bytes,1,opt,name=writeRequest,proto3,oneof"` -} - -type LogRecord_ReadRequest struct { - // read request metadata - ReadRequest *ReadRequest `protobuf:"bytes,2,opt,name=readRequest,proto3,oneof"` -} - -type LogRecord_QueryRequest struct { - // search request metadata - QueryRequest *QueryRequest `protobuf:"bytes,3,opt,name=queryRequest,proto3,oneof"` -} - -func (*LogRecord_WriteRequest) isLogRecord_Request() {} - -func (*LogRecord_ReadRequest) isLogRecord_Request() {} - -func (*LogRecord_QueryRequest) isLogRecord_Request() {} - -// A log records list -type LogRecordList struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - LogRecords []*LogRecord `protobuf:"bytes,1,rep,name=logRecords,proto3" json:"logRecords,omitempty"` -} - -func (x *LogRecordList) Reset() { - *x = LogRecordList{} - if protoimpl.UnsafeEnabled { - mi := &file_log_record_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *LogRecordList) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LogRecordList) ProtoMessage() {} - -func (x *LogRecordList) ProtoReflect() protoreflect.Message { - mi := &file_log_record_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 LogRecordList.ProtoReflect.Descriptor instead. -func (*LogRecordList) Descriptor() ([]byte, []int) { - return file_log_record_proto_rawDescGZIP(), []int{1} -} - -func (x *LogRecordList) GetLogRecords() []*LogRecord { - if x != nil { - return x.LogRecords - } - return nil -} - -// A write request is a container of metadata for upload piece requests -type WriteRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // CID of saved piece - Cid string `protobuf:"bytes,1,opt,name=cid,proto3" json:"cid,omitempty"` - // bucket identifier where was stored piece - BucketId uint32 `protobuf:"varint,2,opt,name=bucketId,proto3" json:"bucketId,omitempty"` - // size of stored piece - Size uint32 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"` - // piece signature - Signature *Signature `protobuf:"bytes,4,opt,name=signature,proto3" json:"signature,omitempty"` -} - -func (x *WriteRequest) Reset() { - *x = WriteRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_log_record_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *WriteRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*WriteRequest) ProtoMessage() {} - -func (x *WriteRequest) ProtoReflect() protoreflect.Message { - mi := &file_log_record_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 WriteRequest.ProtoReflect.Descriptor instead. -func (*WriteRequest) Descriptor() ([]byte, []int) { - return file_log_record_proto_rawDescGZIP(), []int{2} -} - -func (x *WriteRequest) GetCid() string { - if x != nil { - return x.Cid - } - return "" -} - -func (x *WriteRequest) GetBucketId() uint32 { - if x != nil { - return x.BucketId - } - return 0 -} - -func (x *WriteRequest) GetSize() uint32 { - if x != nil { - return x.Size - } - return 0 -} - -func (x *WriteRequest) GetSignature() *Signature { - if x != nil { - return x.Signature - } - return nil -} - -// A read request is a container of metadata for download piece requests -type ReadRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // CID of requested piece - Cid string `protobuf:"bytes,1,opt,name=cid,proto3" json:"cid,omitempty"` - // bucket identifier of requested piece - BucketId uint32 `protobuf:"varint,2,opt,name=bucketId,proto3" json:"bucketId,omitempty"` - // piece signature - Signature *Signature `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"` -} - -func (x *ReadRequest) Reset() { - *x = ReadRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_log_record_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ReadRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ReadRequest) ProtoMessage() {} - -func (x *ReadRequest) ProtoReflect() protoreflect.Message { - mi := &file_log_record_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 ReadRequest.ProtoReflect.Descriptor instead. -func (*ReadRequest) Descriptor() ([]byte, []int) { - return file_log_record_proto_rawDescGZIP(), []int{3} -} - -func (x *ReadRequest) GetCid() string { - if x != nil { - return x.Cid - } - return "" -} - -func (x *ReadRequest) GetBucketId() uint32 { - if x != nil { - return x.BucketId - } - return 0 -} - -func (x *ReadRequest) GetSignature() *Signature { - if x != nil { - return x.Signature - } - return nil -} - -// A query request is a container of metadata for search requests -type QueryRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // query for search - Query *Query `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` -} - -func (x *QueryRequest) Reset() { - *x = QueryRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_log_record_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *QueryRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QueryRequest) ProtoMessage() {} - -func (x *QueryRequest) ProtoReflect() protoreflect.Message { - mi := &file_log_record_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 QueryRequest.ProtoReflect.Descriptor instead. -func (*QueryRequest) Descriptor() ([]byte, []int) { - return file_log_record_proto_rawDescGZIP(), []int{4} -} - -func (x *QueryRequest) GetQuery() *Query { - if x != nil { - return x.Query - } - return nil -} - -type ResponsePiece struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // CID of piece - Cid string `protobuf:"bytes,1,opt,name=cid,proto3" json:"cid,omitempty"` - // size of piece - Size uint32 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"` -} - -func (x *ResponsePiece) Reset() { - *x = ResponsePiece{} - if protoimpl.UnsafeEnabled { - mi := &file_log_record_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ResponsePiece) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ResponsePiece) ProtoMessage() {} - -func (x *ResponsePiece) ProtoReflect() protoreflect.Message { - mi := &file_log_record_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 ResponsePiece.ProtoReflect.Descriptor instead. -func (*ResponsePiece) Descriptor() ([]byte, []int) { - return file_log_record_proto_rawDescGZIP(), []int{5} -} - -func (x *ResponsePiece) GetCid() string { - if x != nil { - return x.Cid - } - return "" -} - -func (x *ResponsePiece) GetSize() uint32 { - if x != nil { - return x.Size - } - return 0 -} - -var File_log_record_proto protoreflect.FileDescriptor - -var file_log_record_proto_rawDesc = []byte{ - 0x0a, 0x10, 0x6c, 0x6f, 0x67, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x0f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0b, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9e, 0x03, 0x0a, 0x09, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x63, 0x6f, - 0x72, 0x64, 0x12, 0x36, 0x0a, 0x0c, 0x77, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x57, 0x72, - 0x69, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0c, 0x77, 0x72, - 0x69, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x33, 0x0a, 0x0b, 0x72, 0x65, - 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x48, 0x00, 0x52, 0x0b, 0x72, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x36, 0x0a, 0x0c, 0x71, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0c, 0x71, 0x75, 0x65, 0x72, 0x79, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x42, 0x02, 0x30, 0x01, 0x52, 0x09, - 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x67, 0x61, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x03, 0x67, 0x61, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, - 0x65, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, - 0x4b, 0x65, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, - 0x18, 0x09, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, - 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x18, 0x0a, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, - 0x39, 0x0a, 0x0e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x69, 0x65, 0x63, 0x65, - 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x69, 0x65, 0x63, 0x65, 0x52, 0x0e, 0x72, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x69, 0x65, 0x63, 0x65, 0x73, 0x42, 0x09, 0x0a, 0x07, 0x72, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x3e, 0x0a, 0x0d, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x63, 0x6f, - 0x72, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x52, 0x65, 0x63, - 0x6f, 0x72, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x62, 0x2e, - 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x0a, 0x6c, 0x6f, 0x67, 0x52, 0x65, - 0x63, 0x6f, 0x72, 0x64, 0x73, 0x22, 0x7d, 0x0a, 0x0c, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x63, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x75, 0x63, 0x6b, 0x65, - 0x74, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x62, 0x75, 0x63, 0x6b, 0x65, - 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x2b, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x62, 0x2e, - 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x22, 0x68, 0x0a, 0x0b, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x63, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x49, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x49, - 0x64, 0x12, 0x2b, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, - 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x2f, - 0x0a, 0x0c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, - 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, - 0x70, 0x62, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, - 0x35, 0x0a, 0x0d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x69, 0x65, 0x63, 0x65, - 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, - 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x42, 0x05, 0x5a, 0x03, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_log_record_proto_rawDescOnce sync.Once - file_log_record_proto_rawDescData = file_log_record_proto_rawDesc -) - -func file_log_record_proto_rawDescGZIP() []byte { - file_log_record_proto_rawDescOnce.Do(func() { - file_log_record_proto_rawDescData = protoimpl.X.CompressGZIP(file_log_record_proto_rawDescData) - }) - return file_log_record_proto_rawDescData -} - -var file_log_record_proto_msgTypes = make([]protoimpl.MessageInfo, 6) -var file_log_record_proto_goTypes = []interface{}{ - (*LogRecord)(nil), // 0: pb.LogRecord - (*LogRecordList)(nil), // 1: pb.LogRecordList - (*WriteRequest)(nil), // 2: pb.WriteRequest - (*ReadRequest)(nil), // 3: pb.ReadRequest - (*QueryRequest)(nil), // 4: pb.QueryRequest - (*ResponsePiece)(nil), // 5: pb.ResponsePiece - (*Signature)(nil), // 6: pb.Signature - (*Query)(nil), // 7: pb.Query -} -var file_log_record_proto_depIdxs = []int32{ - 2, // 0: pb.LogRecord.writeRequest:type_name -> pb.WriteRequest - 3, // 1: pb.LogRecord.readRequest:type_name -> pb.ReadRequest - 4, // 2: pb.LogRecord.queryRequest:type_name -> pb.QueryRequest - 5, // 3: pb.LogRecord.responsePieces:type_name -> pb.ResponsePiece - 0, // 4: pb.LogRecordList.logRecords:type_name -> pb.LogRecord - 6, // 5: pb.WriteRequest.signature:type_name -> pb.Signature - 6, // 6: pb.ReadRequest.signature:type_name -> pb.Signature - 7, // 7: pb.QueryRequest.query:type_name -> pb.Query - 8, // [8:8] is the sub-list for method output_type - 8, // [8:8] is the sub-list for method input_type - 8, // [8:8] is the sub-list for extension type_name - 8, // [8:8] is the sub-list for extension extendee - 0, // [0:8] is the sub-list for field type_name -} - -func init() { file_log_record_proto_init() } -func file_log_record_proto_init() { - if File_log_record_proto != nil { - return - } - file_signature_proto_init() - file_query_proto_init() - if !protoimpl.UnsafeEnabled { - file_log_record_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LogRecord); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_log_record_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LogRecordList); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_log_record_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WriteRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_log_record_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ReadRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_log_record_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_log_record_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResponsePiece); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_log_record_proto_msgTypes[0].OneofWrappers = []interface{}{ - (*LogRecord_WriteRequest)(nil), - (*LogRecord_ReadRequest)(nil), - (*LogRecord_QueryRequest)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_log_record_proto_rawDesc, - NumEnums: 0, - NumMessages: 6, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_log_record_proto_goTypes, - DependencyIndexes: file_log_record_proto_depIdxs, - MessageInfos: file_log_record_proto_msgTypes, - }.Build() - File_log_record_proto = out.File - file_log_record_proto_rawDesc = nil - file_log_record_proto_goTypes = nil - file_log_record_proto_depIdxs = nil -} diff --git a/model/pb/piece.pb.go b/model/pb/piece.pb.go deleted file mode 100644 index fa3687e..0000000 --- a/model/pb/piece.pb.go +++ /dev/null @@ -1,185 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc v4.23.3 -// source: piece.proto - -package pb - -import ( - 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) -) - -// A piece is a container of data and metadata. -// It is the smallest indivisible unit stored in DDC object storage. -type Piece struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The opaque payload carried by the piece. - Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` - // The ID of a bucket that contains the piece. - BucketId uint32 `protobuf:"varint,2,opt,name=bucketId,proto3" json:"bucketId,omitempty"` - // A list of tags with which the piece may be searched. - // There can be multiple tags with the same key. - Tags []*Tag `protobuf:"bytes,3,rep,name=tags,proto3" json:"tags,omitempty"` - // A list of links to other pieces. - // If this piece is interpreted as a file, the linked pieces make up the file content. - Links []*Link `protobuf:"bytes,4,rep,name=links,proto3" json:"links,omitempty"` -} - -func (x *Piece) Reset() { - *x = Piece{} - if protoimpl.UnsafeEnabled { - mi := &file_piece_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Piece) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Piece) ProtoMessage() {} - -func (x *Piece) ProtoReflect() protoreflect.Message { - mi := &file_piece_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 Piece.ProtoReflect.Descriptor instead. -func (*Piece) Descriptor() ([]byte, []int) { - return file_piece_proto_rawDescGZIP(), []int{0} -} - -func (x *Piece) GetData() []byte { - if x != nil { - return x.Data - } - return nil -} - -func (x *Piece) GetBucketId() uint32 { - if x != nil { - return x.BucketId - } - return 0 -} - -func (x *Piece) GetTags() []*Tag { - if x != nil { - return x.Tags - } - return nil -} - -func (x *Piece) GetLinks() []*Link { - if x != nil { - return x.Links - } - return nil -} - -var File_piece_proto protoreflect.FileDescriptor - -var file_piece_proto_rawDesc = []byte{ - 0x0a, 0x0b, 0x70, 0x69, 0x65, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, - 0x62, 0x1a, 0x0a, 0x6c, 0x69, 0x6e, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x09, 0x74, - 0x61, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x74, 0x0a, 0x05, 0x50, 0x69, 0x65, 0x63, - 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x49, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x49, - 0x64, 0x12, 0x1b, 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x07, 0x2e, 0x70, 0x62, 0x2e, 0x54, 0x61, 0x67, 0x52, 0x04, 0x74, 0x61, 0x67, 0x73, 0x12, 0x1e, - 0x0a, 0x05, 0x6c, 0x69, 0x6e, 0x6b, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, - 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x05, 0x6c, 0x69, 0x6e, 0x6b, 0x73, 0x42, 0x05, - 0x5a, 0x03, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_piece_proto_rawDescOnce sync.Once - file_piece_proto_rawDescData = file_piece_proto_rawDesc -) - -func file_piece_proto_rawDescGZIP() []byte { - file_piece_proto_rawDescOnce.Do(func() { - file_piece_proto_rawDescData = protoimpl.X.CompressGZIP(file_piece_proto_rawDescData) - }) - return file_piece_proto_rawDescData -} - -var file_piece_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_piece_proto_goTypes = []interface{}{ - (*Piece)(nil), // 0: pb.Piece - (*Tag)(nil), // 1: pb.Tag - (*Link)(nil), // 2: pb.Link -} -var file_piece_proto_depIdxs = []int32{ - 1, // 0: pb.Piece.tags:type_name -> pb.Tag - 2, // 1: pb.Piece.links:type_name -> pb.Link - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name -} - -func init() { file_piece_proto_init() } -func file_piece_proto_init() { - if File_piece_proto != nil { - return - } - file_link_proto_init() - file_tag_proto_init() - if !protoimpl.UnsafeEnabled { - file_piece_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Piece); 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_piece_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_piece_proto_goTypes, - DependencyIndexes: file_piece_proto_depIdxs, - MessageInfos: file_piece_proto_msgTypes, - }.Build() - File_piece_proto = out.File - file_piece_proto_rawDesc = nil - file_piece_proto_goTypes = nil - file_piece_proto_depIdxs = nil -} diff --git a/model/pb/query.pb.go b/model/pb/query.pb.go deleted file mode 100644 index d89fab4..0000000 --- a/model/pb/query.pb.go +++ /dev/null @@ -1,169 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc v4.23.3 -// source: query.proto - -package pb - -import ( - 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) -) - -// A query represents a search of pieces by tags. -type Query struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ID of the bucket to search. - BucketId uint32 `protobuf:"varint,1,opt,name=bucketId,proto3" json:"bucketId,omitempty"` - // A list of tags to match against the tags of stored pieces. - // There can be multiple tags with the same key. - Tags []*Tag `protobuf:"bytes,2,rep,name=tags,proto3" json:"tags,omitempty"` - // Skip piece data in search result. - SkipData bool `protobuf:"varint,3,opt,name=skipData,proto3" json:"skipData,omitempty"` -} - -func (x *Query) Reset() { - *x = Query{} - if protoimpl.UnsafeEnabled { - mi := &file_query_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Query) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Query) ProtoMessage() {} - -func (x *Query) ProtoReflect() protoreflect.Message { - mi := &file_query_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 Query.ProtoReflect.Descriptor instead. -func (*Query) Descriptor() ([]byte, []int) { - return file_query_proto_rawDescGZIP(), []int{0} -} - -func (x *Query) GetBucketId() uint32 { - if x != nil { - return x.BucketId - } - return 0 -} - -func (x *Query) GetTags() []*Tag { - if x != nil { - return x.Tags - } - return nil -} - -func (x *Query) GetSkipData() bool { - if x != nil { - return x.SkipData - } - return false -} - -var File_query_proto protoreflect.FileDescriptor - -var file_query_proto_rawDesc = []byte{ - 0x0a, 0x0b, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, - 0x62, 0x1a, 0x09, 0x74, 0x61, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x5c, 0x0a, 0x05, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x49, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x49, - 0x64, 0x12, 0x1b, 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x07, 0x2e, 0x70, 0x62, 0x2e, 0x54, 0x61, 0x67, 0x52, 0x04, 0x74, 0x61, 0x67, 0x73, 0x12, 0x1a, - 0x0a, 0x08, 0x73, 0x6b, 0x69, 0x70, 0x44, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x08, 0x73, 0x6b, 0x69, 0x70, 0x44, 0x61, 0x74, 0x61, 0x42, 0x05, 0x5a, 0x03, 0x2f, 0x70, - 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_query_proto_rawDescOnce sync.Once - file_query_proto_rawDescData = file_query_proto_rawDesc -) - -func file_query_proto_rawDescGZIP() []byte { - file_query_proto_rawDescOnce.Do(func() { - file_query_proto_rawDescData = protoimpl.X.CompressGZIP(file_query_proto_rawDescData) - }) - return file_query_proto_rawDescData -} - -var file_query_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_query_proto_goTypes = []interface{}{ - (*Query)(nil), // 0: pb.Query - (*Tag)(nil), // 1: pb.Tag -} -var file_query_proto_depIdxs = []int32{ - 1, // 0: pb.Query.tags:type_name -> pb.Tag - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_query_proto_init() } -func file_query_proto_init() { - if File_query_proto != nil { - return - } - file_tag_proto_init() - if !protoimpl.UnsafeEnabled { - file_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Query); 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_query_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_query_proto_goTypes, - DependencyIndexes: file_query_proto_depIdxs, - MessageInfos: file_query_proto_msgTypes, - }.Build() - File_query_proto = out.File - file_query_proto_rawDesc = nil - file_query_proto_goTypes = nil - file_query_proto_depIdxs = nil -} diff --git a/model/pb/request.pb.go b/model/pb/request.pb.go deleted file mode 100644 index 7f116f7..0000000 --- a/model/pb/request.pb.go +++ /dev/null @@ -1,210 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc v4.23.3 -// source: request.proto - -package pb - -import ( - 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) -) - -// Request structure for API v1 -type Request struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Request body - Body []byte `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // User public key - PublicKey []byte `protobuf:"bytes,3,opt,name=publicKey,proto3" json:"publicKey,omitempty"` - // User signature sign(CID(HTTP method size + HTTP method + url size + url + varint body size + body + varint sessionId size + sessionId)) - Signature []byte `protobuf:"bytes,4,opt,name=signature,proto3" json:"signature,omitempty"` - // The name of the signature scheme (sr25519, ed25519). - // Default and recommended value: "" or "sr25519". - Scheme string `protobuf:"bytes,5,opt,name=scheme,proto3" json:"scheme,omitempty"` - // The ID of the hashing algorithm as per multiformats/multihash. - // Default and recommended value: 0 or 0xb220, meaning blake2b-256. - MultiHashType uint64 `protobuf:"varint,6,opt,name=multiHashType,proto3" json:"multiHashType,omitempty"` - // Session Id - SessionId []byte `protobuf:"bytes,7,opt,name=sessionId,proto3" json:"sessionId,omitempty"` - // Request ID - RequestId string `protobuf:"bytes,8,opt,name=requestId,proto3" json:"requestId,omitempty"` -} - -func (x *Request) Reset() { - *x = Request{} - if protoimpl.UnsafeEnabled { - mi := &file_request_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Request) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Request) ProtoMessage() {} - -func (x *Request) ProtoReflect() protoreflect.Message { - mi := &file_request_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 Request.ProtoReflect.Descriptor instead. -func (*Request) Descriptor() ([]byte, []int) { - return file_request_proto_rawDescGZIP(), []int{0} -} - -func (x *Request) GetBody() []byte { - if x != nil { - return x.Body - } - return nil -} - -func (x *Request) GetPublicKey() []byte { - if x != nil { - return x.PublicKey - } - return nil -} - -func (x *Request) GetSignature() []byte { - if x != nil { - return x.Signature - } - return nil -} - -func (x *Request) GetScheme() string { - if x != nil { - return x.Scheme - } - return "" -} - -func (x *Request) GetMultiHashType() uint64 { - if x != nil { - return x.MultiHashType - } - return 0 -} - -func (x *Request) GetSessionId() []byte { - if x != nil { - return x.SessionId - } - return nil -} - -func (x *Request) GetRequestId() string { - if x != nil { - return x.RequestId - } - return "" -} - -var File_request_proto protoreflect.FileDescriptor - -var file_request_proto_rawDesc = []byte{ - 0x0a, 0x0d, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, - 0x02, 0x70, 0x62, 0x22, 0xd3, 0x01, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x62, - 0x6f, 0x64, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, - 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, - 0x16, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x6d, 0x75, 0x6c, 0x74, 0x69, - 0x48, 0x61, 0x73, 0x68, 0x54, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, - 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x48, 0x61, 0x73, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1c, 0x0a, - 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x72, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x42, 0x05, 0x5a, 0x03, 0x2f, 0x70, 0x62, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_request_proto_rawDescOnce sync.Once - file_request_proto_rawDescData = file_request_proto_rawDesc -) - -func file_request_proto_rawDescGZIP() []byte { - file_request_proto_rawDescOnce.Do(func() { - file_request_proto_rawDescData = protoimpl.X.CompressGZIP(file_request_proto_rawDescData) - }) - return file_request_proto_rawDescData -} - -var file_request_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_request_proto_goTypes = []interface{}{ - (*Request)(nil), // 0: pb.Request -} -var file_request_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_request_proto_init() } -func file_request_proto_init() { - if File_request_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_request_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Request); 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_request_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_request_proto_goTypes, - DependencyIndexes: file_request_proto_depIdxs, - MessageInfos: file_request_proto_msgTypes, - }.Build() - File_request_proto = out.File - file_request_proto_rawDesc = nil - file_request_proto_goTypes = nil - file_request_proto_depIdxs = nil -} diff --git a/model/pb/response.pb.go b/model/pb/response.pb.go deleted file mode 100644 index 5d6f4b1..0000000 --- a/model/pb/response.pb.go +++ /dev/null @@ -1,335 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc v4.23.3 -// source: response.proto - -package pb - -import ( - 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) -) - -// Response codes -type Code int32 - -const ( - Code_SUCCESS Code = 0 - Code_CREATED Code = 1 - Code_NOT_FOUND Code = 2 - Code_FAILED_READ_BODY Code = 3 - Code_FAILED_UNMARSHAL_BODY Code = 4 - Code_FAILED_MARSHAL_BODY Code = 5 - Code_FAILED_GET_BLOCKCHAIN_DATA Code = 6 - Code_BUCKET_RENT_EXPIRED Code = 7 - Code_INVALID_PUBLIC_KEY Code = 8 - Code_INVALID_SIGNATURE Code = 9 - Code_INVALID_PARAMETER Code = 10 - Code_BUCKET_NO_ACCESS Code = 11 - Code_INTERNAL_ERROR Code = 12 - Code_BAD_GATEWAY Code = 13 - Code_INVALID_SESSION_ID Code = 14 - Code_ACCOUNT_DEPOSIT_REQUIRED Code = 15 - Code_GAS_EXPIRED Code = 16 - Code_REQUEST_TOO_LARGE Code = 17 -) - -// Enum value maps for Code. -var ( - Code_name = map[int32]string{ - 0: "SUCCESS", - 1: "CREATED", - 2: "NOT_FOUND", - 3: "FAILED_READ_BODY", - 4: "FAILED_UNMARSHAL_BODY", - 5: "FAILED_MARSHAL_BODY", - 6: "FAILED_GET_BLOCKCHAIN_DATA", - 7: "BUCKET_RENT_EXPIRED", - 8: "INVALID_PUBLIC_KEY", - 9: "INVALID_SIGNATURE", - 10: "INVALID_PARAMETER", - 11: "BUCKET_NO_ACCESS", - 12: "INTERNAL_ERROR", - 13: "BAD_GATEWAY", - 14: "INVALID_SESSION_ID", - 15: "ACCOUNT_DEPOSIT_REQUIRED", - 16: "GAS_EXPIRED", - 17: "REQUEST_TOO_LARGE", - } - Code_value = map[string]int32{ - "SUCCESS": 0, - "CREATED": 1, - "NOT_FOUND": 2, - "FAILED_READ_BODY": 3, - "FAILED_UNMARSHAL_BODY": 4, - "FAILED_MARSHAL_BODY": 5, - "FAILED_GET_BLOCKCHAIN_DATA": 6, - "BUCKET_RENT_EXPIRED": 7, - "INVALID_PUBLIC_KEY": 8, - "INVALID_SIGNATURE": 9, - "INVALID_PARAMETER": 10, - "BUCKET_NO_ACCESS": 11, - "INTERNAL_ERROR": 12, - "BAD_GATEWAY": 13, - "INVALID_SESSION_ID": 14, - "ACCOUNT_DEPOSIT_REQUIRED": 15, - "GAS_EXPIRED": 16, - "REQUEST_TOO_LARGE": 17, - } -) - -func (x Code) Enum() *Code { - p := new(Code) - *p = x - return p -} - -func (x Code) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Code) Descriptor() protoreflect.EnumDescriptor { - return file_response_proto_enumTypes[0].Descriptor() -} - -func (Code) Type() protoreflect.EnumType { - return &file_response_proto_enumTypes[0] -} - -func (x Code) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Code.Descriptor instead. -func (Code) EnumDescriptor() ([]byte, []int) { - return file_response_proto_rawDescGZIP(), []int{0} -} - -// Response structure for API v1 -type Response struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Response body - Body []byte `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Response code - ResponseCode Code `protobuf:"varint,2,opt,name=responseCode,proto3,enum=pb.Code" json:"responseCode,omitempty"` - // Used gas for executing request - Gas uint32 `protobuf:"varint,3,opt,name=gas,proto3" json:"gas,omitempty"` - // CDN public key - PublicKey []byte `protobuf:"bytes,4,opt,name=publicKey,proto3" json:"publicKey,omitempty"` - // CDN signature sign(CID(varint body + body + varint response code + varint resources)) - Signature []byte `protobuf:"bytes,5,opt,name=signature,proto3" json:"signature,omitempty"` - // The name of the signature scheme (sr25519, ed25519). - // Default and recommended value: "" or "sr25519". - Scheme string `protobuf:"bytes,6,opt,name=scheme,proto3" json:"scheme,omitempty"` - // The ID of the hashing algorithm as per multiformats/multihash. - // Default and recommended value: 0 or 0xb220, meaning blake2b-256. - MultiHashType uint64 `protobuf:"varint,7,opt,name=multiHashType,proto3" json:"multiHashType,omitempty"` -} - -func (x *Response) Reset() { - *x = Response{} - if protoimpl.UnsafeEnabled { - mi := &file_response_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Response) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Response) ProtoMessage() {} - -func (x *Response) ProtoReflect() protoreflect.Message { - mi := &file_response_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 Response.ProtoReflect.Descriptor instead. -func (*Response) Descriptor() ([]byte, []int) { - return file_response_proto_rawDescGZIP(), []int{0} -} - -func (x *Response) GetBody() []byte { - if x != nil { - return x.Body - } - return nil -} - -func (x *Response) GetResponseCode() Code { - if x != nil { - return x.ResponseCode - } - return Code_SUCCESS -} - -func (x *Response) GetGas() uint32 { - if x != nil { - return x.Gas - } - return 0 -} - -func (x *Response) GetPublicKey() []byte { - if x != nil { - return x.PublicKey - } - return nil -} - -func (x *Response) GetSignature() []byte { - if x != nil { - return x.Signature - } - return nil -} - -func (x *Response) GetScheme() string { - if x != nil { - return x.Scheme - } - return "" -} - -func (x *Response) GetMultiHashType() uint64 { - if x != nil { - return x.MultiHashType - } - return 0 -} - -var File_response_proto protoreflect.FileDescriptor - -var file_response_proto_rawDesc = []byte{ - 0x0a, 0x0e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x12, 0x02, 0x70, 0x62, 0x22, 0xd8, 0x01, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x2c, 0x0a, 0x0c, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x08, 0x2e, 0x70, 0x62, - 0x2e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x43, - 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x67, 0x61, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x03, 0x67, 0x61, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, - 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, - 0x4b, 0x65, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x6d, 0x75, 0x6c, - 0x74, 0x69, 0x48, 0x61, 0x73, 0x68, 0x54, 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x0d, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x48, 0x61, 0x73, 0x68, 0x54, 0x79, 0x70, 0x65, 0x2a, - 0x91, 0x03, 0x0a, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x55, 0x43, 0x43, - 0x45, 0x53, 0x53, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x44, - 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, - 0x02, 0x12, 0x14, 0x0a, 0x10, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x5f, 0x52, 0x45, 0x41, 0x44, - 0x5f, 0x42, 0x4f, 0x44, 0x59, 0x10, 0x03, 0x12, 0x19, 0x0a, 0x15, 0x46, 0x41, 0x49, 0x4c, 0x45, - 0x44, 0x5f, 0x55, 0x4e, 0x4d, 0x41, 0x52, 0x53, 0x48, 0x41, 0x4c, 0x5f, 0x42, 0x4f, 0x44, 0x59, - 0x10, 0x04, 0x12, 0x17, 0x0a, 0x13, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x5f, 0x4d, 0x41, 0x52, - 0x53, 0x48, 0x41, 0x4c, 0x5f, 0x42, 0x4f, 0x44, 0x59, 0x10, 0x05, 0x12, 0x1e, 0x0a, 0x1a, 0x46, - 0x41, 0x49, 0x4c, 0x45, 0x44, 0x5f, 0x47, 0x45, 0x54, 0x5f, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x43, - 0x48, 0x41, 0x49, 0x4e, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x10, 0x06, 0x12, 0x17, 0x0a, 0x13, 0x42, - 0x55, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x45, 0x4e, 0x54, 0x5f, 0x45, 0x58, 0x50, 0x49, 0x52, - 0x45, 0x44, 0x10, 0x07, 0x12, 0x16, 0x0a, 0x12, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, - 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x5f, 0x4b, 0x45, 0x59, 0x10, 0x08, 0x12, 0x15, 0x0a, 0x11, - 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x41, 0x54, 0x55, 0x52, - 0x45, 0x10, 0x09, 0x12, 0x15, 0x0a, 0x11, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x50, - 0x41, 0x52, 0x41, 0x4d, 0x45, 0x54, 0x45, 0x52, 0x10, 0x0a, 0x12, 0x14, 0x0a, 0x10, 0x42, 0x55, - 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x4e, 0x4f, 0x5f, 0x41, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x0b, - 0x12, 0x12, 0x0a, 0x0e, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x5f, 0x45, 0x52, 0x52, - 0x4f, 0x52, 0x10, 0x0c, 0x12, 0x0f, 0x0a, 0x0b, 0x42, 0x41, 0x44, 0x5f, 0x47, 0x41, 0x54, 0x45, - 0x57, 0x41, 0x59, 0x10, 0x0d, 0x12, 0x16, 0x0a, 0x12, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, - 0x5f, 0x53, 0x45, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x49, 0x44, 0x10, 0x0e, 0x12, 0x1c, 0x0a, - 0x18, 0x41, 0x43, 0x43, 0x4f, 0x55, 0x4e, 0x54, 0x5f, 0x44, 0x45, 0x50, 0x4f, 0x53, 0x49, 0x54, - 0x5f, 0x52, 0x45, 0x51, 0x55, 0x49, 0x52, 0x45, 0x44, 0x10, 0x0f, 0x12, 0x0f, 0x0a, 0x0b, 0x47, - 0x41, 0x53, 0x5f, 0x45, 0x58, 0x50, 0x49, 0x52, 0x45, 0x44, 0x10, 0x10, 0x12, 0x15, 0x0a, 0x11, - 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x5f, 0x54, 0x4f, 0x4f, 0x5f, 0x4c, 0x41, 0x52, 0x47, - 0x45, 0x10, 0x11, 0x42, 0x05, 0x5a, 0x03, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, -} - -var ( - file_response_proto_rawDescOnce sync.Once - file_response_proto_rawDescData = file_response_proto_rawDesc -) - -func file_response_proto_rawDescGZIP() []byte { - file_response_proto_rawDescOnce.Do(func() { - file_response_proto_rawDescData = protoimpl.X.CompressGZIP(file_response_proto_rawDescData) - }) - return file_response_proto_rawDescData -} - -var file_response_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_response_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_response_proto_goTypes = []interface{}{ - (Code)(0), // 0: pb.Code - (*Response)(nil), // 1: pb.Response -} -var file_response_proto_depIdxs = []int32{ - 0, // 0: pb.Response.responseCode:type_name -> pb.Code - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_response_proto_init() } -func file_response_proto_init() { - if File_response_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_response_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Response); 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_response_proto_rawDesc, - NumEnums: 1, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_response_proto_goTypes, - DependencyIndexes: file_response_proto_depIdxs, - EnumInfos: file_response_proto_enumTypes, - MessageInfos: file_response_proto_msgTypes, - }.Build() - File_response_proto = out.File - file_response_proto_rawDesc = nil - file_response_proto_goTypes = nil - file_response_proto_depIdxs = nil -} diff --git a/model/pb/search_result.pb.go b/model/pb/search_result.pb.go deleted file mode 100644 index eb667b3..0000000 --- a/model/pb/search_result.pb.go +++ /dev/null @@ -1,227 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc v4.23.3 -// source: search_result.proto - -package pb - -import ( - 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) -) - -// A search result contains the pieces found from a search. -type SearchResult struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The list of pieces found in storage. - SearchedPieces []*SearchedPiece `protobuf:"bytes,1,rep,name=searchedPieces,proto3" json:"searchedPieces,omitempty"` -} - -func (x *SearchResult) Reset() { - *x = SearchResult{} - if protoimpl.UnsafeEnabled { - mi := &file_search_result_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SearchResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SearchResult) ProtoMessage() {} - -func (x *SearchResult) ProtoReflect() protoreflect.Message { - mi := &file_search_result_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 SearchResult.ProtoReflect.Descriptor instead. -func (*SearchResult) Descriptor() ([]byte, []int) { - return file_search_result_proto_rawDescGZIP(), []int{0} -} - -func (x *SearchResult) GetSearchedPieces() []*SearchedPiece { - if x != nil { - return x.SearchedPieces - } - return nil -} - -// A searched piece found in storage. -type SearchedPiece struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Found signed piece. - SignedPiece *SignedPiece `protobuf:"bytes,1,opt,name=signedPiece,proto3" json:"signedPiece,omitempty"` - // CID of the found piece. - Cid string `protobuf:"bytes,2,opt,name=cid,proto3" json:"cid,omitempty"` -} - -func (x *SearchedPiece) Reset() { - *x = SearchedPiece{} - if protoimpl.UnsafeEnabled { - mi := &file_search_result_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SearchedPiece) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SearchedPiece) ProtoMessage() {} - -func (x *SearchedPiece) ProtoReflect() protoreflect.Message { - mi := &file_search_result_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 SearchedPiece.ProtoReflect.Descriptor instead. -func (*SearchedPiece) Descriptor() ([]byte, []int) { - return file_search_result_proto_rawDescGZIP(), []int{1} -} - -func (x *SearchedPiece) GetSignedPiece() *SignedPiece { - if x != nil { - return x.SignedPiece - } - return nil -} - -func (x *SearchedPiece) GetCid() string { - if x != nil { - return x.Cid - } - return "" -} - -var File_search_result_proto protoreflect.FileDescriptor - -var file_search_result_proto_rawDesc = []byte{ - 0x0a, 0x13, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x12, 0x73, 0x69, 0x67, 0x6e, 0x65, - 0x64, 0x5f, 0x70, 0x69, 0x65, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x49, 0x0a, - 0x0c, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x39, 0x0a, - 0x0e, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x65, 0x64, 0x50, 0x69, 0x65, 0x63, 0x65, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, - 0x68, 0x65, 0x64, 0x50, 0x69, 0x65, 0x63, 0x65, 0x52, 0x0e, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, - 0x65, 0x64, 0x50, 0x69, 0x65, 0x63, 0x65, 0x73, 0x22, 0x54, 0x0a, 0x0d, 0x53, 0x65, 0x61, 0x72, - 0x63, 0x68, 0x65, 0x64, 0x50, 0x69, 0x65, 0x63, 0x65, 0x12, 0x31, 0x0a, 0x0b, 0x73, 0x69, 0x67, - 0x6e, 0x65, 0x64, 0x50, 0x69, 0x65, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, - 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x50, 0x69, 0x65, 0x63, 0x65, 0x52, - 0x0b, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x50, 0x69, 0x65, 0x63, 0x65, 0x12, 0x10, 0x0a, 0x03, - 0x63, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, 0x69, 0x64, 0x42, 0x05, - 0x5a, 0x03, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_search_result_proto_rawDescOnce sync.Once - file_search_result_proto_rawDescData = file_search_result_proto_rawDesc -) - -func file_search_result_proto_rawDescGZIP() []byte { - file_search_result_proto_rawDescOnce.Do(func() { - file_search_result_proto_rawDescData = protoimpl.X.CompressGZIP(file_search_result_proto_rawDescData) - }) - return file_search_result_proto_rawDescData -} - -var file_search_result_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_search_result_proto_goTypes = []interface{}{ - (*SearchResult)(nil), // 0: pb.SearchResult - (*SearchedPiece)(nil), // 1: pb.SearchedPiece - (*SignedPiece)(nil), // 2: pb.SignedPiece -} -var file_search_result_proto_depIdxs = []int32{ - 1, // 0: pb.SearchResult.searchedPieces:type_name -> pb.SearchedPiece - 2, // 1: pb.SearchedPiece.signedPiece:type_name -> pb.SignedPiece - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name -} - -func init() { file_search_result_proto_init() } -func file_search_result_proto_init() { - if File_search_result_proto != nil { - return - } - file_signed_piece_proto_init() - if !protoimpl.UnsafeEnabled { - file_search_result_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SearchResult); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_search_result_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SearchedPiece); 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_search_result_proto_rawDesc, - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_search_result_proto_goTypes, - DependencyIndexes: file_search_result_proto_depIdxs, - MessageInfos: file_search_result_proto_msgTypes, - }.Build() - File_search_result_proto = out.File - file_search_result_proto_rawDesc = nil - file_search_result_proto_goTypes = nil - file_search_result_proto_depIdxs = nil -} diff --git a/model/pb/session_status.pb.go b/model/pb/session_status.pb.go deleted file mode 100644 index df4a969..0000000 --- a/model/pb/session_status.pb.go +++ /dev/null @@ -1,287 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc v4.23.3 -// source: session_status.proto - -package pb - -import ( - 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) -) - -// Session status update request -type SessionStatus struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Node public key - PublicKey []byte `protobuf:"bytes,1,opt,name=publicKey,proto3" json:"publicKey,omitempty"` - // Reserved gas number (incremental after each status update) - Gas uint32 `protobuf:"varint,2,opt,name=gas,proto3" json:"gas,omitempty"` - // Session identifier (secret value) - SessionId []byte `protobuf:"bytes,3,opt,name=sessionId,proto3" json:"sessionId,omitempty"` - // Session expiration time in UNIX milliseconds - EndOfEpoch uint64 `protobuf:"varint,4,opt,name=endOfEpoch,proto3" json:"endOfEpoch,omitempty"` - // Bucket Id for which session - BucketId uint32 `protobuf:"varint,5,opt,name=bucketId,proto3" json:"bucketId,omitempty"` -} - -func (x *SessionStatus) Reset() { - *x = SessionStatus{} - if protoimpl.UnsafeEnabled { - mi := &file_session_status_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SessionStatus) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SessionStatus) ProtoMessage() {} - -func (x *SessionStatus) ProtoReflect() protoreflect.Message { - mi := &file_session_status_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 SessionStatus.ProtoReflect.Descriptor instead. -func (*SessionStatus) Descriptor() ([]byte, []int) { - return file_session_status_proto_rawDescGZIP(), []int{0} -} - -func (x *SessionStatus) GetPublicKey() []byte { - if x != nil { - return x.PublicKey - } - return nil -} - -func (x *SessionStatus) GetGas() uint32 { - if x != nil { - return x.Gas - } - return 0 -} - -func (x *SessionStatus) GetSessionId() []byte { - if x != nil { - return x.SessionId - } - return nil -} - -func (x *SessionStatus) GetEndOfEpoch() uint64 { - if x != nil { - return x.EndOfEpoch - } - return 0 -} - -func (x *SessionStatus) GetBucketId() uint32 { - if x != nil { - return x.BucketId - } - return 0 -} - -// Session status record in storage -type SessionStatusRecord struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Session status - SessionStatus *SessionStatus `protobuf:"bytes,1,opt,name=sessionStatus,proto3" json:"sessionStatus,omitempty"` - // Payer publicKey - PublicKey []byte `protobuf:"bytes,2,opt,name=publicKey,proto3" json:"publicKey,omitempty"` - // Payer signature - Signature []byte `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"` - // timestamp of request in UNIX milliseconds. - Timestamp uint64 `protobuf:"varint,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"` -} - -func (x *SessionStatusRecord) Reset() { - *x = SessionStatusRecord{} - if protoimpl.UnsafeEnabled { - mi := &file_session_status_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SessionStatusRecord) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SessionStatusRecord) ProtoMessage() {} - -func (x *SessionStatusRecord) ProtoReflect() protoreflect.Message { - mi := &file_session_status_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 SessionStatusRecord.ProtoReflect.Descriptor instead. -func (*SessionStatusRecord) Descriptor() ([]byte, []int) { - return file_session_status_proto_rawDescGZIP(), []int{1} -} - -func (x *SessionStatusRecord) GetSessionStatus() *SessionStatus { - if x != nil { - return x.SessionStatus - } - return nil -} - -func (x *SessionStatusRecord) GetPublicKey() []byte { - if x != nil { - return x.PublicKey - } - return nil -} - -func (x *SessionStatusRecord) GetSignature() []byte { - if x != nil { - return x.Signature - } - return nil -} - -func (x *SessionStatusRecord) GetTimestamp() uint64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -var File_session_status_proto protoreflect.FileDescriptor - -var file_session_status_proto_rawDesc = []byte{ - 0x0a, 0x14, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0x99, 0x01, 0x0a, 0x0d, 0x53, - 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1c, 0x0a, 0x09, - 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x67, 0x61, - 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x67, 0x61, 0x73, 0x12, 0x1c, 0x0a, 0x09, - 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x65, 0x6e, - 0x64, 0x4f, 0x66, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, - 0x65, 0x6e, 0x64, 0x4f, 0x66, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x75, - 0x63, 0x6b, 0x65, 0x74, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x62, 0x75, - 0x63, 0x6b, 0x65, 0x74, 0x49, 0x64, 0x22, 0xa8, 0x01, 0x0a, 0x13, 0x53, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x37, - 0x0a, 0x0d, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x0d, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, - 0x63, 0x4b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, - 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, - 0x75, 0x72, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x42, 0x05, 0x5a, 0x03, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_session_status_proto_rawDescOnce sync.Once - file_session_status_proto_rawDescData = file_session_status_proto_rawDesc -) - -func file_session_status_proto_rawDescGZIP() []byte { - file_session_status_proto_rawDescOnce.Do(func() { - file_session_status_proto_rawDescData = protoimpl.X.CompressGZIP(file_session_status_proto_rawDescData) - }) - return file_session_status_proto_rawDescData -} - -var file_session_status_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_session_status_proto_goTypes = []interface{}{ - (*SessionStatus)(nil), // 0: pb.SessionStatus - (*SessionStatusRecord)(nil), // 1: pb.SessionStatusRecord -} -var file_session_status_proto_depIdxs = []int32{ - 0, // 0: pb.SessionStatusRecord.sessionStatus:type_name -> pb.SessionStatus - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_session_status_proto_init() } -func file_session_status_proto_init() { - if File_session_status_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_session_status_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SessionStatus); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_session_status_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SessionStatusRecord); 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_session_status_proto_rawDesc, - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_session_status_proto_goTypes, - DependencyIndexes: file_session_status_proto_depIdxs, - MessageInfos: file_session_status_proto_msgTypes, - }.Build() - File_session_status_proto = out.File - file_session_status_proto_rawDesc = nil - file_session_status_proto_goTypes = nil - file_session_status_proto_depIdxs = nil -} diff --git a/model/pb/signature.pb.go b/model/pb/signature.pb.go deleted file mode 100644 index 194b93f..0000000 --- a/model/pb/signature.pb.go +++ /dev/null @@ -1,227 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc v4.23.3 -// source: signature.proto - -package pb - -import ( - 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) -) - -// A signature and details to help verify it. -// -// #### Generation -// -// - Compute a CID from the `piece` bytes using details from `signature`: -// - [CIDv1](https://github.com/multiformats/cid). -// - The hash function should be blake2b-256 and `multiHashType` should be empty. -// - Content type codec `0x55` -// - Base encoded in Base32 with the prefix `b` -// - Example: bafk2bzacea73ycjnxe2qov7cvnhx52lzfp6nf5jcblnfus6gqreh6ygganbws -// -// - Store the public key of the signer in `publicKey` in binary encoding. -// -// - Store the current time in `timestamp` -// - In JavaScript: `timestamp = +new Date()` -// -// - Format the current time in ISO 8601 `YYYY-MM-DDTHH:mm:ss.sssZ` -// - In JavaScript: `timeText = new Date(timestamp).toISOString()` -// - In Go format: `2006-01-02T15:04:05.000Z` -// -// - The signed message to store a piece is: -// - `DDC store ${CID} at ${timeText}` -// - Note: the `` part is enforced by the Polkadot.js browser extension. -// - Example: `DDC store bafk2bzacea73ycjnxe2qov7cvnhx52lzfp6nf5jcblnfus6gqreh6ygganbws at 2022-06-27T07:33:44.607Z` -// -// - The signing scheme should be sr25519, and `scheme` should be empty. -// - If this not supported by a signer, then `scheme` should be "ed25519". -// -// - Sign and store the signature in `sig` in binary encoding. -// -// #### Verification -// -// - Recompute the signed message using the details in `signature`. -// - Verify `sig` given the scheme, the message, and the public key. -// -// #### Legacy signatures before v0.1.4 -// -// If `timestamp == 0`, assume an older version: -// - Decode `value` and `signer` from hexadecimal with or without `0x`. -// - Then the signed message is either `${CID}` or `${CID}`. -type Signature struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The cryptographic signature in binary encoding as per the scheme. - Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` - // The public key of the signer in binary encoding as per the scheme. - Signer []byte `protobuf:"bytes,2,opt,name=signer,proto3" json:"signer,omitempty"` - // The name of the signature scheme (sr25519, secp256k1, ed25519). - // Default and recommended value: "" or "sr25519". - Scheme string `protobuf:"bytes,3,opt,name=scheme,proto3" json:"scheme,omitempty"` - // The ID of the hashing algorithm as per multiformats/multihash. - // Default and recommended value: 0 or 0xb220, meaning blake2b-256. - MultiHashType uint64 `protobuf:"varint,4,opt,name=multiHashType,proto3" json:"multiHashType,omitempty"` - // The timestamp in UNIX milliseconds. - Timestamp uint64 `protobuf:"varint,5,opt,name=timestamp,proto3" json:"timestamp,omitempty"` -} - -func (x *Signature) Reset() { - *x = Signature{} - if protoimpl.UnsafeEnabled { - mi := &file_signature_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Signature) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Signature) ProtoMessage() {} - -func (x *Signature) ProtoReflect() protoreflect.Message { - mi := &file_signature_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 Signature.ProtoReflect.Descriptor instead. -func (*Signature) Descriptor() ([]byte, []int) { - return file_signature_proto_rawDescGZIP(), []int{0} -} - -func (x *Signature) GetValue() []byte { - if x != nil { - return x.Value - } - return nil -} - -func (x *Signature) GetSigner() []byte { - if x != nil { - return x.Signer - } - return nil -} - -func (x *Signature) GetScheme() string { - if x != nil { - return x.Scheme - } - return "" -} - -func (x *Signature) GetMultiHashType() uint64 { - if x != nil { - return x.MultiHashType - } - return 0 -} - -func (x *Signature) GetTimestamp() uint64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -var File_signature_proto protoreflect.FileDescriptor - -var file_signature_proto_rawDesc = []byte{ - 0x0a, 0x0f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0x95, 0x01, 0x0a, 0x09, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, - 0x75, 0x72, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x69, 0x67, - 0x6e, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, - 0x72, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x6d, 0x75, 0x6c, - 0x74, 0x69, 0x48, 0x61, 0x73, 0x68, 0x54, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x0d, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x48, 0x61, 0x73, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, - 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x05, 0x5a, - 0x03, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_signature_proto_rawDescOnce sync.Once - file_signature_proto_rawDescData = file_signature_proto_rawDesc -) - -func file_signature_proto_rawDescGZIP() []byte { - file_signature_proto_rawDescOnce.Do(func() { - file_signature_proto_rawDescData = protoimpl.X.CompressGZIP(file_signature_proto_rawDescData) - }) - return file_signature_proto_rawDescData -} - -var file_signature_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_signature_proto_goTypes = []interface{}{ - (*Signature)(nil), // 0: pb.Signature -} -var file_signature_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_signature_proto_init() } -func file_signature_proto_init() { - if File_signature_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_signature_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Signature); 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_signature_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_signature_proto_goTypes, - DependencyIndexes: file_signature_proto_depIdxs, - MessageInfos: file_signature_proto_msgTypes, - }.Build() - File_signature_proto = out.File - file_signature_proto_rawDesc = nil - file_signature_proto_goTypes = nil - file_signature_proto_depIdxs = nil -} diff --git a/model/pb/signed_piece.pb.go b/model/pb/signed_piece.pb.go deleted file mode 100644 index 00b17fc..0000000 --- a/model/pb/signed_piece.pb.go +++ /dev/null @@ -1,160 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc v4.23.3 -// source: signed_piece.proto - -package pb - -import ( - 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) -) - -// A piece signed by an account. -// This can be used to verify the intent of the account holder to upload the piece. -type SignedPiece struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // A Piece message serialized in protobuf. - Piece []byte `protobuf:"bytes,1,opt,name=piece,proto3" json:"piece,omitempty"` - // A signature of the piece by the keypair of the uploader. - Signature *Signature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` -} - -func (x *SignedPiece) Reset() { - *x = SignedPiece{} - if protoimpl.UnsafeEnabled { - mi := &file_signed_piece_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SignedPiece) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SignedPiece) ProtoMessage() {} - -func (x *SignedPiece) ProtoReflect() protoreflect.Message { - mi := &file_signed_piece_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 SignedPiece.ProtoReflect.Descriptor instead. -func (*SignedPiece) Descriptor() ([]byte, []int) { - return file_signed_piece_proto_rawDescGZIP(), []int{0} -} - -func (x *SignedPiece) GetPiece() []byte { - if x != nil { - return x.Piece - } - return nil -} - -func (x *SignedPiece) GetSignature() *Signature { - if x != nil { - return x.Signature - } - return nil -} - -var File_signed_piece_proto protoreflect.FileDescriptor - -var file_signed_piece_proto_rawDesc = []byte{ - 0x0a, 0x12, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x70, 0x69, 0x65, 0x63, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x0f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, - 0x75, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x50, 0x0a, 0x0b, 0x53, 0x69, 0x67, - 0x6e, 0x65, 0x64, 0x50, 0x69, 0x65, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x69, 0x65, 0x63, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x70, 0x69, 0x65, 0x63, 0x65, 0x12, 0x2b, - 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, - 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x42, 0x05, 0x5a, 0x03, 0x2f, - 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_signed_piece_proto_rawDescOnce sync.Once - file_signed_piece_proto_rawDescData = file_signed_piece_proto_rawDesc -) - -func file_signed_piece_proto_rawDescGZIP() []byte { - file_signed_piece_proto_rawDescOnce.Do(func() { - file_signed_piece_proto_rawDescData = protoimpl.X.CompressGZIP(file_signed_piece_proto_rawDescData) - }) - return file_signed_piece_proto_rawDescData -} - -var file_signed_piece_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_signed_piece_proto_goTypes = []interface{}{ - (*SignedPiece)(nil), // 0: pb.SignedPiece - (*Signature)(nil), // 1: pb.Signature -} -var file_signed_piece_proto_depIdxs = []int32{ - 1, // 0: pb.SignedPiece.signature:type_name -> pb.Signature - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_signed_piece_proto_init() } -func file_signed_piece_proto_init() { - if File_signed_piece_proto != nil { - return - } - file_signature_proto_init() - if !protoimpl.UnsafeEnabled { - file_signed_piece_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SignedPiece); 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_signed_piece_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_signed_piece_proto_goTypes, - DependencyIndexes: file_signed_piece_proto_depIdxs, - MessageInfos: file_signed_piece_proto_msgTypes, - }.Build() - File_signed_piece_proto = out.File - file_signed_piece_proto_rawDesc = nil - file_signed_piece_proto_goTypes = nil - file_signed_piece_proto_depIdxs = nil -} diff --git a/model/pb/state.pb.go b/model/pb/state.pb.go deleted file mode 100644 index 7ac98b5..0000000 --- a/model/pb/state.pb.go +++ /dev/null @@ -1,923 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc v4.23.3 -// source: state.proto - -package pb - -import ( - 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) -) - -type State int32 - -const ( - State_NA State = 0 - State_GRAY State = 1 - State_GREEN State = 2 - State_BLUE State = 3 - State_RED State = 4 -) - -// Enum value maps for State. -var ( - State_name = map[int32]string{ - 0: "NA", - 1: "GRAY", - 2: "GREEN", - 3: "BLUE", - 4: "RED", - } - State_value = map[string]int32{ - "NA": 0, - "GRAY": 1, - "GREEN": 2, - "BLUE": 3, - "RED": 4, - } -) - -func (x State) Enum() *State { - p := new(State) - *p = x - return p -} - -func (x State) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (State) Descriptor() protoreflect.EnumDescriptor { - return file_state_proto_enumTypes[0].Descriptor() -} - -func (State) Type() protoreflect.EnumType { - return &file_state_proto_enumTypes[0] -} - -func (x State) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use State.Descriptor instead. -func (State) EnumDescriptor() ([]byte, []int) { - return file_state_proto_rawDescGZIP(), []int{0} -} - -// Full State object used for two goals -// Routing optimization: -// User use this object to get information about cluster state and select the prioritised node for request -// Cluster state monitoring: -// Node use this object to get information about cluster state and check the state of other nodes -type FullState struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Short current node state - State *ShortState `protobuf:"bytes,1,opt,name=state,proto3" json:"state,omitempty"` - // Signature of the short state by current node - Signature *StateSignature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` - // Node statistic - Statistic *Statistic `protobuf:"bytes,3,opt,name=statistic,proto3" json:"statistic,omitempty"` - // Cluster map - ClusterMap map[uint32]*GossipState `protobuf:"bytes,4,rep,name=cluster_map,json=clusterMap,proto3" json:"cluster_map,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (x *FullState) Reset() { - *x = FullState{} - if protoimpl.UnsafeEnabled { - mi := &file_state_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FullState) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FullState) ProtoMessage() {} - -func (x *FullState) ProtoReflect() protoreflect.Message { - mi := &file_state_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 FullState.ProtoReflect.Descriptor instead. -func (*FullState) Descriptor() ([]byte, []int) { - return file_state_proto_rawDescGZIP(), []int{0} -} - -func (x *FullState) GetState() *ShortState { - if x != nil { - return x.State - } - return nil -} - -func (x *FullState) GetSignature() *StateSignature { - if x != nil { - return x.Signature - } - return nil -} - -func (x *FullState) GetStatistic() *Statistic { - if x != nil { - return x.Statistic - } - return nil -} - -func (x *FullState) GetClusterMap() map[uint32]*GossipState { - if x != nil { - return x.ClusterMap - } - return nil -} - -type ShortState struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // PubKey of the node from smart contract - NodeKey string `protobuf:"bytes,1,opt,name=nodeKey,proto3" json:"nodeKey,omitempty"` - // ID of the cluster from smart contract - ClusterID uint32 `protobuf:"varint,2,opt,name=clusterID,proto3" json:"clusterID,omitempty"` - // URL of the node - Url string `protobuf:"bytes,3,opt,name=url,proto3" json:"url,omitempty"` - // State of the node - State State `protobuf:"varint,4,opt,name=state,proto3,enum=pb.State" json:"state,omitempty"` - // Location of the node (Alpha2 country code) - Location string `protobuf:"bytes,5,opt,name=location,proto3" json:"location,omitempty"` - // Size of the node - Size uint32 `protobuf:"varint,6,opt,name=size,proto3" json:"size,omitempty"` - // Updated_at time of the short state - Updated uint64 `protobuf:"varint,7,opt,name=updated,proto3" json:"updated,omitempty"` -} - -func (x *ShortState) Reset() { - *x = ShortState{} - if protoimpl.UnsafeEnabled { - mi := &file_state_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ShortState) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ShortState) ProtoMessage() {} - -func (x *ShortState) ProtoReflect() protoreflect.Message { - mi := &file_state_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 ShortState.ProtoReflect.Descriptor instead. -func (*ShortState) Descriptor() ([]byte, []int) { - return file_state_proto_rawDescGZIP(), []int{1} -} - -func (x *ShortState) GetNodeKey() string { - if x != nil { - return x.NodeKey - } - return "" -} - -func (x *ShortState) GetClusterID() uint32 { - if x != nil { - return x.ClusterID - } - return 0 -} - -func (x *ShortState) GetUrl() string { - if x != nil { - return x.Url - } - return "" -} - -func (x *ShortState) GetState() State { - if x != nil { - return x.State - } - return State_NA -} - -func (x *ShortState) GetLocation() string { - if x != nil { - return x.Location - } - return "" -} - -func (x *ShortState) GetSize() uint32 { - if x != nil { - return x.Size - } - return 0 -} - -func (x *ShortState) GetUpdated() uint64 { - if x != nil { - return x.Updated - } - return 0 -} - -// Each CDN node provide a full cluster state to other nodes and any client -// State bring short state (last updated state) and list of checks (who checks the state and what is the result) -// each check is signed by CDN node, that make them -// statistic is a last statistic state of CDN node, that needed for diagnostic only -// sign(CID(nodeKey+ClusterID+URL+State+Location+Size+Updated_at)) -type GossipState struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - LastState *ShortState `protobuf:"bytes,1,opt,name=last_state,json=lastState,proto3" json:"last_state,omitempty"` - Signature *StateSignature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` - Statistic *Statistic `protobuf:"bytes,3,opt,name=statistic,proto3" json:"statistic,omitempty"` - Checks map[uint32]*Check `protobuf:"bytes,4,rep,name=checks,proto3" json:"checks,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (x *GossipState) Reset() { - *x = GossipState{} - if protoimpl.UnsafeEnabled { - mi := &file_state_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GossipState) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GossipState) ProtoMessage() {} - -func (x *GossipState) ProtoReflect() protoreflect.Message { - mi := &file_state_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 GossipState.ProtoReflect.Descriptor instead. -func (*GossipState) Descriptor() ([]byte, []int) { - return file_state_proto_rawDescGZIP(), []int{2} -} - -func (x *GossipState) GetLastState() *ShortState { - if x != nil { - return x.LastState - } - return nil -} - -func (x *GossipState) GetSignature() *StateSignature { - if x != nil { - return x.Signature - } - return nil -} - -func (x *GossipState) GetStatistic() *Statistic { - if x != nil { - return x.Statistic - } - return nil -} - -func (x *GossipState) GetChecks() map[uint32]*Check { - if x != nil { - return x.Checks - } - return nil -} - -// Signed check, that was produced by another CDN node -// and can be used to verify that the node works -type Check struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - State *ShortState `protobuf:"bytes,1,opt,name=state,proto3" json:"state,omitempty"` - Signature *StateSignature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` -} - -func (x *Check) Reset() { - *x = Check{} - if protoimpl.UnsafeEnabled { - mi := &file_state_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Check) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Check) ProtoMessage() {} - -func (x *Check) ProtoReflect() protoreflect.Message { - mi := &file_state_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 Check.ProtoReflect.Descriptor instead. -func (*Check) Descriptor() ([]byte, []int) { - return file_state_proto_rawDescGZIP(), []int{3} -} - -func (x *Check) GetState() *ShortState { - if x != nil { - return x.State - } - return nil -} - -func (x *Check) GetSignature() *StateSignature { - if x != nil { - return x.Signature - } - return nil -} - -// A signature and details to help verify it. -// -// #### Generation -// -// - Take hash for the stat object -// - The hash function should be blake2b-256 and `multiHashType` should be empty. -// - Base encoded in Base32 with the prefix `b` -// - Example: -// -// - Store the public key of the signer in `publicKey` in binary encoding. -// -// - Store the current time in `timestamp` -// - In JavaScript: `timestamp = +new Date()` -// -// - Format the current time in ISO 8601 `YYYY-MM-DDTHH:mm:ss.sssZ` -// - In JavaScript: `timeText = new Date(timestamp).toISOString()` -// - In Go format: `2006-01-02T15:04:05.000Z` -// -// - The signed message to store a state is: -// - `DDC CDN ${state_hash} at ${timeText}` -// - Note: the `` added for same format as piece signature is. -// - Example: `DDC CDN "Hash" at 2022-06-27T07:33:44.607Z` -// -// - It is normal, if time of signing is bigger from state timestamp. -// - The State hash is: -// - Short state: `Hash = CID(nodeKey+ClusterID+URL+State+Location+Size+Updated_at)` -// - The signing scheme should be sr25519, and `scheme` should be empty. -// - If this not supported by a signer, then `scheme` should be "ed25519". -// -// - Sign and store the signature in `sig` in binary encoding. -// -// #### Verification -// -// - Recompute the signed message using the details in `signature`. -// - Verify `sig` given the scheme, the message, and the public key. -type StateSignature struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The cryptographic signature in binary encoding as per the scheme. - Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` - // The public key of the signer in binary encoding as per the scheme. - Signer []byte `protobuf:"bytes,2,opt,name=signer,proto3" json:"signer,omitempty"` - // The name of the signature scheme (sr25519, secp256k1, ed25519). - // Default and recommended value: "" or "sr25519". - Scheme string `protobuf:"bytes,3,opt,name=scheme,proto3" json:"scheme,omitempty"` - // The ID of the hashing algorithm as per multiformats/multihash. - // Default and recommended value: 0 or 0xb220, meaning blake2b-256. - MultiHashType uint64 `protobuf:"varint,4,opt,name=multiHashType,proto3" json:"multiHashType,omitempty"` - // The timestamp in UNIX milliseconds. - Timestamp uint64 `protobuf:"varint,5,opt,name=timestamp,proto3" json:"timestamp,omitempty"` -} - -func (x *StateSignature) Reset() { - *x = StateSignature{} - if protoimpl.UnsafeEnabled { - mi := &file_state_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StateSignature) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StateSignature) ProtoMessage() {} - -func (x *StateSignature) ProtoReflect() protoreflect.Message { - mi := &file_state_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 StateSignature.ProtoReflect.Descriptor instead. -func (*StateSignature) Descriptor() ([]byte, []int) { - return file_state_proto_rawDescGZIP(), []int{4} -} - -func (x *StateSignature) GetValue() []byte { - if x != nil { - return x.Value - } - return nil -} - -func (x *StateSignature) GetSigner() []byte { - if x != nil { - return x.Signer - } - return nil -} - -func (x *StateSignature) GetScheme() string { - if x != nil { - return x.Scheme - } - return "" -} - -func (x *StateSignature) GetMultiHashType() uint64 { - if x != nil { - return x.MultiHashType - } - return 0 -} - -func (x *StateSignature) GetTimestamp() uint64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -// Short statistic about node heals status -// Sessions - count of active sessions -// Redirects - count of redirects in current hour -// Cache_size - size of cache in bytes -// Cpu - cpu load in percents -// Ram - ram load in percents (regarding quotes) -// Hd - hard drive load in percents (regarding quotes) -// Uptime - uptime in seconds from last lunch -type Statistic struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Sessions uint32 `protobuf:"varint,1,opt,name=sessions,proto3" json:"sessions,omitempty"` - Redirects *Redirects `protobuf:"bytes,2,opt,name=redirects,proto3" json:"redirects,omitempty"` - CacheSize uint32 `protobuf:"varint,3,opt,name=cache_size,json=cacheSize,proto3" json:"cache_size,omitempty"` - Cpu uint32 `protobuf:"varint,4,opt,name=cpu,proto3" json:"cpu,omitempty"` - Ram uint32 `protobuf:"varint,5,opt,name=ram,proto3" json:"ram,omitempty"` - Hd uint32 `protobuf:"varint,6,opt,name=hd,proto3" json:"hd,omitempty"` - Uptime int64 `protobuf:"varint,7,opt,name=uptime,proto3" json:"uptime,omitempty"` -} - -func (x *Statistic) Reset() { - *x = Statistic{} - if protoimpl.UnsafeEnabled { - mi := &file_state_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Statistic) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Statistic) ProtoMessage() {} - -func (x *Statistic) ProtoReflect() protoreflect.Message { - mi := &file_state_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 Statistic.ProtoReflect.Descriptor instead. -func (*Statistic) Descriptor() ([]byte, []int) { - return file_state_proto_rawDescGZIP(), []int{5} -} - -func (x *Statistic) GetSessions() uint32 { - if x != nil { - return x.Sessions - } - return 0 -} - -func (x *Statistic) GetRedirects() *Redirects { - if x != nil { - return x.Redirects - } - return nil -} - -func (x *Statistic) GetCacheSize() uint32 { - if x != nil { - return x.CacheSize - } - return 0 -} - -func (x *Statistic) GetCpu() uint32 { - if x != nil { - return x.Cpu - } - return 0 -} - -func (x *Statistic) GetRam() uint32 { - if x != nil { - return x.Ram - } - return 0 -} - -func (x *Statistic) GetHd() uint32 { - if x != nil { - return x.Hd - } - return 0 -} - -func (x *Statistic) GetUptime() int64 { - if x != nil { - return x.Uptime - } - return 0 -} - -// Soft redirects it is redirects thar recommended via header -// Hard redirects it is redirects that forced via http code -// Counted redirects on last hour -type Redirects struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Soft uint32 `protobuf:"varint,1,opt,name=soft,proto3" json:"soft,omitempty"` - Hard uint32 `protobuf:"varint,2,opt,name=hard,proto3" json:"hard,omitempty"` -} - -func (x *Redirects) Reset() { - *x = Redirects{} - if protoimpl.UnsafeEnabled { - mi := &file_state_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Redirects) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Redirects) ProtoMessage() {} - -func (x *Redirects) ProtoReflect() protoreflect.Message { - mi := &file_state_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 Redirects.ProtoReflect.Descriptor instead. -func (*Redirects) Descriptor() ([]byte, []int) { - return file_state_proto_rawDescGZIP(), []int{6} -} - -func (x *Redirects) GetSoft() uint32 { - if x != nil { - return x.Soft - } - return 0 -} - -func (x *Redirects) GetHard() uint32 { - if x != nil { - return x.Hard - } - return 0 -} - -var File_state_proto protoreflect.FileDescriptor - -var file_state_proto_rawDesc = []byte{ - 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, - 0x62, 0x22, 0xa0, 0x02, 0x0a, 0x09, 0x46, 0x75, 0x6c, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, - 0x24, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, - 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, - 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x30, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x74, - 0x61, 0x74, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, - 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x2b, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x74, 0x69, - 0x73, 0x74, 0x69, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x62, 0x2e, - 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x69, - 0x73, 0x74, 0x69, 0x63, 0x12, 0x3e, 0x0a, 0x0b, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, - 0x6d, 0x61, 0x70, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x46, - 0x75, 0x6c, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, - 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, - 0x72, 0x4d, 0x61, 0x70, 0x1a, 0x4e, 0x0a, 0x0f, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4d, - 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x25, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x6f, - 0x73, 0x73, 0x69, 0x70, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x3a, 0x02, 0x38, 0x01, 0x22, 0xc1, 0x01, 0x0a, 0x0a, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x53, 0x74, - 0x61, 0x74, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x4b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x1c, 0x0a, - 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x44, 0x12, 0x10, 0x0a, 0x03, 0x75, - 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x1f, 0x0a, - 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x09, 0x2e, 0x70, - 0x62, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1a, - 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, - 0x7a, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x18, - 0x0a, 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x22, 0x96, 0x02, 0x0a, 0x0b, 0x47, 0x6f, 0x73, - 0x73, 0x69, 0x70, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x2d, 0x0a, 0x0a, 0x6c, 0x61, 0x73, 0x74, - 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, - 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x09, 0x6c, 0x61, - 0x73, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x30, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x62, 0x2e, - 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, - 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x2b, 0x0a, 0x09, 0x73, 0x74, 0x61, - 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, - 0x62, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x52, 0x09, 0x73, 0x74, 0x61, - 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x12, 0x33, 0x0a, 0x06, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, - 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x6f, 0x73, 0x73, - 0x69, 0x70, 0x53, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x52, 0x06, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x1a, 0x44, 0x0a, 0x0b, 0x43, - 0x68, 0x65, 0x63, 0x6b, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1f, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x70, 0x62, - 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, - 0x01, 0x22, 0x5f, 0x0a, 0x05, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x24, 0x0a, 0x05, 0x73, 0x74, - 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x53, - 0x68, 0x6f, 0x72, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, - 0x12, 0x30, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x69, - 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x22, 0x9a, 0x01, 0x0a, 0x0e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x69, 0x67, 0x6e, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, - 0x69, 0x67, 0x6e, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x73, 0x69, 0x67, - 0x6e, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x6d, - 0x75, 0x6c, 0x74, 0x69, 0x48, 0x61, 0x73, 0x68, 0x54, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x0d, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x48, 0x61, 0x73, 0x68, 0x54, 0x79, 0x70, - 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, - 0xbf, 0x01, 0x0a, 0x09, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x12, 0x1a, 0x0a, - 0x08, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x08, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2b, 0x0a, 0x09, 0x72, 0x65, 0x64, - 0x69, 0x72, 0x65, 0x63, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, - 0x62, 0x2e, 0x52, 0x65, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x73, 0x52, 0x09, 0x72, 0x65, 0x64, - 0x69, 0x72, 0x65, 0x63, 0x74, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x61, 0x63, 0x68, 0x65, 0x5f, - 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x63, 0x61, 0x63, 0x68, - 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x70, 0x75, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x03, 0x63, 0x70, 0x75, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x61, 0x6d, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x72, 0x61, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x68, 0x64, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x68, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x70, 0x74, - 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x70, 0x74, 0x69, 0x6d, - 0x65, 0x22, 0x33, 0x0a, 0x09, 0x52, 0x65, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x73, 0x12, 0x12, - 0x0a, 0x04, 0x73, 0x6f, 0x66, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x73, 0x6f, - 0x66, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x04, 0x68, 0x61, 0x72, 0x64, 0x2a, 0x37, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, - 0x06, 0x0a, 0x02, 0x4e, 0x41, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x47, 0x52, 0x41, 0x59, 0x10, - 0x01, 0x12, 0x09, 0x0a, 0x05, 0x47, 0x52, 0x45, 0x45, 0x4e, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, - 0x42, 0x4c, 0x55, 0x45, 0x10, 0x03, 0x12, 0x07, 0x0a, 0x03, 0x52, 0x45, 0x44, 0x10, 0x04, 0x42, - 0x05, 0x5a, 0x03, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_state_proto_rawDescOnce sync.Once - file_state_proto_rawDescData = file_state_proto_rawDesc -) - -func file_state_proto_rawDescGZIP() []byte { - file_state_proto_rawDescOnce.Do(func() { - file_state_proto_rawDescData = protoimpl.X.CompressGZIP(file_state_proto_rawDescData) - }) - return file_state_proto_rawDescData -} - -var file_state_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_state_proto_msgTypes = make([]protoimpl.MessageInfo, 9) -var file_state_proto_goTypes = []interface{}{ - (State)(0), // 0: pb.State - (*FullState)(nil), // 1: pb.FullState - (*ShortState)(nil), // 2: pb.ShortState - (*GossipState)(nil), // 3: pb.GossipState - (*Check)(nil), // 4: pb.Check - (*StateSignature)(nil), // 5: pb.StateSignature - (*Statistic)(nil), // 6: pb.Statistic - (*Redirects)(nil), // 7: pb.Redirects - nil, // 8: pb.FullState.ClusterMapEntry - nil, // 9: pb.GossipState.ChecksEntry -} -var file_state_proto_depIdxs = []int32{ - 2, // 0: pb.FullState.state:type_name -> pb.ShortState - 5, // 1: pb.FullState.signature:type_name -> pb.StateSignature - 6, // 2: pb.FullState.statistic:type_name -> pb.Statistic - 8, // 3: pb.FullState.cluster_map:type_name -> pb.FullState.ClusterMapEntry - 0, // 4: pb.ShortState.state:type_name -> pb.State - 2, // 5: pb.GossipState.last_state:type_name -> pb.ShortState - 5, // 6: pb.GossipState.signature:type_name -> pb.StateSignature - 6, // 7: pb.GossipState.statistic:type_name -> pb.Statistic - 9, // 8: pb.GossipState.checks:type_name -> pb.GossipState.ChecksEntry - 2, // 9: pb.Check.state:type_name -> pb.ShortState - 5, // 10: pb.Check.signature:type_name -> pb.StateSignature - 7, // 11: pb.Statistic.redirects:type_name -> pb.Redirects - 3, // 12: pb.FullState.ClusterMapEntry.value:type_name -> pb.GossipState - 4, // 13: pb.GossipState.ChecksEntry.value:type_name -> pb.Check - 14, // [14:14] is the sub-list for method output_type - 14, // [14:14] is the sub-list for method input_type - 14, // [14:14] is the sub-list for extension type_name - 14, // [14:14] is the sub-list for extension extendee - 0, // [0:14] is the sub-list for field type_name -} - -func init() { file_state_proto_init() } -func file_state_proto_init() { - if File_state_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_state_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FullState); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_state_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ShortState); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_state_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GossipState); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_state_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Check); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_state_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StateSignature); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_state_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Statistic); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_state_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Redirects); 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_state_proto_rawDesc, - NumEnums: 1, - NumMessages: 9, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_state_proto_goTypes, - DependencyIndexes: file_state_proto_depIdxs, - EnumInfos: file_state_proto_enumTypes, - MessageInfos: file_state_proto_msgTypes, - }.Build() - File_state_proto = out.File - file_state_proto_rawDesc = nil - file_state_proto_goTypes = nil - file_state_proto_depIdxs = nil -} diff --git a/model/pb/tag.pb.go b/model/pb/tag.pb.go deleted file mode 100644 index 5feb8f6..0000000 --- a/model/pb/tag.pb.go +++ /dev/null @@ -1,237 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc v4.23.3 -// source: tag.proto - -package pb - -import ( - 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) -) - -// How can this tag be searched. -type SearchType int32 - -const ( - // RANGE tags should be indexed by nodes into their database to allow efficient queries on a key - // for an exact value or a range of values. This is the default. - SearchType_RANGE SearchType = 0 - // NOT_SEARCHABLE tags should not be indexed. This option should be set when possible to save - // node space and speed. - SearchType_NOT_SEARCHABLE SearchType = 1 -) - -// Enum value maps for SearchType. -var ( - SearchType_name = map[int32]string{ - 0: "RANGE", - 1: "NOT_SEARCHABLE", - } - SearchType_value = map[string]int32{ - "RANGE": 0, - "NOT_SEARCHABLE": 1, - } -) - -func (x SearchType) Enum() *SearchType { - p := new(SearchType) - *p = x - return p -} - -func (x SearchType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (SearchType) Descriptor() protoreflect.EnumDescriptor { - return file_tag_proto_enumTypes[0].Descriptor() -} - -func (SearchType) Type() protoreflect.EnumType { - return &file_tag_proto_enumTypes[0] -} - -func (x SearchType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use SearchType.Descriptor instead. -func (SearchType) EnumDescriptor() ([]byte, []int) { - return file_tag_proto_rawDescGZIP(), []int{0} -} - -// A tag is a `key/value` attribute attached to a piece. -// -// Tags can be used to search or filter pieces in storage. If search is not needed, disable it -// using the `searchable` field. -// -// Specific tags are used to implement different higher protocols, such as a file system. -// Each key should start with a prefix indicating which protocol or application relies on it. Below is a non-exhaustive table of known tag keys: -// -// Tag Key | Description -// ------------ | ----------- -// content-type | The MIME type of the payload of a piece or file. This is returned by the CDN web interface as HTTP Content-Type. -// file-* | Tags to implement a filesystem over object storage. Example: `file-path` -// kv-* | Tags to implement a key/value store over object storage. -// enc-* | Tags to organize data encryption and data sharing keys. -// -// Below is the structure of a tag: -type Tag struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The key of the tag. It is usually a UTF-8 string, but it may be any data. - Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - // The value of the tag for this key. The value should be interpreted based on the key. - Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - // Whether this tag is searchable or not. Yes by default. - Searchable SearchType `protobuf:"varint,3,opt,name=searchable,proto3,enum=pb.SearchType" json:"searchable,omitempty"` -} - -func (x *Tag) Reset() { - *x = Tag{} - if protoimpl.UnsafeEnabled { - mi := &file_tag_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Tag) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Tag) ProtoMessage() {} - -func (x *Tag) ProtoReflect() protoreflect.Message { - mi := &file_tag_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 Tag.ProtoReflect.Descriptor instead. -func (*Tag) Descriptor() ([]byte, []int) { - return file_tag_proto_rawDescGZIP(), []int{0} -} - -func (x *Tag) GetKey() []byte { - if x != nil { - return x.Key - } - return nil -} - -func (x *Tag) GetValue() []byte { - if x != nil { - return x.Value - } - return nil -} - -func (x *Tag) GetSearchable() SearchType { - if x != nil { - return x.Searchable - } - return SearchType_RANGE -} - -var File_tag_proto protoreflect.FileDescriptor - -var file_tag_proto_rawDesc = []byte{ - 0x0a, 0x09, 0x74, 0x61, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, - 0x5d, 0x0a, 0x03, 0x54, 0x61, 0x67, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x2e, - 0x0a, 0x0a, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x54, 0x79, - 0x70, 0x65, 0x52, 0x0a, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x61, 0x62, 0x6c, 0x65, 0x2a, 0x2b, - 0x0a, 0x0a, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x09, 0x0a, 0x05, - 0x52, 0x41, 0x4e, 0x47, 0x45, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x4e, 0x4f, 0x54, 0x5f, 0x53, - 0x45, 0x41, 0x52, 0x43, 0x48, 0x41, 0x42, 0x4c, 0x45, 0x10, 0x01, 0x42, 0x05, 0x5a, 0x03, 0x2f, - 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_tag_proto_rawDescOnce sync.Once - file_tag_proto_rawDescData = file_tag_proto_rawDesc -) - -func file_tag_proto_rawDescGZIP() []byte { - file_tag_proto_rawDescOnce.Do(func() { - file_tag_proto_rawDescData = protoimpl.X.CompressGZIP(file_tag_proto_rawDescData) - }) - return file_tag_proto_rawDescData -} - -var file_tag_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_tag_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_tag_proto_goTypes = []interface{}{ - (SearchType)(0), // 0: pb.SearchType - (*Tag)(nil), // 1: pb.Tag -} -var file_tag_proto_depIdxs = []int32{ - 0, // 0: pb.Tag.searchable:type_name -> pb.SearchType - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_tag_proto_init() } -func file_tag_proto_init() { - if File_tag_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_tag_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Tag); 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_tag_proto_rawDesc, - NumEnums: 1, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_tag_proto_goTypes, - DependencyIndexes: file_tag_proto_depIdxs, - EnumInfos: file_tag_proto_enumTypes, - MessageInfos: file_tag_proto_msgTypes, - }.Build() - File_tag_proto = out.File - file_tag_proto_rawDesc = nil - file_tag_proto_goTypes = nil - file_tag_proto_depIdxs = nil -}