Linting protobuf files (#676)
This commit is contained in:
parent
66476da1ae
commit
3e461df470
@ -49,8 +49,17 @@ matrix:
|
||||
- env: MODE=lint
|
||||
install:
|
||||
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s -- -b ${GOPATH}/bin v1.12.2
|
||||
# install protoc
|
||||
- curl -L https://github.com/google/protobuf/releases/download/v3.6.1/protoc-3.6.1-linux-x86_64.zip -o /tmp/protoc.zip
|
||||
- unzip /tmp/protoc.zip -d "$HOME"/protoc
|
||||
# install proto linter
|
||||
- cp go.mod go.mod.backup
|
||||
- go get github.com/ckaznocha/protoc-gen-lint
|
||||
- go get golang.org/x/tools/go/packages
|
||||
- cp go.mod.backup go.mod
|
||||
script:
|
||||
- go run ./scripts/check-copyright.go
|
||||
- go run ./scripts/protobuf.go --protoc=$HOME/protoc/bin/protoc lint
|
||||
- golangci-lint run
|
||||
- gospace istidy
|
||||
|
||||
|
3
Makefile
3
Makefile
@ -58,7 +58,8 @@ goimports-fix: ## Applies goimports to every go file (excluding vendored files)
|
||||
.PHONY: proto
|
||||
proto: ## Rebuild protobuf files
|
||||
@echo "Running ${@}"
|
||||
./scripts/build-protos.sh
|
||||
go run scripts/protobuf.go install
|
||||
go run scripts/protobuf.go generate
|
||||
|
||||
##@ Test
|
||||
|
||||
|
@ -12,13 +12,13 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/cheggaaa/pb"
|
||||
progressbar "github.com/cheggaaa/pb"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"storj.io/storj/internal/fpath"
|
||||
"storj.io/storj/pkg/pb"
|
||||
"storj.io/storj/pkg/process"
|
||||
"storj.io/storj/pkg/storage/buckets"
|
||||
"storj.io/storj/pkg/storage/objects"
|
||||
"storj.io/storj/pkg/utils"
|
||||
)
|
||||
|
||||
@ -77,14 +77,14 @@ func upload(ctx context.Context, bs buckets.Store, src fpath.FPath, dst fpath.FP
|
||||
}
|
||||
|
||||
r := io.Reader(f)
|
||||
var bar *pb.ProgressBar
|
||||
var bar *progressbar.ProgressBar
|
||||
if showProgress {
|
||||
bar = pb.New(int(fi.Size())).SetUnits(pb.U_BYTES)
|
||||
bar = progressbar.New(int(fi.Size())).SetUnits(progressbar.U_BYTES)
|
||||
bar.Start()
|
||||
r = bar.NewProxyReader(r)
|
||||
}
|
||||
|
||||
meta := objects.SerializableMeta{}
|
||||
meta := pb.SerializableMeta{}
|
||||
expTime := time.Time{}
|
||||
|
||||
_, err = o.Put(ctx, dst.Path(), r, meta, expTime)
|
||||
@ -127,9 +127,9 @@ func download(ctx context.Context, bs buckets.Store, src fpath.FPath, dst fpath.
|
||||
}
|
||||
defer utils.LogClose(r)
|
||||
|
||||
var bar *pb.ProgressBar
|
||||
var bar *progressbar.ProgressBar
|
||||
if showProgress {
|
||||
bar = pb.New(int(rr.Size())).SetUnits(pb.U_BYTES)
|
||||
bar = progressbar.New(int(rr.Size())).SetUnits(progressbar.U_BYTES)
|
||||
bar.Start()
|
||||
r = bar.NewProxyReader(r)
|
||||
}
|
||||
@ -191,9 +191,9 @@ func copy(ctx context.Context, bs buckets.Store, src fpath.FPath, dst fpath.FPat
|
||||
}
|
||||
defer utils.LogClose(r)
|
||||
|
||||
var bar *pb.ProgressBar
|
||||
var bar *progressbar.ProgressBar
|
||||
if *progress {
|
||||
bar = pb.New(int(rr.Size())).SetUnits(pb.U_BYTES)
|
||||
bar = progressbar.New(int(rr.Size())).SetUnits(progressbar.U_BYTES)
|
||||
bar.Start()
|
||||
r = bar.NewProxyReader(r)
|
||||
}
|
||||
@ -205,7 +205,7 @@ func copy(ctx context.Context, bs buckets.Store, src fpath.FPath, dst fpath.FPat
|
||||
}
|
||||
}
|
||||
|
||||
meta := objects.SerializableMeta{}
|
||||
meta := pb.SerializableMeta{}
|
||||
expTime := time.Time{}
|
||||
|
||||
// if destination object name not specified, default to source object name
|
||||
|
@ -22,6 +22,7 @@ import (
|
||||
"go.uber.org/zap"
|
||||
|
||||
"storj.io/storj/internal/fpath"
|
||||
"storj.io/storj/pkg/pb"
|
||||
"storj.io/storj/pkg/process"
|
||||
"storj.io/storj/pkg/storage/meta"
|
||||
"storj.io/storj/pkg/storage/objects"
|
||||
@ -188,7 +189,7 @@ func (sf *storjFS) Mkdir(name string, mode uint32, context *fuse.Context) fuse.S
|
||||
zap.S().Debug("Mkdir: ", name)
|
||||
|
||||
reader := bytes.NewReader([]byte{})
|
||||
meta := objects.SerializableMeta{ContentType: "application/directory"}
|
||||
meta := pb.SerializableMeta{ContentType: "application/directory"}
|
||||
expTime := time.Time{}
|
||||
|
||||
_, err := sf.store.Put(sf.ctx, name+"/", reader, meta, expTime)
|
||||
@ -389,7 +390,7 @@ func (f *storjFile) getWriter(off int64) (*io.PipeWriter, error) {
|
||||
}
|
||||
}()
|
||||
|
||||
meta := objects.SerializableMeta{}
|
||||
meta := pb.SerializableMeta{}
|
||||
expTime := time.Time{}
|
||||
|
||||
m, err := f.store.Put(f.ctx, f.name, reader, meta, expTime)
|
||||
|
41
go.mod
41
go.mod
@ -1,5 +1,24 @@
|
||||
module storj.io/storj
|
||||
|
||||
// force specific versions for minio
|
||||
require (
|
||||
github.com/btcsuite/btcutil v0.0.0-20180706230648-ab6388e0c60a
|
||||
github.com/garyburd/redigo v1.0.1-0.20170216214944-0d253a66e6e1 // indirect
|
||||
github.com/go-ole/go-ole v1.2.1 // indirect
|
||||
github.com/graphql-go/graphql v0.7.6
|
||||
github.com/hanwen/go-fuse v0.0.0-20181027161220-c029b69a13a7
|
||||
github.com/inconshreveable/mousetrap v1.0.0 // indirect
|
||||
github.com/mattn/go-colorable v0.0.9 // indirect
|
||||
|
||||
github.com/minio/minio v0.0.0-20180508161510-54cd29b51c38
|
||||
github.com/mitchellh/mapstructure v1.1.1 // indirect
|
||||
|
||||
github.com/prometheus/client_golang v0.9.0-pre1.0.20180416233856-82f5ff156b29 // indirect
|
||||
github.com/segmentio/go-prompt v1.2.1-0.20161017233205-f0d19b6901ad // indirect
|
||||
)
|
||||
|
||||
exclude gopkg.in/olivere/elastic.v5 v5.0.72 // buggy import, see https://github.com/olivere/elastic/pull/869
|
||||
|
||||
require (
|
||||
github.com/BurntSushi/toml v0.3.1 // indirect
|
||||
github.com/Shopify/toxiproxy v2.1.3+incompatible // indirect
|
||||
@ -64,7 +83,6 @@ require (
|
||||
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c // indirect
|
||||
github.com/pierrec/lz4 v2.0.5+incompatible // indirect
|
||||
github.com/pkg/profile v1.2.1 // indirect
|
||||
|
||||
github.com/rcrowley/go-metrics v0.0.0-20180503174638-e2704e165165 // indirect
|
||||
github.com/rs/cors v1.5.0 // indirect
|
||||
github.com/shirou/gopsutil v2.17.12+incompatible
|
||||
@ -88,6 +106,7 @@ require (
|
||||
go.uber.org/zap v1.9.1
|
||||
golang.org/x/crypto v0.0.0-20181009213950-7c1a557ab941
|
||||
golang.org/x/net v0.0.0-20181003013248-f5e5bdd77824
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f
|
||||
golang.org/x/sys v0.0.0-20181011152604-fa43e7bc11ba
|
||||
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2 // indirect
|
||||
google.golang.org/grpc v1.15.0
|
||||
@ -97,23 +116,3 @@ require (
|
||||
gopkg.in/spacemonkeygo/monkit.v2 v2.0.0-20180827161543-6ebf5a752f9b
|
||||
gopkg.in/vmihailenco/msgpack.v2 v2.9.1 // indirect
|
||||
)
|
||||
|
||||
// force specific versions for minio
|
||||
require (
|
||||
github.com/btcsuite/btcutil v0.0.0-20180706230648-ab6388e0c60a
|
||||
github.com/garyburd/redigo v1.0.1-0.20170216214944-0d253a66e6e1 // indirect
|
||||
github.com/go-ole/go-ole v1.2.1 // indirect
|
||||
github.com/graphql-go/graphql v0.7.6
|
||||
github.com/hanwen/go-fuse v0.0.0-20181027161220-c029b69a13a7
|
||||
github.com/inconshreveable/mousetrap v1.0.0 // indirect
|
||||
github.com/mattn/go-colorable v0.0.9 // indirect
|
||||
|
||||
github.com/minio/minio v0.0.0-20180508161510-54cd29b51c38
|
||||
github.com/mitchellh/mapstructure v1.1.1 // indirect
|
||||
|
||||
github.com/prometheus/client_golang v0.9.0-pre1.0.20180416233856-82f5ff156b29 // indirect
|
||||
github.com/segmentio/go-prompt v1.2.1-0.20161017233205-f0d19b6901ad // indirect
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f
|
||||
)
|
||||
|
||||
exclude gopkg.in/olivere/elastic.v5 v5.0.72 // buggy import, see https://github.com/olivere/elastic/pull/869
|
||||
|
1
go.sum
1
go.sum
@ -354,6 +354,7 @@ golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2 h1:+DCIGbF/swA92ohVg0//6X2I
|
||||
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52 h1:JG/0uqcGdTNgq7FdU+61l5Pdmb8putNZlXb65bJBROs=
|
||||
golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20180911133044-677d2ff680c1 h1:dzEuQYa6+a3gROnSlgly5ERUm4SZKJt+dh+4iSbO+bI=
|
||||
golang.org/x/tools v0.0.0-20180911133044-677d2ff680c1/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
google.golang.org/api v0.0.0-20180818000503-e21acd801f91/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
|
||||
google.golang.org/api v0.0.0-20180826000528-7954115fcf34/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
|
||||
|
@ -15,10 +15,10 @@ import (
|
||||
"github.com/zeebo/errs"
|
||||
monkit "gopkg.in/spacemonkeygo/monkit.v2"
|
||||
|
||||
"storj.io/storj/pkg/pb"
|
||||
"storj.io/storj/pkg/ranger"
|
||||
"storj.io/storj/pkg/storage/buckets"
|
||||
"storj.io/storj/pkg/storage/meta"
|
||||
"storj.io/storj/pkg/storage/objects"
|
||||
"storj.io/storj/pkg/storj"
|
||||
"storj.io/storj/pkg/utils"
|
||||
)
|
||||
@ -355,7 +355,7 @@ func (s *storjObjects) CopyObject(ctx context.Context, srcBucket, srcObject, des
|
||||
|
||||
defer utils.LogClose(r)
|
||||
|
||||
serMetaInfo := objects.SerializableMeta{
|
||||
serMetaInfo := pb.SerializableMeta{
|
||||
ContentType: srcInfo.ContentType,
|
||||
UserDefined: srcInfo.UserDefined,
|
||||
}
|
||||
@ -363,7 +363,7 @@ func (s *storjObjects) CopyObject(ctx context.Context, srcBucket, srcObject, des
|
||||
return s.putObject(ctx, destBucket, destObject, r, serMetaInfo)
|
||||
}
|
||||
|
||||
func (s *storjObjects) putObject(ctx context.Context, bucket, object string, r io.Reader, meta objects.SerializableMeta) (objInfo minio.ObjectInfo, err error) {
|
||||
func (s *storjObjects) putObject(ctx context.Context, bucket, object string, r io.Reader, meta pb.SerializableMeta) (objInfo minio.ObjectInfo, err error) {
|
||||
defer mon.Task()(&ctx)(&err)
|
||||
|
||||
// setting zero value means the object never expires
|
||||
@ -390,7 +390,7 @@ func (s *storjObjects) PutObject(ctx context.Context, bucket, object string, dat
|
||||
tempContType := metadata["content-type"]
|
||||
delete(metadata, "content-type")
|
||||
//metadata serialized
|
||||
serMetaInfo := objects.SerializableMeta{
|
||||
serMetaInfo := pb.SerializableMeta{
|
||||
ContentType: tempContType,
|
||||
UserDefined: metadata,
|
||||
}
|
||||
|
@ -17,6 +17,7 @@ import (
|
||||
"github.com/minio/minio/pkg/hash"
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"storj.io/storj/pkg/pb"
|
||||
"storj.io/storj/pkg/ranger"
|
||||
"storj.io/storj/pkg/storage/buckets"
|
||||
mock_buckets "storj.io/storj/pkg/storage/buckets/mocks"
|
||||
@ -63,7 +64,7 @@ func TestCopyObject(t *testing.T) {
|
||||
"userdef_key2": "userdef_val2",
|
||||
}
|
||||
|
||||
serMeta := objects.SerializableMeta{
|
||||
serMeta := pb.SerializableMeta{
|
||||
ContentType: metadata["content-type"],
|
||||
UserDefined: map[string]string{
|
||||
"userdef_key1": metadata["userdef_key1"],
|
||||
@ -237,7 +238,7 @@ func TestPutObject(t *testing.T) {
|
||||
"userdef_key2": "userdef_val2",
|
||||
}
|
||||
|
||||
serMeta := objects.SerializableMeta{
|
||||
serMeta := pb.SerializableMeta{
|
||||
ContentType: metadata["content-type"],
|
||||
UserDefined: map[string]string{
|
||||
"userdef_key1": metadata["userdef_key1"],
|
||||
@ -290,7 +291,7 @@ func TestGetObjectInfo(t *testing.T) {
|
||||
Expiration: time.Time{},
|
||||
Size: 1234,
|
||||
Checksum: "test-checksum",
|
||||
SerializableMeta: objects.SerializableMeta{
|
||||
SerializableMeta: pb.SerializableMeta{
|
||||
ContentType: "media/foo",
|
||||
UserDefined: map[string]string{
|
||||
"userdef_key1": "userdef_val1",
|
||||
|
@ -15,7 +15,7 @@ import (
|
||||
minio "github.com/minio/minio/cmd"
|
||||
"github.com/minio/minio/pkg/hash"
|
||||
|
||||
"storj.io/storj/pkg/storage/objects"
|
||||
"storj.io/storj/pkg/pb"
|
||||
)
|
||||
|
||||
func (s *storjObjects) NewMultipartUpload(ctx context.Context, bucket, object string, metadata map[string]string) (uploadID string, err error) {
|
||||
@ -43,7 +43,7 @@ func (s *storjObjects) NewMultipartUpload(ctx context.Context, bucket, object st
|
||||
delete(metadata, "content-type")
|
||||
|
||||
// metadata serialized
|
||||
serMetaInfo := objects.SerializableMeta{
|
||||
serMetaInfo := pb.SerializableMeta{
|
||||
ContentType: tempContType,
|
||||
UserDefined: metadata,
|
||||
}
|
||||
|
@ -15,6 +15,7 @@ import (
|
||||
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
|
||||
"storj.io/storj/pkg/pb"
|
||||
ranger "storj.io/storj/pkg/ranger"
|
||||
objects "storj.io/storj/pkg/storage/objects"
|
||||
)
|
||||
@ -96,7 +97,7 @@ func (mr *MockStoreMockRecorder) Meta(arg0, arg1 interface{}) *gomock.Call {
|
||||
}
|
||||
|
||||
// Put mocks base method
|
||||
func (m *MockStore) Put(arg0 context.Context, arg1 string, arg2 io.Reader, arg3 objects.SerializableMeta, arg4 time.Time) (objects.Meta, error) {
|
||||
func (m *MockStore) Put(arg0 context.Context, arg1 string, arg2 io.Reader, arg3 pb.SerializableMeta, arg4 time.Time) (objects.Meta, error) {
|
||||
ret := m.ctrl.Call(m, "Put", arg0, arg1, arg2, arg3, arg4)
|
||||
ret0, _ := ret[0].(objects.Meta)
|
||||
ret1, _ := ret[1].(error)
|
||||
|
@ -7,8 +7,10 @@ import proto "github.com/gogo/protobuf/proto"
|
||||
import fmt "fmt"
|
||||
import math "math"
|
||||
|
||||
import context "golang.org/x/net/context"
|
||||
import grpc "google.golang.org/grpc"
|
||||
import (
|
||||
context "golang.org/x/net/context"
|
||||
grpc "google.golang.org/grpc"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
@ -41,7 +43,7 @@ func (x AgreementsSummary_Status) String() string {
|
||||
return proto.EnumName(AgreementsSummary_Status_name, int32(x))
|
||||
}
|
||||
func (AgreementsSummary_Status) EnumDescriptor() ([]byte, []int) {
|
||||
return fileDescriptor_bandwidth_acc7ad1b0a6a13c6, []int{0, 0}
|
||||
return fileDescriptor_bandwidth_01db992f91c47bae, []int{0, 0}
|
||||
}
|
||||
|
||||
type AgreementsSummary struct {
|
||||
@ -55,7 +57,7 @@ func (m *AgreementsSummary) Reset() { *m = AgreementsSummary{} }
|
||||
func (m *AgreementsSummary) String() string { return proto.CompactTextString(m) }
|
||||
func (*AgreementsSummary) ProtoMessage() {}
|
||||
func (*AgreementsSummary) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_bandwidth_acc7ad1b0a6a13c6, []int{0}
|
||||
return fileDescriptor_bandwidth_01db992f91c47bae, []int{0}
|
||||
}
|
||||
func (m *AgreementsSummary) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_AgreementsSummary.Unmarshal(m, b)
|
||||
@ -95,8 +97,9 @@ var _ grpc.ClientConn
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
const _ = grpc.SupportPackageIsVersion4
|
||||
|
||||
// Client API for Bandwidth service
|
||||
|
||||
// BandwidthClient is the client API for Bandwidth service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
||||
type BandwidthClient interface {
|
||||
BandwidthAgreements(ctx context.Context, in *RenterBandwidthAllocation, opts ...grpc.CallOption) (*AgreementsSummary, error)
|
||||
}
|
||||
@ -118,8 +121,7 @@ func (c *bandwidthClient) BandwidthAgreements(ctx context.Context, in *RenterBan
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// Server API for Bandwidth service
|
||||
|
||||
// BandwidthServer is the server API for Bandwidth service.
|
||||
type BandwidthServer interface {
|
||||
BandwidthAgreements(context.Context, *RenterBandwidthAllocation) (*AgreementsSummary, error)
|
||||
}
|
||||
@ -159,9 +161,9 @@ var _Bandwidth_serviceDesc = grpc.ServiceDesc{
|
||||
Metadata: "bandwidth.proto",
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("bandwidth.proto", fileDescriptor_bandwidth_acc7ad1b0a6a13c6) }
|
||||
func init() { proto.RegisterFile("bandwidth.proto", fileDescriptor_bandwidth_01db992f91c47bae) }
|
||||
|
||||
var fileDescriptor_bandwidth_acc7ad1b0a6a13c6 = []byte{
|
||||
var fileDescriptor_bandwidth_01db992f91c47bae = []byte{
|
||||
// 196 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4f, 0x4a, 0xcc, 0x4b,
|
||||
0x29, 0xcf, 0x4c, 0x29, 0xc9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x84, 0x0b, 0x48,
|
||||
|
@ -31,7 +31,7 @@ func (m *InjuredSegment) Reset() { *m = InjuredSegment{} }
|
||||
func (m *InjuredSegment) String() string { return proto.CompactTextString(m) }
|
||||
func (*InjuredSegment) ProtoMessage() {}
|
||||
func (*InjuredSegment) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_datarepair_ed86aa1a63e3d6e4, []int{0}
|
||||
return fileDescriptor_datarepair_13e4beab54f194bd, []int{0}
|
||||
}
|
||||
func (m *InjuredSegment) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_InjuredSegment.Unmarshal(m, b)
|
||||
@ -69,9 +69,9 @@ func init() {
|
||||
proto.RegisterType((*InjuredSegment)(nil), "repair.InjuredSegment")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("datarepair.proto", fileDescriptor_datarepair_ed86aa1a63e3d6e4) }
|
||||
func init() { proto.RegisterFile("datarepair.proto", fileDescriptor_datarepair_13e4beab54f194bd) }
|
||||
|
||||
var fileDescriptor_datarepair_ed86aa1a63e3d6e4 = []byte{
|
||||
var fileDescriptor_datarepair_13e4beab54f194bd = []byte{
|
||||
// 119 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x48, 0x49, 0x2c, 0x49,
|
||||
0x2c, 0x4a, 0x2d, 0x48, 0xcc, 0x2c, 0xd2, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x83, 0xf0,
|
||||
|
@ -8,8 +8,10 @@ import fmt "fmt"
|
||||
import math "math"
|
||||
import _ "github.com/gogo/protobuf/gogoproto"
|
||||
|
||||
import context "golang.org/x/net/context"
|
||||
import grpc "google.golang.org/grpc"
|
||||
import (
|
||||
context "golang.org/x/net/context"
|
||||
grpc "google.golang.org/grpc"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
@ -34,7 +36,7 @@ func (m *GetStatsRequest) Reset() { *m = GetStatsRequest{} }
|
||||
func (m *GetStatsRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*GetStatsRequest) ProtoMessage() {}
|
||||
func (*GetStatsRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_inspector_9ff12d18f09cf85c, []int{0}
|
||||
return fileDescriptor_inspector_4eea8e7f2bc78f51, []int{0}
|
||||
}
|
||||
func (m *GetStatsRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_GetStatsRequest.Unmarshal(m, b)
|
||||
@ -67,7 +69,7 @@ func (m *GetStatsResponse) Reset() { *m = GetStatsResponse{} }
|
||||
func (m *GetStatsResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*GetStatsResponse) ProtoMessage() {}
|
||||
func (*GetStatsResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_inspector_9ff12d18f09cf85c, []int{1}
|
||||
return fileDescriptor_inspector_4eea8e7f2bc78f51, []int{1}
|
||||
}
|
||||
func (m *GetStatsResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_GetStatsResponse.Unmarshal(m, b)
|
||||
@ -124,7 +126,7 @@ func (m *CreateStatsRequest) Reset() { *m = CreateStatsRequest{} }
|
||||
func (m *CreateStatsRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*CreateStatsRequest) ProtoMessage() {}
|
||||
func (*CreateStatsRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_inspector_9ff12d18f09cf85c, []int{2}
|
||||
return fileDescriptor_inspector_4eea8e7f2bc78f51, []int{2}
|
||||
}
|
||||
func (m *CreateStatsRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_CreateStatsRequest.Unmarshal(m, b)
|
||||
@ -182,7 +184,7 @@ func (m *CreateStatsResponse) Reset() { *m = CreateStatsResponse{} }
|
||||
func (m *CreateStatsResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*CreateStatsResponse) ProtoMessage() {}
|
||||
func (*CreateStatsResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_inspector_9ff12d18f09cf85c, []int{3}
|
||||
return fileDescriptor_inspector_4eea8e7f2bc78f51, []int{3}
|
||||
}
|
||||
func (m *CreateStatsResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_CreateStatsResponse.Unmarshal(m, b)
|
||||
@ -215,7 +217,7 @@ func (m *CountNodesResponse) Reset() { *m = CountNodesResponse{} }
|
||||
func (m *CountNodesResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*CountNodesResponse) ProtoMessage() {}
|
||||
func (*CountNodesResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_inspector_9ff12d18f09cf85c, []int{4}
|
||||
return fileDescriptor_inspector_4eea8e7f2bc78f51, []int{4}
|
||||
}
|
||||
func (m *CountNodesResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_CountNodesResponse.Unmarshal(m, b)
|
||||
@ -259,7 +261,7 @@ func (m *CountNodesRequest) Reset() { *m = CountNodesRequest{} }
|
||||
func (m *CountNodesRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*CountNodesRequest) ProtoMessage() {}
|
||||
func (*CountNodesRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_inspector_9ff12d18f09cf85c, []int{5}
|
||||
return fileDescriptor_inspector_4eea8e7f2bc78f51, []int{5}
|
||||
}
|
||||
func (m *CountNodesRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_CountNodesRequest.Unmarshal(m, b)
|
||||
@ -290,7 +292,7 @@ func (m *GetBucketsRequest) Reset() { *m = GetBucketsRequest{} }
|
||||
func (m *GetBucketsRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*GetBucketsRequest) ProtoMessage() {}
|
||||
func (*GetBucketsRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_inspector_9ff12d18f09cf85c, []int{6}
|
||||
return fileDescriptor_inspector_4eea8e7f2bc78f51, []int{6}
|
||||
}
|
||||
func (m *GetBucketsRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_GetBucketsRequest.Unmarshal(m, b)
|
||||
@ -322,7 +324,7 @@ func (m *GetBucketsResponse) Reset() { *m = GetBucketsResponse{} }
|
||||
func (m *GetBucketsResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*GetBucketsResponse) ProtoMessage() {}
|
||||
func (*GetBucketsResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_inspector_9ff12d18f09cf85c, []int{7}
|
||||
return fileDescriptor_inspector_4eea8e7f2bc78f51, []int{7}
|
||||
}
|
||||
func (m *GetBucketsResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_GetBucketsResponse.Unmarshal(m, b)
|
||||
@ -361,7 +363,7 @@ func (m *GetBucketRequest) Reset() { *m = GetBucketRequest{} }
|
||||
func (m *GetBucketRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*GetBucketRequest) ProtoMessage() {}
|
||||
func (*GetBucketRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_inspector_9ff12d18f09cf85c, []int{8}
|
||||
return fileDescriptor_inspector_4eea8e7f2bc78f51, []int{8}
|
||||
}
|
||||
func (m *GetBucketRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_GetBucketRequest.Unmarshal(m, b)
|
||||
@ -393,7 +395,7 @@ func (m *GetBucketResponse) Reset() { *m = GetBucketResponse{} }
|
||||
func (m *GetBucketResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*GetBucketResponse) ProtoMessage() {}
|
||||
func (*GetBucketResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_inspector_9ff12d18f09cf85c, []int{9}
|
||||
return fileDescriptor_inspector_4eea8e7f2bc78f51, []int{9}
|
||||
}
|
||||
func (m *GetBucketResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_GetBucketResponse.Unmarshal(m, b)
|
||||
@ -431,7 +433,7 @@ func (m *Bucket) Reset() { *m = Bucket{} }
|
||||
func (m *Bucket) String() string { return proto.CompactTextString(m) }
|
||||
func (*Bucket) ProtoMessage() {}
|
||||
func (*Bucket) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_inspector_9ff12d18f09cf85c, []int{10}
|
||||
return fileDescriptor_inspector_4eea8e7f2bc78f51, []int{10}
|
||||
}
|
||||
func (m *Bucket) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_Bucket.Unmarshal(m, b)
|
||||
@ -469,7 +471,7 @@ func (m *BucketList) Reset() { *m = BucketList{} }
|
||||
func (m *BucketList) String() string { return proto.CompactTextString(m) }
|
||||
func (*BucketList) ProtoMessage() {}
|
||||
func (*BucketList) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_inspector_9ff12d18f09cf85c, []int{11}
|
||||
return fileDescriptor_inspector_4eea8e7f2bc78f51, []int{11}
|
||||
}
|
||||
func (m *BucketList) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_BucketList.Unmarshal(m, b)
|
||||
@ -509,7 +511,7 @@ func (m *PingNodeRequest) Reset() { *m = PingNodeRequest{} }
|
||||
func (m *PingNodeRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*PingNodeRequest) ProtoMessage() {}
|
||||
func (*PingNodeRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_inspector_9ff12d18f09cf85c, []int{12}
|
||||
return fileDescriptor_inspector_4eea8e7f2bc78f51, []int{12}
|
||||
}
|
||||
func (m *PingNodeRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_PingNodeRequest.Unmarshal(m, b)
|
||||
@ -547,7 +549,7 @@ func (m *PingNodeResponse) Reset() { *m = PingNodeResponse{} }
|
||||
func (m *PingNodeResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*PingNodeResponse) ProtoMessage() {}
|
||||
func (*PingNodeResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_inspector_9ff12d18f09cf85c, []int{13}
|
||||
return fileDescriptor_inspector_4eea8e7f2bc78f51, []int{13}
|
||||
}
|
||||
func (m *PingNodeResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_PingNodeResponse.Unmarshal(m, b)
|
||||
@ -599,8 +601,9 @@ var _ grpc.ClientConn
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
const _ = grpc.SupportPackageIsVersion4
|
||||
|
||||
// Client API for Inspector service
|
||||
|
||||
// InspectorClient is the client API for Inspector service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
||||
type InspectorClient interface {
|
||||
// Kad/Overlay commands:
|
||||
// CountNodes returns the number of nodes in the cache and in the routing table
|
||||
@ -680,8 +683,7 @@ func (c *inspectorClient) CreateStats(ctx context.Context, in *CreateStatsReques
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// Server API for Inspector service
|
||||
|
||||
// InspectorServer is the server API for Inspector service.
|
||||
type InspectorServer interface {
|
||||
// Kad/Overlay commands:
|
||||
// CountNodes returns the number of nodes in the cache and in the routing table
|
||||
@ -844,9 +846,9 @@ var _Inspector_serviceDesc = grpc.ServiceDesc{
|
||||
Metadata: "inspector.proto",
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("inspector.proto", fileDescriptor_inspector_9ff12d18f09cf85c) }
|
||||
func init() { proto.RegisterFile("inspector.proto", fileDescriptor_inspector_4eea8e7f2bc78f51) }
|
||||
|
||||
var fileDescriptor_inspector_9ff12d18f09cf85c = []byte{
|
||||
var fileDescriptor_inspector_4eea8e7f2bc78f51 = []byte{
|
||||
// 564 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x94, 0xcd, 0x6e, 0x1a, 0x3f,
|
||||
0x14, 0xc5, 0xff, 0x33, 0x13, 0x08, 0x5c, 0x50, 0x48, 0x4c, 0xfe, 0x12, 0x1a, 0x68, 0xa0, 0xde,
|
||||
|
@ -18,204 +18,72 @@ var _ = math.Inf
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
|
||||
|
||||
type SegmentMeta struct {
|
||||
EncryptedKey []byte `protobuf:"bytes,1,opt,name=encrypted_key,json=encryptedKey,proto3" json:"encrypted_key,omitempty"`
|
||||
KeyNonce []byte `protobuf:"bytes,2,opt,name=key_nonce,json=keyNonce,proto3" json:"key_nonce,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
// SerializableMeta is the object metadata that will be stored serialized
|
||||
type SerializableMeta struct {
|
||||
ContentType string `protobuf:"bytes,1,opt,name=content_type,json=contentType,proto3" json:"content_type,omitempty"`
|
||||
UserDefined map[string]string `protobuf:"bytes,2,rep,name=user_defined,json=userDefined" json:"user_defined,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *SegmentMeta) Reset() { *m = SegmentMeta{} }
|
||||
func (m *SegmentMeta) String() string { return proto.CompactTextString(m) }
|
||||
func (*SegmentMeta) ProtoMessage() {}
|
||||
func (*SegmentMeta) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_meta_f2973588633dae4c, []int{0}
|
||||
func (m *SerializableMeta) Reset() { *m = SerializableMeta{} }
|
||||
func (m *SerializableMeta) String() string { return proto.CompactTextString(m) }
|
||||
func (*SerializableMeta) ProtoMessage() {}
|
||||
func (*SerializableMeta) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_meta_12afffbb4ed1a0bb, []int{0}
|
||||
}
|
||||
func (m *SegmentMeta) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_SegmentMeta.Unmarshal(m, b)
|
||||
func (m *SerializableMeta) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_SerializableMeta.Unmarshal(m, b)
|
||||
}
|
||||
func (m *SegmentMeta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_SegmentMeta.Marshal(b, m, deterministic)
|
||||
func (m *SerializableMeta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_SerializableMeta.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (dst *SegmentMeta) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_SegmentMeta.Merge(dst, src)
|
||||
func (dst *SerializableMeta) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_SerializableMeta.Merge(dst, src)
|
||||
}
|
||||
func (m *SegmentMeta) XXX_Size() int {
|
||||
return xxx_messageInfo_SegmentMeta.Size(m)
|
||||
func (m *SerializableMeta) XXX_Size() int {
|
||||
return xxx_messageInfo_SerializableMeta.Size(m)
|
||||
}
|
||||
func (m *SegmentMeta) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_SegmentMeta.DiscardUnknown(m)
|
||||
func (m *SerializableMeta) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_SerializableMeta.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_SegmentMeta proto.InternalMessageInfo
|
||||
var xxx_messageInfo_SerializableMeta proto.InternalMessageInfo
|
||||
|
||||
func (m *SegmentMeta) GetEncryptedKey() []byte {
|
||||
func (m *SerializableMeta) GetContentType() string {
|
||||
if m != nil {
|
||||
return m.EncryptedKey
|
||||
return m.ContentType
|
||||
}
|
||||
return nil
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *SegmentMeta) GetKeyNonce() []byte {
|
||||
func (m *SerializableMeta) GetUserDefined() map[string]string {
|
||||
if m != nil {
|
||||
return m.KeyNonce
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type StreamInfo struct {
|
||||
NumberOfSegments int64 `protobuf:"varint,1,opt,name=number_of_segments,json=numberOfSegments,proto3" json:"number_of_segments,omitempty"`
|
||||
SegmentsSize int64 `protobuf:"varint,2,opt,name=segments_size,json=segmentsSize,proto3" json:"segments_size,omitempty"`
|
||||
LastSegmentSize int64 `protobuf:"varint,3,opt,name=last_segment_size,json=lastSegmentSize,proto3" json:"last_segment_size,omitempty"`
|
||||
Metadata []byte `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *StreamInfo) Reset() { *m = StreamInfo{} }
|
||||
func (m *StreamInfo) String() string { return proto.CompactTextString(m) }
|
||||
func (*StreamInfo) ProtoMessage() {}
|
||||
func (*StreamInfo) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_meta_f2973588633dae4c, []int{1}
|
||||
}
|
||||
func (m *StreamInfo) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_StreamInfo.Unmarshal(m, b)
|
||||
}
|
||||
func (m *StreamInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_StreamInfo.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (dst *StreamInfo) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_StreamInfo.Merge(dst, src)
|
||||
}
|
||||
func (m *StreamInfo) XXX_Size() int {
|
||||
return xxx_messageInfo_StreamInfo.Size(m)
|
||||
}
|
||||
func (m *StreamInfo) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_StreamInfo.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_StreamInfo proto.InternalMessageInfo
|
||||
|
||||
func (m *StreamInfo) GetNumberOfSegments() int64 {
|
||||
if m != nil {
|
||||
return m.NumberOfSegments
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *StreamInfo) GetSegmentsSize() int64 {
|
||||
if m != nil {
|
||||
return m.SegmentsSize
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *StreamInfo) GetLastSegmentSize() int64 {
|
||||
if m != nil {
|
||||
return m.LastSegmentSize
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *StreamInfo) GetMetadata() []byte {
|
||||
if m != nil {
|
||||
return m.Metadata
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type StreamMeta struct {
|
||||
EncryptedStreamInfo []byte `protobuf:"bytes,1,opt,name=encrypted_stream_info,json=encryptedStreamInfo,proto3" json:"encrypted_stream_info,omitempty"`
|
||||
EncryptionType int32 `protobuf:"varint,2,opt,name=encryption_type,json=encryptionType,proto3" json:"encryption_type,omitempty"`
|
||||
EncryptionBlockSize int32 `protobuf:"varint,3,opt,name=encryption_block_size,json=encryptionBlockSize,proto3" json:"encryption_block_size,omitempty"`
|
||||
LastSegmentMeta *SegmentMeta `protobuf:"bytes,4,opt,name=last_segment_meta,json=lastSegmentMeta" json:"last_segment_meta,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *StreamMeta) Reset() { *m = StreamMeta{} }
|
||||
func (m *StreamMeta) String() string { return proto.CompactTextString(m) }
|
||||
func (*StreamMeta) ProtoMessage() {}
|
||||
func (*StreamMeta) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_meta_f2973588633dae4c, []int{2}
|
||||
}
|
||||
func (m *StreamMeta) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_StreamMeta.Unmarshal(m, b)
|
||||
}
|
||||
func (m *StreamMeta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_StreamMeta.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (dst *StreamMeta) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_StreamMeta.Merge(dst, src)
|
||||
}
|
||||
func (m *StreamMeta) XXX_Size() int {
|
||||
return xxx_messageInfo_StreamMeta.Size(m)
|
||||
}
|
||||
func (m *StreamMeta) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_StreamMeta.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_StreamMeta proto.InternalMessageInfo
|
||||
|
||||
func (m *StreamMeta) GetEncryptedStreamInfo() []byte {
|
||||
if m != nil {
|
||||
return m.EncryptedStreamInfo
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *StreamMeta) GetEncryptionType() int32 {
|
||||
if m != nil {
|
||||
return m.EncryptionType
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *StreamMeta) GetEncryptionBlockSize() int32 {
|
||||
if m != nil {
|
||||
return m.EncryptionBlockSize
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *StreamMeta) GetLastSegmentMeta() *SegmentMeta {
|
||||
if m != nil {
|
||||
return m.LastSegmentMeta
|
||||
return m.UserDefined
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*SegmentMeta)(nil), "streams.SegmentMeta")
|
||||
proto.RegisterType((*StreamInfo)(nil), "streams.StreamInfo")
|
||||
proto.RegisterType((*StreamMeta)(nil), "streams.StreamMeta")
|
||||
proto.RegisterType((*SerializableMeta)(nil), "pb.SerializableMeta")
|
||||
proto.RegisterMapType((map[string]string)(nil), "pb.SerializableMeta.UserDefinedEntry")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("meta.proto", fileDescriptor_meta_f2973588633dae4c) }
|
||||
func init() { proto.RegisterFile("meta.proto", fileDescriptor_meta_12afffbb4ed1a0bb) }
|
||||
|
||||
var fileDescriptor_meta_f2973588633dae4c = []byte{
|
||||
// 306 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x51, 0xcd, 0x4e, 0xf3, 0x30,
|
||||
0x10, 0x54, 0xff, 0xbe, 0xaf, 0x6c, 0x03, 0x05, 0x03, 0x52, 0x04, 0x17, 0x14, 0x0e, 0x20, 0x84,
|
||||
0x72, 0x28, 0x2f, 0x80, 0x7a, 0x43, 0x08, 0x2a, 0x25, 0x9c, 0xb8, 0x58, 0x4e, 0xba, 0x41, 0x51,
|
||||
0x1a, 0x3b, 0x8a, 0xcd, 0xc1, 0x7d, 0x21, 0x1e, 0x8b, 0x57, 0x41, 0xb6, 0xf3, 0x07, 0xc7, 0x9d,
|
||||
0x19, 0xcd, 0xce, 0xec, 0x02, 0x94, 0xa8, 0x58, 0x58, 0xd5, 0x42, 0x09, 0xf2, 0x5f, 0xaa, 0x1a,
|
||||
0x59, 0x29, 0x83, 0x0d, 0x2c, 0x62, 0xfc, 0x28, 0x91, 0xab, 0x17, 0x54, 0x8c, 0x5c, 0xc3, 0x21,
|
||||
0xf2, 0xb4, 0xd6, 0x95, 0xc2, 0x2d, 0x2d, 0x50, 0xfb, 0xa3, 0xab, 0xd1, 0xad, 0x17, 0x79, 0x1d,
|
||||
0xf8, 0x8c, 0x9a, 0x5c, 0xc2, 0x41, 0x81, 0x9a, 0x72, 0xc1, 0x53, 0xf4, 0xc7, 0x56, 0x30, 0x2f,
|
||||
0x50, 0xbf, 0x9a, 0x39, 0xf8, 0x1a, 0x01, 0xc4, 0xd6, 0xfc, 0x89, 0x67, 0x82, 0xdc, 0x03, 0xe1,
|
||||
0x9f, 0x65, 0x82, 0x35, 0x15, 0x19, 0x95, 0x6e, 0x93, 0xb4, 0xae, 0x93, 0xe8, 0xd8, 0x31, 0x9b,
|
||||
0xac, 0x49, 0x20, 0xcd, 0xfa, 0x56, 0x43, 0x65, 0xbe, 0x77, 0xee, 0x93, 0xc8, 0x6b, 0xc1, 0x38,
|
||||
0xdf, 0x23, 0xb9, 0x83, 0x93, 0x1d, 0x93, 0xaa, 0x75, 0x73, 0xc2, 0x89, 0x15, 0x2e, 0x0d, 0xd1,
|
||||
0xb8, 0x59, 0xed, 0x05, 0xcc, 0x4d, 0xeb, 0x2d, 0x53, 0xcc, 0x9f, 0xba, 0xa4, 0xed, 0x1c, 0x7c,
|
||||
0x77, 0x49, 0x6d, 0xf5, 0x15, 0x9c, 0xf7, 0xd5, 0xdd, 0x79, 0x68, 0xce, 0x33, 0xd1, 0x9c, 0xe0,
|
||||
0xb4, 0x23, 0x07, 0xed, 0x6e, 0x60, 0xd9, 0xc0, 0xb9, 0xe0, 0x54, 0xe9, 0xca, 0x25, 0x9e, 0x45,
|
||||
0x47, 0x3d, 0xfc, 0xa6, 0x2b, 0x1c, 0x98, 0x1b, 0x61, 0xb2, 0x13, 0x69, 0xd1, 0xe7, 0x9e, 0x75,
|
||||
0xe6, 0xb9, 0xe0, 0x6b, 0xc3, 0xd9, 0xec, 0x8f, 0x7f, 0x7a, 0x9a, 0xe0, 0xb6, 0xc4, 0x62, 0x75,
|
||||
0x16, 0x36, 0xff, 0x0b, 0x07, 0xcf, 0xfb, 0xd5, 0xde, 0x00, 0xeb, 0xe9, 0xfb, 0xb8, 0x4a, 0x92,
|
||||
0x7f, 0xf6, 0xe5, 0x0f, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x24, 0xc6, 0xa2, 0x54, 0x00, 0x02,
|
||||
0x00, 0x00,
|
||||
var fileDescriptor_meta_12afffbb4ed1a0bb = []byte{
|
||||
// 191 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0xca, 0x4d, 0x2d, 0x49,
|
||||
0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0xcf, 0x4f, 0xca, 0x4a, 0x4d, 0x2e, 0x29, 0x56,
|
||||
0x3a, 0xc2, 0xc8, 0x25, 0x10, 0x9c, 0x5a, 0x94, 0x99, 0x98, 0x93, 0x59, 0x95, 0x98, 0x94, 0x93,
|
||||
0xea, 0x9b, 0x5a, 0x92, 0x28, 0xa4, 0xc8, 0xc5, 0x93, 0x9c, 0x9f, 0x57, 0x92, 0x9a, 0x57, 0x12,
|
||||
0x5f, 0x52, 0x59, 0x90, 0x2a, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x19, 0xc4, 0x0d, 0x15, 0x0b, 0xa9,
|
||||
0x2c, 0x48, 0x15, 0xf2, 0xe5, 0xe2, 0x29, 0x2d, 0x4e, 0x2d, 0x8a, 0x4f, 0x49, 0x4d, 0xcb, 0xcc,
|
||||
0x4b, 0x4d, 0x91, 0x60, 0x52, 0x60, 0xd6, 0xe0, 0x36, 0xd2, 0xd2, 0x83, 0x9a, 0xab, 0x87, 0x6e,
|
||||
0xa6, 0x5e, 0x68, 0x71, 0x6a, 0x91, 0x0b, 0x44, 0xb1, 0x6b, 0x5e, 0x49, 0x51, 0x65, 0x10, 0x77,
|
||||
0x29, 0x42, 0x44, 0xca, 0x8e, 0x4b, 0x00, 0x5d, 0x81, 0x90, 0x00, 0x17, 0x73, 0x76, 0x6a, 0x25,
|
||||
0xd4, 0x72, 0x10, 0x53, 0x48, 0x84, 0x8b, 0xb5, 0x2c, 0x31, 0xa7, 0x34, 0x55, 0x82, 0x09, 0x2c,
|
||||
0x06, 0xe1, 0x58, 0x31, 0x59, 0x30, 0x3a, 0xb1, 0x44, 0x31, 0x15, 0x24, 0x25, 0xb1, 0x81, 0x3d,
|
||||
0x67, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x4f, 0x25, 0xc0, 0xd0, 0xea, 0x00, 0x00, 0x00,
|
||||
}
|
||||
|
@ -4,23 +4,10 @@
|
||||
syntax = "proto3";
|
||||
option go_package = "pb";
|
||||
|
||||
package streams;
|
||||
package objects;
|
||||
|
||||
message SegmentMeta {
|
||||
bytes encrypted_key = 1;
|
||||
bytes key_nonce = 2;
|
||||
}
|
||||
|
||||
message StreamInfo {
|
||||
int64 number_of_segments = 1;
|
||||
int64 segments_size = 2;
|
||||
int64 last_segment_size = 3;
|
||||
bytes metadata = 4;
|
||||
}
|
||||
|
||||
message StreamMeta {
|
||||
bytes encrypted_stream_info = 1;
|
||||
int32 encryption_type = 2;
|
||||
int32 encryption_block_size = 3;
|
||||
SegmentMeta last_segment_meta = 4;
|
||||
// SerializableMeta is the object metadata that will be stored serialized
|
||||
message SerializableMeta {
|
||||
string content_type = 1;
|
||||
map<string, string> user_defined = 2;
|
||||
}
|
@ -40,7 +40,7 @@ func (x NodeType) String() string {
|
||||
return proto.EnumName(NodeType_name, int32(x))
|
||||
}
|
||||
func (NodeType) EnumDescriptor() ([]byte, []int) {
|
||||
return fileDescriptor_node_2ea4a85792199846, []int{0}
|
||||
return fileDescriptor_node_a85419faa51872ac, []int{0}
|
||||
}
|
||||
|
||||
// NodeTransport is an enum of possible transports for the overlay network
|
||||
@ -61,13 +61,13 @@ func (x NodeTransport) String() string {
|
||||
return proto.EnumName(NodeTransport_name, int32(x))
|
||||
}
|
||||
func (NodeTransport) EnumDescriptor() ([]byte, []int) {
|
||||
return fileDescriptor_node_2ea4a85792199846, []int{1}
|
||||
return fileDescriptor_node_a85419faa51872ac, []int{1}
|
||||
}
|
||||
|
||||
// NodeRestrictions contains all relevant data about a nodes ability to store data
|
||||
type NodeRestrictions struct {
|
||||
FreeBandwidth int64 `protobuf:"varint,1,opt,name=freeBandwidth,proto3" json:"freeBandwidth,omitempty"`
|
||||
FreeDisk int64 `protobuf:"varint,2,opt,name=freeDisk,proto3" json:"freeDisk,omitempty"`
|
||||
FreeBandwidth int64 `protobuf:"varint,1,opt,name=free_bandwidth,json=freeBandwidth,proto3" json:"free_bandwidth,omitempty"`
|
||||
FreeDisk int64 `protobuf:"varint,2,opt,name=free_disk,json=freeDisk,proto3" json:"free_disk,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
@ -77,7 +77,7 @@ func (m *NodeRestrictions) Reset() { *m = NodeRestrictions{} }
|
||||
func (m *NodeRestrictions) String() string { return proto.CompactTextString(m) }
|
||||
func (*NodeRestrictions) ProtoMessage() {}
|
||||
func (*NodeRestrictions) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_node_2ea4a85792199846, []int{0}
|
||||
return fileDescriptor_node_a85419faa51872ac, []int{0}
|
||||
}
|
||||
func (m *NodeRestrictions) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_NodeRestrictions.Unmarshal(m, b)
|
||||
@ -134,7 +134,7 @@ func (m *Node) Reset() { *m = Node{} }
|
||||
func (m *Node) String() string { return proto.CompactTextString(m) }
|
||||
func (*Node) ProtoMessage() {}
|
||||
func (*Node) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_node_2ea4a85792199846, []int{1}
|
||||
return fileDescriptor_node_a85419faa51872ac, []int{1}
|
||||
}
|
||||
func (m *Node) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_Node.Unmarshal(m, b)
|
||||
@ -237,7 +237,7 @@ func (m *NodeAddress) Reset() { *m = NodeAddress{} }
|
||||
func (m *NodeAddress) String() string { return proto.CompactTextString(m) }
|
||||
func (*NodeAddress) ProtoMessage() {}
|
||||
func (*NodeAddress) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_node_2ea4a85792199846, []int{2}
|
||||
return fileDescriptor_node_a85419faa51872ac, []int{2}
|
||||
}
|
||||
func (m *NodeAddress) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_NodeAddress.Unmarshal(m, b)
|
||||
@ -290,7 +290,7 @@ func (m *NodeStats) Reset() { *m = NodeStats{} }
|
||||
func (m *NodeStats) String() string { return proto.CompactTextString(m) }
|
||||
func (*NodeStats) ProtoMessage() {}
|
||||
func (*NodeStats) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_node_2ea4a85792199846, []int{3}
|
||||
return fileDescriptor_node_a85419faa51872ac, []int{3}
|
||||
}
|
||||
func (m *NodeStats) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_NodeStats.Unmarshal(m, b)
|
||||
@ -374,7 +374,7 @@ func (m *NodeRep) Reset() { *m = NodeRep{} }
|
||||
func (m *NodeRep) String() string { return proto.CompactTextString(m) }
|
||||
func (*NodeRep) ProtoMessage() {}
|
||||
func (*NodeRep) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_node_2ea4a85792199846, []int{4}
|
||||
return fileDescriptor_node_a85419faa51872ac, []int{4}
|
||||
}
|
||||
func (m *NodeRep) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_NodeRep.Unmarshal(m, b)
|
||||
@ -427,7 +427,7 @@ func (m *NodeMetadata) Reset() { *m = NodeMetadata{} }
|
||||
func (m *NodeMetadata) String() string { return proto.CompactTextString(m) }
|
||||
func (*NodeMetadata) ProtoMessage() {}
|
||||
func (*NodeMetadata) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_node_2ea4a85792199846, []int{5}
|
||||
return fileDescriptor_node_a85419faa51872ac, []int{5}
|
||||
}
|
||||
func (m *NodeMetadata) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_NodeMetadata.Unmarshal(m, b)
|
||||
@ -472,49 +472,49 @@ func init() {
|
||||
proto.RegisterEnum("node.NodeTransport", NodeTransport_name, NodeTransport_value)
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("node.proto", fileDescriptor_node_2ea4a85792199846) }
|
||||
func init() { proto.RegisterFile("node.proto", fileDescriptor_node_a85419faa51872ac) }
|
||||
|
||||
var fileDescriptor_node_2ea4a85792199846 = []byte{
|
||||
// 646 bytes of a gzipped FileDescriptorProto
|
||||
var fileDescriptor_node_a85419faa51872ac = []byte{
|
||||
// 652 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x94, 0x4f, 0x4f, 0xdb, 0x4c,
|
||||
0x10, 0xc6, 0x89, 0xed, 0xfc, 0xf1, 0x38, 0x09, 0x61, 0x40, 0xc8, 0x42, 0x7a, 0x5f, 0x82, 0x79,
|
||||
0xdf, 0x36, 0xa2, 0x52, 0x44, 0xe9, 0x89, 0xaa, 0x97, 0x00, 0x15, 0x42, 0x02, 0x8a, 0x36, 0xe1,
|
||||
0xc2, 0xc5, 0x5a, 0xe2, 0x2d, 0x5d, 0x35, 0xb1, 0x2d, 0x7b, 0x23, 0x84, 0xd4, 0xcf, 0xd6, 0x73,
|
||||
0x0f, 0xfd, 0x04, 0x3d, 0xf0, 0x59, 0xaa, 0x9d, 0x75, 0x88, 0xad, 0xaa, 0x37, 0xef, 0xf3, 0xfc,
|
||||
0x76, 0x66, 0x77, 0x66, 0xbc, 0x00, 0x71, 0x12, 0x89, 0x61, 0x9a, 0x25, 0x2a, 0x41, 0x47, 0x7f,
|
||||
0xef, 0xc0, 0x43, 0xf2, 0x90, 0x18, 0x25, 0x98, 0x40, 0xef, 0x3a, 0x89, 0x04, 0x13, 0xb9, 0xca,
|
||||
0xe4, 0x54, 0xc9, 0x24, 0xce, 0xf1, 0x3f, 0xe8, 0x7c, 0xce, 0x84, 0x38, 0xe1, 0x71, 0xf4, 0x28,
|
||||
0x23, 0xf5, 0xc5, 0xaf, 0xf5, 0x6b, 0x03, 0x9b, 0x55, 0x45, 0xdc, 0x81, 0x96, 0x16, 0xce, 0x64,
|
||||
0xfe, 0xd5, 0xb7, 0x08, 0x78, 0x59, 0x07, 0xdf, 0x6d, 0x70, 0x74, 0x58, 0xfc, 0x17, 0x2c, 0x19,
|
||||
0xd1, 0xfe, 0xf6, 0x49, 0xf7, 0xc7, 0xf3, 0xee, 0xda, 0xaf, 0xe7, 0xdd, 0x86, 0x76, 0x2e, 0xce,
|
||||
0x98, 0x25, 0x23, 0x7c, 0x03, 0x4d, 0x1e, 0x45, 0x99, 0xc8, 0x73, 0x8a, 0xe1, 0x1d, 0x6d, 0x0c,
|
||||
0xe9, 0xb8, 0x1a, 0x19, 0x19, 0x83, 0x2d, 0x09, 0x0c, 0xc0, 0x51, 0x4f, 0xa9, 0xf0, 0xed, 0x7e,
|
||||
0x6d, 0xd0, 0x3d, 0xea, 0xae, 0xc8, 0xc9, 0x53, 0x2a, 0x18, 0x79, 0xf8, 0x1e, 0xda, 0x59, 0xe9,
|
||||
0x2e, 0xbe, 0x43, 0x51, 0xb7, 0x57, 0x6c, 0xf9, 0xa6, 0xac, 0xc2, 0xe2, 0x10, 0x5a, 0x73, 0xa1,
|
||||
0x78, 0xc4, 0x15, 0xf7, 0xeb, 0xb4, 0x0f, 0x57, 0xfb, 0xae, 0x0a, 0x87, 0xbd, 0x30, 0xb8, 0x07,
|
||||
0xed, 0x19, 0x57, 0x22, 0x9e, 0x3e, 0x85, 0x33, 0x99, 0x2b, 0xbf, 0xd1, 0xb7, 0x07, 0x36, 0xf3,
|
||||
0x0a, 0xed, 0x52, 0xe6, 0x0a, 0xf7, 0xa1, 0xc3, 0x17, 0x91, 0x54, 0x61, 0xbe, 0x98, 0x4e, 0xf5,
|
||||
0x2d, 0x9b, 0xfd, 0xda, 0xa0, 0xc5, 0xda, 0x24, 0x8e, 0x8d, 0x86, 0x9b, 0x50, 0x97, 0x79, 0xb8,
|
||||
0x48, 0xfd, 0x16, 0x99, 0x8e, 0xcc, 0x6f, 0x53, 0xfc, 0x1f, 0xba, 0x8b, 0x34, 0xe2, 0x4a, 0x84,
|
||||
0x45, 0x3c, 0xdf, 0x25, 0xb7, 0x63, 0xd4, 0x4b, 0x23, 0xe2, 0x21, 0x6c, 0x15, 0x58, 0x35, 0x0f,
|
||||
0x10, 0x8c, 0xc6, 0x1b, 0x95, 0xb3, 0xed, 0x43, 0x11, 0x22, 0x5c, 0xa4, 0x4a, 0xce, 0x85, 0xef,
|
||||
0x99, 0x23, 0x19, 0xf1, 0x96, 0xb4, 0xe0, 0x0e, 0xbc, 0x52, 0x0b, 0xf0, 0x2d, 0xb8, 0x2a, 0xe3,
|
||||
0x71, 0x9e, 0x26, 0x99, 0xa2, 0x6e, 0x76, 0x8f, 0x36, 0x4b, 0xe5, 0x5f, 0x5a, 0x6c, 0x45, 0xa1,
|
||||
0x5f, 0xed, 0xac, 0xfb, 0xd2, 0xc6, 0xe0, 0xa7, 0x05, 0xae, 0xde, 0x36, 0x56, 0x5c, 0xe5, 0xf8,
|
||||
0x1a, 0x9a, 0x3a, 0x50, 0xf8, 0xd7, 0x31, 0x69, 0x68, 0xfb, 0x22, 0xc2, 0x7f, 0x00, 0x96, 0xd5,
|
||||
0x3e, 0x3e, 0x2c, 0x26, 0xce, 0x2d, 0x94, 0xe3, 0x43, 0x1c, 0xc2, 0x66, 0xa5, 0x02, 0x61, 0xc6,
|
||||
0x95, 0x4c, 0x68, 0x56, 0x6a, 0x6c, 0xa3, 0x5c, 0x6f, 0xa6, 0x0d, 0xdd, 0x3c, 0x73, 0xff, 0x02,
|
||||
0x74, 0x08, 0xf4, 0x8c, 0x66, 0x90, 0x5d, 0xf0, 0x4c, 0xc8, 0x69, 0xb2, 0x88, 0x15, 0x8d, 0x84,
|
||||
0xcd, 0x80, 0xa4, 0x53, 0xad, 0xfc, 0x99, 0xd3, 0x80, 0x0d, 0x02, 0x2b, 0x39, 0x0d, 0xbf, 0xca,
|
||||
0x69, 0xc0, 0x26, 0x81, 0x45, 0x4e, 0x83, 0x50, 0x3f, 0x09, 0xa9, 0xc6, 0x6c, 0x11, 0x8a, 0xc6,
|
||||
0x2b, 0x07, 0x0d, 0xbe, 0x41, 0xd3, 0xcc, 0x75, 0xaa, 0x4b, 0x34, 0x97, 0xf1, 0xb2, 0xaf, 0xba,
|
||||
0x9c, 0x16, 0x73, 0xe7, 0x32, 0x36, 0x4d, 0xc5, 0x03, 0xd8, 0xd0, 0x76, 0x75, 0x50, 0x2c, 0xa2,
|
||||
0xd6, 0xe7, 0x32, 0xae, 0x4c, 0xc9, 0x2b, 0x58, 0x5f, 0xb1, 0xe6, 0x08, 0xb6, 0x79, 0x05, 0x96,
|
||||
0xa4, 0xc9, 0xfe, 0x01, 0xda, 0xe5, 0xbf, 0x03, 0xb7, 0xa0, 0x2e, 0xe6, 0x5c, 0xce, 0x28, 0xbb,
|
||||
0xcb, 0xcc, 0x02, 0xb7, 0xa1, 0xf1, 0xc8, 0x67, 0x33, 0xa1, 0x8a, 0x59, 0x28, 0x56, 0x07, 0x01,
|
||||
0xb4, 0x96, 0xff, 0x2f, 0xba, 0x50, 0x1f, 0x9d, 0x5d, 0x5d, 0x5c, 0xf7, 0xd6, 0xd0, 0x83, 0xe6,
|
||||
0x78, 0xf2, 0x89, 0x8d, 0xce, 0x3f, 0xf6, 0x6a, 0x07, 0x7b, 0xd0, 0xa9, 0x0c, 0x19, 0xf6, 0xa0,
|
||||
0x3d, 0x39, 0xbd, 0x09, 0x27, 0x97, 0xe3, 0xf0, 0x9c, 0xdd, 0x9c, 0xf6, 0xd6, 0x4e, 0x9c, 0x3b,
|
||||
0x2b, 0xbd, 0xbf, 0x6f, 0xd0, 0x8b, 0xf6, 0xee, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa3, 0x4d,
|
||||
0xc8, 0xfa, 0xf1, 0x04, 0x00, 0x00,
|
||||
0x10, 0xc6, 0x89, 0xed, 0xfc, 0xf1, 0x38, 0x09, 0x61, 0x40, 0xc8, 0x7a, 0x5f, 0xb5, 0x04, 0xa3,
|
||||
0xb6, 0x11, 0x95, 0x22, 0x4a, 0x4f, 0x54, 0xbd, 0x04, 0xa8, 0x10, 0x12, 0x50, 0xb4, 0x09, 0x3d,
|
||||
0x70, 0xb1, 0x4c, 0xbc, 0xa5, 0x2b, 0x12, 0xdb, 0xb2, 0x37, 0x42, 0x91, 0xfa, 0xd9, 0x7a, 0xee,
|
||||
0xa1, 0x9f, 0xa0, 0x07, 0x3e, 0x4b, 0xb5, 0xb3, 0x36, 0xb1, 0x55, 0xf5, 0x96, 0x3c, 0xcf, 0xcf,
|
||||
0xcf, 0xec, 0xce, 0x8c, 0x0d, 0x10, 0xc5, 0x21, 0x1f, 0x26, 0x69, 0x2c, 0x63, 0xb4, 0xd4, 0xef,
|
||||
0xff, 0xe0, 0x3e, 0xbe, 0x8f, 0xb5, 0xe2, 0x7d, 0x81, 0xde, 0x55, 0x1c, 0x72, 0xc6, 0x33, 0x99,
|
||||
0x8a, 0xa9, 0x14, 0x71, 0x94, 0xe1, 0x2b, 0xe8, 0x7e, 0x4d, 0x39, 0xf7, 0xef, 0x82, 0x28, 0x7c,
|
||||
0x14, 0xa1, 0xfc, 0xe6, 0xd6, 0xfa, 0xb5, 0x81, 0xc9, 0x3a, 0x4a, 0x3d, 0x2e, 0x44, 0xfc, 0x1f,
|
||||
0x6c, 0xc2, 0x42, 0x91, 0x3d, 0xb8, 0x06, 0x11, 0x2d, 0x25, 0x9c, 0x8a, 0xec, 0xc1, 0xfb, 0x61,
|
||||
0x82, 0xa5, 0x82, 0xf1, 0x25, 0x18, 0x22, 0xa4, 0x80, 0xf6, 0x71, 0xf7, 0xe7, 0xd3, 0xce, 0xda,
|
||||
0xef, 0xa7, 0x9d, 0x86, 0x72, 0xce, 0x4f, 0x99, 0x21, 0x42, 0x7c, 0x0b, 0xcd, 0x20, 0x0c, 0x53,
|
||||
0x9e, 0x65, 0x94, 0xe1, 0x1c, 0x6e, 0x0c, 0xe9, 0xc0, 0x0a, 0x19, 0x69, 0x83, 0x15, 0x04, 0x7a,
|
||||
0x60, 0xc9, 0x65, 0xc2, 0x5d, 0xb3, 0x5f, 0x1b, 0x74, 0x0f, 0xbb, 0x2b, 0x72, 0xb2, 0x4c, 0x38,
|
||||
0x23, 0x0f, 0x3f, 0x40, 0x3b, 0x2d, 0xdd, 0xc6, 0xb5, 0x28, 0x75, 0x7b, 0xc5, 0x96, 0xef, 0xca,
|
||||
0x2a, 0x2c, 0x0e, 0xa1, 0x35, 0xe7, 0x32, 0x08, 0x03, 0x19, 0xb8, 0x75, 0x7a, 0x0e, 0x57, 0xcf,
|
||||
0x5d, 0xe6, 0x0e, 0x7b, 0x66, 0x70, 0x17, 0xda, 0xb3, 0x40, 0xf2, 0x68, 0xba, 0xf4, 0x67, 0x22,
|
||||
0x93, 0x6e, 0xa3, 0x6f, 0x0e, 0x4c, 0xe6, 0xe4, 0xda, 0x85, 0xc8, 0x24, 0xee, 0x41, 0x27, 0x58,
|
||||
0x84, 0x42, 0xfa, 0xd9, 0x62, 0x3a, 0x55, 0xb7, 0x6c, 0xf6, 0x6b, 0x83, 0x16, 0x6b, 0x93, 0x38,
|
||||
0xd6, 0x1a, 0x6e, 0x42, 0x5d, 0x64, 0xfe, 0x22, 0x71, 0x5b, 0x64, 0x5a, 0x22, 0xbb, 0x49, 0xd4,
|
||||
0x18, 0x16, 0x49, 0x18, 0x48, 0xee, 0xe7, 0x79, 0xae, 0x4d, 0x6e, 0x47, 0xab, 0x17, 0x5a, 0xc4,
|
||||
0x03, 0xd8, 0xca, 0xb1, 0x6a, 0x1d, 0x20, 0x18, 0xb5, 0x37, 0x2a, 0x57, 0xdb, 0x83, 0x3c, 0xc2,
|
||||
0x5f, 0x24, 0x52, 0xcc, 0xb9, 0xeb, 0xe8, 0x23, 0x69, 0xf1, 0x86, 0x34, 0xef, 0x16, 0x9c, 0xd2,
|
||||
0x08, 0xf0, 0x1d, 0xd8, 0x32, 0x0d, 0xa2, 0x2c, 0x89, 0x53, 0x49, 0xd3, 0xec, 0x1e, 0x6e, 0x96,
|
||||
0xda, 0x5f, 0x58, 0x6c, 0x45, 0xa1, 0x5b, 0x9d, 0xac, 0xfd, 0x3c, 0x46, 0xef, 0x97, 0x01, 0xb6,
|
||||
0x7a, 0x6c, 0x2c, 0x03, 0x99, 0xe1, 0x1b, 0x68, 0xaa, 0x20, 0xff, 0x9f, 0x6b, 0xd2, 0x50, 0xf6,
|
||||
0x79, 0x88, 0x2f, 0x00, 0x8a, 0x6e, 0x1f, 0x1d, 0xe4, 0x1b, 0x67, 0xe7, 0xca, 0xd1, 0x01, 0x0e,
|
||||
0x61, 0xb3, 0xd2, 0x01, 0x3f, 0x0d, 0xa4, 0x88, 0x69, 0x57, 0x6a, 0x6c, 0xa3, 0xdc, 0x6f, 0xa6,
|
||||
0x0c, 0x35, 0x3c, 0x7d, 0xff, 0x1c, 0xb4, 0x08, 0x74, 0xb4, 0xa6, 0x91, 0x1d, 0x70, 0x74, 0xe4,
|
||||
0x34, 0x5e, 0x44, 0x92, 0x56, 0xc2, 0x64, 0x40, 0xd2, 0x89, 0x52, 0xfe, 0xae, 0xa9, 0xc1, 0x06,
|
||||
0x81, 0x95, 0x9a, 0x9a, 0x5f, 0xd5, 0xd4, 0x60, 0x93, 0xc0, 0xbc, 0xa6, 0x46, 0x68, 0x9e, 0x84,
|
||||
0x54, 0x33, 0x5b, 0x84, 0xa2, 0xf6, 0xca, 0xa1, 0xde, 0x77, 0x68, 0xea, 0xbd, 0x4e, 0x54, 0x8b,
|
||||
0xe6, 0x22, 0x2a, 0xe6, 0xaa, 0xda, 0x69, 0x30, 0x7b, 0x2e, 0x22, 0x3d, 0x54, 0xdc, 0x87, 0x0d,
|
||||
0x65, 0x57, 0x17, 0xc5, 0x20, 0x6a, 0x7d, 0x2e, 0xa2, 0xca, 0x96, 0xbc, 0x86, 0xf5, 0x15, 0xab,
|
||||
0x8f, 0x60, 0xea, 0xcf, 0x40, 0x41, 0xea, 0xea, 0x1f, 0xa1, 0x5d, 0x7e, 0x3b, 0x70, 0x0b, 0xea,
|
||||
0x7c, 0x1e, 0x88, 0x19, 0x55, 0xb7, 0x99, 0xfe, 0x83, 0xdb, 0xd0, 0x78, 0x0c, 0x66, 0x33, 0x2e,
|
||||
0xf3, 0x5d, 0xc8, 0xff, 0xed, 0x7b, 0xd0, 0x2a, 0xde, 0x5f, 0xb4, 0xa1, 0x3e, 0x3a, 0xbd, 0x3c,
|
||||
0xbf, 0xea, 0xad, 0xa1, 0x03, 0xcd, 0xf1, 0xe4, 0x33, 0x1b, 0x9d, 0x7d, 0xea, 0xd5, 0xf6, 0x77,
|
||||
0xa1, 0x53, 0x59, 0x32, 0xec, 0x41, 0x7b, 0x72, 0x72, 0xed, 0x4f, 0x2e, 0xc6, 0xfe, 0x19, 0xbb,
|
||||
0x3e, 0xe9, 0xad, 0x1d, 0x5b, 0xb7, 0x46, 0x72, 0x77, 0xd7, 0xa0, 0x6f, 0xda, 0xfb, 0x3f, 0x01,
|
||||
0x00, 0x00, 0xff, 0xff, 0xf3, 0xcb, 0x6b, 0x95, 0xf3, 0x04, 0x00, 0x00,
|
||||
}
|
||||
|
@ -10,8 +10,8 @@ import "gogo.proto";
|
||||
|
||||
// NodeRestrictions contains all relevant data about a nodes ability to store data
|
||||
message NodeRestrictions {
|
||||
int64 freeBandwidth = 1;
|
||||
int64 freeDisk = 2;
|
||||
int64 free_bandwidth = 1;
|
||||
int64 free_disk = 2;
|
||||
}
|
||||
|
||||
// Node represents a node in the overlay network
|
||||
|
@ -9,8 +9,10 @@ import math "math"
|
||||
import _ "github.com/gogo/protobuf/gogoproto"
|
||||
import duration "github.com/golang/protobuf/ptypes/duration"
|
||||
|
||||
import context "golang.org/x/net/context"
|
||||
import grpc "google.golang.org/grpc"
|
||||
import (
|
||||
context "golang.org/x/net/context"
|
||||
grpc "google.golang.org/grpc"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
@ -52,7 +54,7 @@ func (x Restriction_Operator) String() string {
|
||||
return proto.EnumName(Restriction_Operator_name, int32(x))
|
||||
}
|
||||
func (Restriction_Operator) EnumDescriptor() ([]byte, []int) {
|
||||
return fileDescriptor_overlay_366705336bc11433, []int{11, 0}
|
||||
return fileDescriptor_overlay_9ebccc0ee1a42314, []int{11, 0}
|
||||
}
|
||||
|
||||
type Restriction_Operand int32
|
||||
@ -75,7 +77,7 @@ func (x Restriction_Operand) String() string {
|
||||
return proto.EnumName(Restriction_Operand_name, int32(x))
|
||||
}
|
||||
func (Restriction_Operand) EnumDescriptor() ([]byte, []int) {
|
||||
return fileDescriptor_overlay_366705336bc11433, []int{11, 1}
|
||||
return fileDescriptor_overlay_9ebccc0ee1a42314, []int{11, 1}
|
||||
}
|
||||
|
||||
// LookupRequest is is request message for the lookup rpc call
|
||||
@ -90,7 +92,7 @@ func (m *LookupRequest) Reset() { *m = LookupRequest{} }
|
||||
func (m *LookupRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*LookupRequest) ProtoMessage() {}
|
||||
func (*LookupRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_overlay_366705336bc11433, []int{0}
|
||||
return fileDescriptor_overlay_9ebccc0ee1a42314, []int{0}
|
||||
}
|
||||
func (m *LookupRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_LookupRequest.Unmarshal(m, b)
|
||||
@ -122,7 +124,7 @@ func (m *LookupResponse) Reset() { *m = LookupResponse{} }
|
||||
func (m *LookupResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*LookupResponse) ProtoMessage() {}
|
||||
func (*LookupResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_overlay_366705336bc11433, []int{1}
|
||||
return fileDescriptor_overlay_9ebccc0ee1a42314, []int{1}
|
||||
}
|
||||
func (m *LookupResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_LookupResponse.Unmarshal(m, b)
|
||||
@ -161,7 +163,7 @@ func (m *LookupRequests) Reset() { *m = LookupRequests{} }
|
||||
func (m *LookupRequests) String() string { return proto.CompactTextString(m) }
|
||||
func (*LookupRequests) ProtoMessage() {}
|
||||
func (*LookupRequests) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_overlay_366705336bc11433, []int{2}
|
||||
return fileDescriptor_overlay_9ebccc0ee1a42314, []int{2}
|
||||
}
|
||||
func (m *LookupRequests) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_LookupRequests.Unmarshal(m, b)
|
||||
@ -200,7 +202,7 @@ func (m *LookupResponses) Reset() { *m = LookupResponses{} }
|
||||
func (m *LookupResponses) String() string { return proto.CompactTextString(m) }
|
||||
func (*LookupResponses) ProtoMessage() {}
|
||||
func (*LookupResponses) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_overlay_366705336bc11433, []int{3}
|
||||
return fileDescriptor_overlay_9ebccc0ee1a42314, []int{3}
|
||||
}
|
||||
func (m *LookupResponses) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_LookupResponses.Unmarshal(m, b)
|
||||
@ -239,7 +241,7 @@ func (m *FindStorageNodesResponse) Reset() { *m = FindStorageNodesRespon
|
||||
func (m *FindStorageNodesResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*FindStorageNodesResponse) ProtoMessage() {}
|
||||
func (*FindStorageNodesResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_overlay_366705336bc11433, []int{4}
|
||||
return fileDescriptor_overlay_9ebccc0ee1a42314, []int{4}
|
||||
}
|
||||
func (m *FindStorageNodesResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_FindStorageNodesResponse.Unmarshal(m, b)
|
||||
@ -282,7 +284,7 @@ func (m *FindStorageNodesRequest) Reset() { *m = FindStorageNodesRequest
|
||||
func (m *FindStorageNodesRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*FindStorageNodesRequest) ProtoMessage() {}
|
||||
func (*FindStorageNodesRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_overlay_366705336bc11433, []int{5}
|
||||
return fileDescriptor_overlay_9ebccc0ee1a42314, []int{5}
|
||||
}
|
||||
func (m *FindStorageNodesRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_FindStorageNodesRequest.Unmarshal(m, b)
|
||||
@ -347,7 +349,7 @@ func (m *OverlayOptions) Reset() { *m = OverlayOptions{} }
|
||||
func (m *OverlayOptions) String() string { return proto.CompactTextString(m) }
|
||||
func (*OverlayOptions) ProtoMessage() {}
|
||||
func (*OverlayOptions) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_overlay_366705336bc11433, []int{6}
|
||||
return fileDescriptor_overlay_9ebccc0ee1a42314, []int{6}
|
||||
}
|
||||
func (m *OverlayOptions) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_OverlayOptions.Unmarshal(m, b)
|
||||
@ -416,7 +418,7 @@ func (m *QueryRequest) Reset() { *m = QueryRequest{} }
|
||||
func (m *QueryRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*QueryRequest) ProtoMessage() {}
|
||||
func (*QueryRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_overlay_366705336bc11433, []int{7}
|
||||
return fileDescriptor_overlay_9ebccc0ee1a42314, []int{7}
|
||||
}
|
||||
func (m *QueryRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_QueryRequest.Unmarshal(m, b)
|
||||
@ -476,7 +478,7 @@ func (m *QueryResponse) Reset() { *m = QueryResponse{} }
|
||||
func (m *QueryResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*QueryResponse) ProtoMessage() {}
|
||||
func (*QueryResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_overlay_366705336bc11433, []int{8}
|
||||
return fileDescriptor_overlay_9ebccc0ee1a42314, []int{8}
|
||||
}
|
||||
func (m *QueryResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_QueryResponse.Unmarshal(m, b)
|
||||
@ -520,7 +522,7 @@ func (m *PingRequest) Reset() { *m = PingRequest{} }
|
||||
func (m *PingRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*PingRequest) ProtoMessage() {}
|
||||
func (*PingRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_overlay_366705336bc11433, []int{9}
|
||||
return fileDescriptor_overlay_9ebccc0ee1a42314, []int{9}
|
||||
}
|
||||
func (m *PingRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_PingRequest.Unmarshal(m, b)
|
||||
@ -550,7 +552,7 @@ func (m *PingResponse) Reset() { *m = PingResponse{} }
|
||||
func (m *PingResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*PingResponse) ProtoMessage() {}
|
||||
func (*PingResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_overlay_366705336bc11433, []int{10}
|
||||
return fileDescriptor_overlay_9ebccc0ee1a42314, []int{10}
|
||||
}
|
||||
func (m *PingResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_PingResponse.Unmarshal(m, b)
|
||||
@ -583,7 +585,7 @@ func (m *Restriction) Reset() { *m = Restriction{} }
|
||||
func (m *Restriction) String() string { return proto.CompactTextString(m) }
|
||||
func (*Restriction) ProtoMessage() {}
|
||||
func (*Restriction) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_overlay_366705336bc11433, []int{11}
|
||||
return fileDescriptor_overlay_9ebccc0ee1a42314, []int{11}
|
||||
}
|
||||
func (m *Restriction) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_Restriction.Unmarshal(m, b)
|
||||
@ -649,8 +651,9 @@ var _ grpc.ClientConn
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
const _ = grpc.SupportPackageIsVersion4
|
||||
|
||||
// Client API for Overlay service
|
||||
|
||||
// OverlayClient is the client API for Overlay service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
||||
type OverlayClient interface {
|
||||
// Lookup finds a nodes address from the network
|
||||
Lookup(ctx context.Context, in *LookupRequest, opts ...grpc.CallOption) (*LookupResponse, error)
|
||||
@ -695,8 +698,7 @@ func (c *overlayClient) FindStorageNodes(ctx context.Context, in *FindStorageNod
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// Server API for Overlay service
|
||||
|
||||
// OverlayServer is the server API for Overlay service.
|
||||
type OverlayServer interface {
|
||||
// Lookup finds a nodes address from the network
|
||||
Lookup(context.Context, *LookupRequest) (*LookupResponse, error)
|
||||
@ -785,8 +787,9 @@ var _Overlay_serviceDesc = grpc.ServiceDesc{
|
||||
Metadata: "overlay.proto",
|
||||
}
|
||||
|
||||
// Client API for Nodes service
|
||||
|
||||
// NodesClient is the client API for Nodes service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
||||
type NodesClient interface {
|
||||
Query(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error)
|
||||
Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error)
|
||||
@ -818,8 +821,7 @@ func (c *nodesClient) Ping(ctx context.Context, in *PingRequest, opts ...grpc.Ca
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// Server API for Nodes service
|
||||
|
||||
// NodesServer is the server API for Nodes service.
|
||||
type NodesServer interface {
|
||||
Query(context.Context, *QueryRequest) (*QueryResponse, error)
|
||||
Ping(context.Context, *PingRequest) (*PingResponse, error)
|
||||
@ -882,9 +884,9 @@ var _Nodes_serviceDesc = grpc.ServiceDesc{
|
||||
Metadata: "overlay.proto",
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("overlay.proto", fileDescriptor_overlay_366705336bc11433) }
|
||||
func init() { proto.RegisterFile("overlay.proto", fileDescriptor_overlay_9ebccc0ee1a42314) }
|
||||
|
||||
var fileDescriptor_overlay_366705336bc11433 = []byte{
|
||||
var fileDescriptor_overlay_9ebccc0ee1a42314 = []byte{
|
||||
// 846 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0xdd, 0x8e, 0xdb, 0x44,
|
||||
0x14, 0x5e, 0xe7, 0xbf, 0x27, 0xb1, 0x37, 0x1a, 0xb5, 0xbb, 0x21, 0x40, 0x37, 0x58, 0x15, 0xac,
|
||||
|
@ -8,8 +8,10 @@ import fmt "fmt"
|
||||
import math "math"
|
||||
import _ "github.com/gogo/protobuf/gogoproto"
|
||||
|
||||
import context "golang.org/x/net/context"
|
||||
import grpc "google.golang.org/grpc"
|
||||
import (
|
||||
context "golang.org/x/net/context"
|
||||
grpc "google.golang.org/grpc"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
@ -42,7 +44,7 @@ func (x PayerBandwidthAllocation_Action) String() string {
|
||||
return proto.EnumName(PayerBandwidthAllocation_Action_name, int32(x))
|
||||
}
|
||||
func (PayerBandwidthAllocation_Action) EnumDescriptor() ([]byte, []int) {
|
||||
return fileDescriptor_piecestore_c22028cf5808832f, []int{0, 0}
|
||||
return fileDescriptor_piecestore_f6b209c85f045534, []int{0, 0}
|
||||
}
|
||||
|
||||
type PayerBandwidthAllocation struct {
|
||||
@ -57,7 +59,7 @@ func (m *PayerBandwidthAllocation) Reset() { *m = PayerBandwidthAllocati
|
||||
func (m *PayerBandwidthAllocation) String() string { return proto.CompactTextString(m) }
|
||||
func (*PayerBandwidthAllocation) ProtoMessage() {}
|
||||
func (*PayerBandwidthAllocation) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_piecestore_c22028cf5808832f, []int{0}
|
||||
return fileDescriptor_piecestore_f6b209c85f045534, []int{0}
|
||||
}
|
||||
func (m *PayerBandwidthAllocation) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_PayerBandwidthAllocation.Unmarshal(m, b)
|
||||
@ -108,7 +110,7 @@ func (m *PayerBandwidthAllocation_Data) Reset() { *m = PayerBandwidthAll
|
||||
func (m *PayerBandwidthAllocation_Data) String() string { return proto.CompactTextString(m) }
|
||||
func (*PayerBandwidthAllocation_Data) ProtoMessage() {}
|
||||
func (*PayerBandwidthAllocation_Data) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_piecestore_c22028cf5808832f, []int{0, 0}
|
||||
return fileDescriptor_piecestore_f6b209c85f045534, []int{0, 0}
|
||||
}
|
||||
func (m *PayerBandwidthAllocation_Data) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_PayerBandwidthAllocation_Data.Unmarshal(m, b)
|
||||
@ -175,7 +177,7 @@ func (m *RenterBandwidthAllocation) Reset() { *m = RenterBandwidthAlloca
|
||||
func (m *RenterBandwidthAllocation) String() string { return proto.CompactTextString(m) }
|
||||
func (*RenterBandwidthAllocation) ProtoMessage() {}
|
||||
func (*RenterBandwidthAllocation) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_piecestore_c22028cf5808832f, []int{1}
|
||||
return fileDescriptor_piecestore_f6b209c85f045534, []int{1}
|
||||
}
|
||||
func (m *RenterBandwidthAllocation) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_RenterBandwidthAllocation.Unmarshal(m, b)
|
||||
@ -223,7 +225,7 @@ func (m *RenterBandwidthAllocation_Data) Reset() { *m = RenterBandwidthA
|
||||
func (m *RenterBandwidthAllocation_Data) String() string { return proto.CompactTextString(m) }
|
||||
func (*RenterBandwidthAllocation_Data) ProtoMessage() {}
|
||||
func (*RenterBandwidthAllocation_Data) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_piecestore_c22028cf5808832f, []int{1, 0}
|
||||
return fileDescriptor_piecestore_f6b209c85f045534, []int{1, 0}
|
||||
}
|
||||
func (m *RenterBandwidthAllocation_Data) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_RenterBandwidthAllocation_Data.Unmarshal(m, b)
|
||||
@ -277,7 +279,7 @@ func (m *PieceStore) Reset() { *m = PieceStore{} }
|
||||
func (m *PieceStore) String() string { return proto.CompactTextString(m) }
|
||||
func (*PieceStore) ProtoMessage() {}
|
||||
func (*PieceStore) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_piecestore_c22028cf5808832f, []int{2}
|
||||
return fileDescriptor_piecestore_f6b209c85f045534, []int{2}
|
||||
}
|
||||
func (m *PieceStore) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_PieceStore.Unmarshal(m, b)
|
||||
@ -332,7 +334,7 @@ func (m *PieceStore_PieceData) Reset() { *m = PieceStore_PieceData{} }
|
||||
func (m *PieceStore_PieceData) String() string { return proto.CompactTextString(m) }
|
||||
func (*PieceStore_PieceData) ProtoMessage() {}
|
||||
func (*PieceStore_PieceData) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_piecestore_c22028cf5808832f, []int{2, 0}
|
||||
return fileDescriptor_piecestore_f6b209c85f045534, []int{2, 0}
|
||||
}
|
||||
func (m *PieceStore_PieceData) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_PieceStore_PieceData.Unmarshal(m, b)
|
||||
@ -386,7 +388,7 @@ func (m *PieceId) Reset() { *m = PieceId{} }
|
||||
func (m *PieceId) String() string { return proto.CompactTextString(m) }
|
||||
func (*PieceId) ProtoMessage() {}
|
||||
func (*PieceId) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_piecestore_c22028cf5808832f, []int{3}
|
||||
return fileDescriptor_piecestore_f6b209c85f045534, []int{3}
|
||||
}
|
||||
func (m *PieceId) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_PieceId.Unmarshal(m, b)
|
||||
@ -433,7 +435,7 @@ func (m *PieceSummary) Reset() { *m = PieceSummary{} }
|
||||
func (m *PieceSummary) String() string { return proto.CompactTextString(m) }
|
||||
func (*PieceSummary) ProtoMessage() {}
|
||||
func (*PieceSummary) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_piecestore_c22028cf5808832f, []int{4}
|
||||
return fileDescriptor_piecestore_f6b209c85f045534, []int{4}
|
||||
}
|
||||
func (m *PieceSummary) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_PieceSummary.Unmarshal(m, b)
|
||||
@ -487,7 +489,7 @@ func (m *PieceRetrieval) Reset() { *m = PieceRetrieval{} }
|
||||
func (m *PieceRetrieval) String() string { return proto.CompactTextString(m) }
|
||||
func (*PieceRetrieval) ProtoMessage() {}
|
||||
func (*PieceRetrieval) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_piecestore_c22028cf5808832f, []int{5}
|
||||
return fileDescriptor_piecestore_f6b209c85f045534, []int{5}
|
||||
}
|
||||
func (m *PieceRetrieval) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_PieceRetrieval.Unmarshal(m, b)
|
||||
@ -542,7 +544,7 @@ func (m *PieceRetrieval_PieceData) Reset() { *m = PieceRetrieval_PieceDa
|
||||
func (m *PieceRetrieval_PieceData) String() string { return proto.CompactTextString(m) }
|
||||
func (*PieceRetrieval_PieceData) ProtoMessage() {}
|
||||
func (*PieceRetrieval_PieceData) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_piecestore_c22028cf5808832f, []int{5, 0}
|
||||
return fileDescriptor_piecestore_f6b209c85f045534, []int{5, 0}
|
||||
}
|
||||
func (m *PieceRetrieval_PieceData) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_PieceRetrieval_PieceData.Unmarshal(m, b)
|
||||
@ -595,7 +597,7 @@ func (m *PieceRetrievalStream) Reset() { *m = PieceRetrievalStream{} }
|
||||
func (m *PieceRetrievalStream) String() string { return proto.CompactTextString(m) }
|
||||
func (*PieceRetrievalStream) ProtoMessage() {}
|
||||
func (*PieceRetrievalStream) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_piecestore_c22028cf5808832f, []int{6}
|
||||
return fileDescriptor_piecestore_f6b209c85f045534, []int{6}
|
||||
}
|
||||
func (m *PieceRetrievalStream) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_PieceRetrievalStream.Unmarshal(m, b)
|
||||
@ -642,7 +644,7 @@ func (m *PieceDelete) Reset() { *m = PieceDelete{} }
|
||||
func (m *PieceDelete) String() string { return proto.CompactTextString(m) }
|
||||
func (*PieceDelete) ProtoMessage() {}
|
||||
func (*PieceDelete) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_piecestore_c22028cf5808832f, []int{7}
|
||||
return fileDescriptor_piecestore_f6b209c85f045534, []int{7}
|
||||
}
|
||||
func (m *PieceDelete) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_PieceDelete.Unmarshal(m, b)
|
||||
@ -687,7 +689,7 @@ func (m *PieceDeleteSummary) Reset() { *m = PieceDeleteSummary{} }
|
||||
func (m *PieceDeleteSummary) String() string { return proto.CompactTextString(m) }
|
||||
func (*PieceDeleteSummary) ProtoMessage() {}
|
||||
func (*PieceDeleteSummary) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_piecestore_c22028cf5808832f, []int{8}
|
||||
return fileDescriptor_piecestore_f6b209c85f045534, []int{8}
|
||||
}
|
||||
func (m *PieceDeleteSummary) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_PieceDeleteSummary.Unmarshal(m, b)
|
||||
@ -726,7 +728,7 @@ func (m *PieceStoreSummary) Reset() { *m = PieceStoreSummary{} }
|
||||
func (m *PieceStoreSummary) String() string { return proto.CompactTextString(m) }
|
||||
func (*PieceStoreSummary) ProtoMessage() {}
|
||||
func (*PieceStoreSummary) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_piecestore_c22028cf5808832f, []int{9}
|
||||
return fileDescriptor_piecestore_f6b209c85f045534, []int{9}
|
||||
}
|
||||
func (m *PieceStoreSummary) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_PieceStoreSummary.Unmarshal(m, b)
|
||||
@ -770,7 +772,7 @@ func (m *StatsReq) Reset() { *m = StatsReq{} }
|
||||
func (m *StatsReq) String() string { return proto.CompactTextString(m) }
|
||||
func (*StatsReq) ProtoMessage() {}
|
||||
func (*StatsReq) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_piecestore_c22028cf5808832f, []int{10}
|
||||
return fileDescriptor_piecestore_f6b209c85f045534, []int{10}
|
||||
}
|
||||
func (m *StatsReq) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_StatsReq.Unmarshal(m, b)
|
||||
@ -804,7 +806,7 @@ func (m *StatSummary) Reset() { *m = StatSummary{} }
|
||||
func (m *StatSummary) String() string { return proto.CompactTextString(m) }
|
||||
func (*StatSummary) ProtoMessage() {}
|
||||
func (*StatSummary) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_piecestore_c22028cf5808832f, []int{11}
|
||||
return fileDescriptor_piecestore_f6b209c85f045534, []int{11}
|
||||
}
|
||||
func (m *StatSummary) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_StatSummary.Unmarshal(m, b)
|
||||
@ -865,7 +867,7 @@ func (m *SignedMessage) Reset() { *m = SignedMessage{} }
|
||||
func (m *SignedMessage) String() string { return proto.CompactTextString(m) }
|
||||
func (*SignedMessage) ProtoMessage() {}
|
||||
func (*SignedMessage) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_piecestore_c22028cf5808832f, []int{12}
|
||||
return fileDescriptor_piecestore_f6b209c85f045534, []int{12}
|
||||
}
|
||||
func (m *SignedMessage) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_SignedMessage.Unmarshal(m, b)
|
||||
@ -935,8 +937,9 @@ var _ grpc.ClientConn
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
const _ = grpc.SupportPackageIsVersion4
|
||||
|
||||
// Client API for PieceStoreRoutes service
|
||||
|
||||
// PieceStoreRoutesClient is the client API for PieceStoreRoutes service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
||||
type PieceStoreRoutesClient interface {
|
||||
Piece(ctx context.Context, in *PieceId, opts ...grpc.CallOption) (*PieceSummary, error)
|
||||
Retrieve(ctx context.Context, opts ...grpc.CallOption) (PieceStoreRoutes_RetrieveClient, error)
|
||||
@ -1045,8 +1048,7 @@ func (c *pieceStoreRoutesClient) Stats(ctx context.Context, in *StatsReq, opts .
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// Server API for PieceStoreRoutes service
|
||||
|
||||
// PieceStoreRoutesServer is the server API for PieceStoreRoutes service.
|
||||
type PieceStoreRoutesServer interface {
|
||||
Piece(context.Context, *PieceId) (*PieceSummary, error)
|
||||
Retrieve(PieceStoreRoutes_RetrieveServer) error
|
||||
@ -1198,9 +1200,9 @@ var _PieceStoreRoutes_serviceDesc = grpc.ServiceDesc{
|
||||
Metadata: "piecestore.proto",
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("piecestore.proto", fileDescriptor_piecestore_c22028cf5808832f) }
|
||||
func init() { proto.RegisterFile("piecestore.proto", fileDescriptor_piecestore_f6b209c85f045534) }
|
||||
|
||||
var fileDescriptor_piecestore_c22028cf5808832f = []byte{
|
||||
var fileDescriptor_piecestore_f6b209c85f045534 = []byte{
|
||||
// 946 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcf, 0x6e, 0xdb, 0xc6,
|
||||
0x13, 0x36, 0x29, 0x5b, 0xb2, 0x46, 0x7f, 0xac, 0xac, 0x8d, 0xdf, 0x4f, 0x26, 0xe2, 0x5a, 0x60,
|
||||
|
@ -9,8 +9,10 @@ import math "math"
|
||||
import _ "github.com/gogo/protobuf/gogoproto"
|
||||
import timestamp "github.com/golang/protobuf/ptypes/timestamp"
|
||||
|
||||
import context "golang.org/x/net/context"
|
||||
import grpc "google.golang.org/grpc"
|
||||
import (
|
||||
context "golang.org/x/net/context"
|
||||
grpc "google.golang.org/grpc"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
@ -40,7 +42,7 @@ func (x RedundancyScheme_SchemeType) String() string {
|
||||
return proto.EnumName(RedundancyScheme_SchemeType_name, int32(x))
|
||||
}
|
||||
func (RedundancyScheme_SchemeType) EnumDescriptor() ([]byte, []int) {
|
||||
return fileDescriptor_pointerdb_21b4d7ef3abc5ac1, []int{0, 0}
|
||||
return fileDescriptor_pointerdb_b7facd921d32685d, []int{0, 0}
|
||||
}
|
||||
|
||||
type Pointer_DataType int32
|
||||
@ -63,7 +65,7 @@ func (x Pointer_DataType) String() string {
|
||||
return proto.EnumName(Pointer_DataType_name, int32(x))
|
||||
}
|
||||
func (Pointer_DataType) EnumDescriptor() ([]byte, []int) {
|
||||
return fileDescriptor_pointerdb_21b4d7ef3abc5ac1, []int{3, 0}
|
||||
return fileDescriptor_pointerdb_b7facd921d32685d, []int{3, 0}
|
||||
}
|
||||
|
||||
type RedundancyScheme struct {
|
||||
@ -83,7 +85,7 @@ func (m *RedundancyScheme) Reset() { *m = RedundancyScheme{} }
|
||||
func (m *RedundancyScheme) String() string { return proto.CompactTextString(m) }
|
||||
func (*RedundancyScheme) ProtoMessage() {}
|
||||
func (*RedundancyScheme) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_pointerdb_21b4d7ef3abc5ac1, []int{0}
|
||||
return fileDescriptor_pointerdb_b7facd921d32685d, []int{0}
|
||||
}
|
||||
func (m *RedundancyScheme) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_RedundancyScheme.Unmarshal(m, b)
|
||||
@ -157,7 +159,7 @@ func (m *RemotePiece) Reset() { *m = RemotePiece{} }
|
||||
func (m *RemotePiece) String() string { return proto.CompactTextString(m) }
|
||||
func (*RemotePiece) ProtoMessage() {}
|
||||
func (*RemotePiece) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_pointerdb_21b4d7ef3abc5ac1, []int{1}
|
||||
return fileDescriptor_pointerdb_b7facd921d32685d, []int{1}
|
||||
}
|
||||
func (m *RemotePiece) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_RemotePiece.Unmarshal(m, b)
|
||||
@ -199,7 +201,7 @@ func (m *RemoteSegment) Reset() { *m = RemoteSegment{} }
|
||||
func (m *RemoteSegment) String() string { return proto.CompactTextString(m) }
|
||||
func (*RemoteSegment) ProtoMessage() {}
|
||||
func (*RemoteSegment) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_pointerdb_21b4d7ef3abc5ac1, []int{2}
|
||||
return fileDescriptor_pointerdb_b7facd921d32685d, []int{2}
|
||||
}
|
||||
func (m *RemoteSegment) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_RemoteSegment.Unmarshal(m, b)
|
||||
@ -265,7 +267,7 @@ func (m *Pointer) Reset() { *m = Pointer{} }
|
||||
func (m *Pointer) String() string { return proto.CompactTextString(m) }
|
||||
func (*Pointer) ProtoMessage() {}
|
||||
func (*Pointer) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_pointerdb_21b4d7ef3abc5ac1, []int{3}
|
||||
return fileDescriptor_pointerdb_b7facd921d32685d, []int{3}
|
||||
}
|
||||
func (m *Pointer) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_Pointer.Unmarshal(m, b)
|
||||
@ -347,7 +349,7 @@ func (m *PutRequest) Reset() { *m = PutRequest{} }
|
||||
func (m *PutRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*PutRequest) ProtoMessage() {}
|
||||
func (*PutRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_pointerdb_21b4d7ef3abc5ac1, []int{4}
|
||||
return fileDescriptor_pointerdb_b7facd921d32685d, []int{4}
|
||||
}
|
||||
func (m *PutRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_PutRequest.Unmarshal(m, b)
|
||||
@ -393,7 +395,7 @@ func (m *GetRequest) Reset() { *m = GetRequest{} }
|
||||
func (m *GetRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*GetRequest) ProtoMessage() {}
|
||||
func (*GetRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_pointerdb_21b4d7ef3abc5ac1, []int{5}
|
||||
return fileDescriptor_pointerdb_b7facd921d32685d, []int{5}
|
||||
}
|
||||
func (m *GetRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_GetRequest.Unmarshal(m, b)
|
||||
@ -437,7 +439,7 @@ func (m *ListRequest) Reset() { *m = ListRequest{} }
|
||||
func (m *ListRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*ListRequest) ProtoMessage() {}
|
||||
func (*ListRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_pointerdb_21b4d7ef3abc5ac1, []int{6}
|
||||
return fileDescriptor_pointerdb_b7facd921d32685d, []int{6}
|
||||
}
|
||||
func (m *ListRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_ListRequest.Unmarshal(m, b)
|
||||
@ -510,7 +512,7 @@ func (m *PutResponse) Reset() { *m = PutResponse{} }
|
||||
func (m *PutResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*PutResponse) ProtoMessage() {}
|
||||
func (*PutResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_pointerdb_21b4d7ef3abc5ac1, []int{7}
|
||||
return fileDescriptor_pointerdb_b7facd921d32685d, []int{7}
|
||||
}
|
||||
func (m *PutResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_PutResponse.Unmarshal(m, b)
|
||||
@ -545,7 +547,7 @@ func (m *GetResponse) Reset() { *m = GetResponse{} }
|
||||
func (m *GetResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*GetResponse) ProtoMessage() {}
|
||||
func (*GetResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_pointerdb_21b4d7ef3abc5ac1, []int{8}
|
||||
return fileDescriptor_pointerdb_b7facd921d32685d, []int{8}
|
||||
}
|
||||
func (m *GetResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_GetResponse.Unmarshal(m, b)
|
||||
@ -606,7 +608,7 @@ func (m *ListResponse) Reset() { *m = ListResponse{} }
|
||||
func (m *ListResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*ListResponse) ProtoMessage() {}
|
||||
func (*ListResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_pointerdb_21b4d7ef3abc5ac1, []int{9}
|
||||
return fileDescriptor_pointerdb_b7facd921d32685d, []int{9}
|
||||
}
|
||||
func (m *ListResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_ListResponse.Unmarshal(m, b)
|
||||
@ -653,7 +655,7 @@ func (m *ListResponse_Item) Reset() { *m = ListResponse_Item{} }
|
||||
func (m *ListResponse_Item) String() string { return proto.CompactTextString(m) }
|
||||
func (*ListResponse_Item) ProtoMessage() {}
|
||||
func (*ListResponse_Item) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_pointerdb_21b4d7ef3abc5ac1, []int{9, 0}
|
||||
return fileDescriptor_pointerdb_b7facd921d32685d, []int{9, 0}
|
||||
}
|
||||
func (m *ListResponse_Item) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_ListResponse_Item.Unmarshal(m, b)
|
||||
@ -705,7 +707,7 @@ func (m *DeleteRequest) Reset() { *m = DeleteRequest{} }
|
||||
func (m *DeleteRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*DeleteRequest) ProtoMessage() {}
|
||||
func (*DeleteRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_pointerdb_21b4d7ef3abc5ac1, []int{10}
|
||||
return fileDescriptor_pointerdb_b7facd921d32685d, []int{10}
|
||||
}
|
||||
func (m *DeleteRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_DeleteRequest.Unmarshal(m, b)
|
||||
@ -743,7 +745,7 @@ func (m *DeleteResponse) Reset() { *m = DeleteResponse{} }
|
||||
func (m *DeleteResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*DeleteResponse) ProtoMessage() {}
|
||||
func (*DeleteResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_pointerdb_21b4d7ef3abc5ac1, []int{11}
|
||||
return fileDescriptor_pointerdb_b7facd921d32685d, []int{11}
|
||||
}
|
||||
func (m *DeleteResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_DeleteResponse.Unmarshal(m, b)
|
||||
@ -778,7 +780,7 @@ func (m *IterateRequest) Reset() { *m = IterateRequest{} }
|
||||
func (m *IterateRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*IterateRequest) ProtoMessage() {}
|
||||
func (*IterateRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_pointerdb_21b4d7ef3abc5ac1, []int{12}
|
||||
return fileDescriptor_pointerdb_b7facd921d32685d, []int{12}
|
||||
}
|
||||
func (m *IterateRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_IterateRequest.Unmarshal(m, b)
|
||||
@ -837,7 +839,7 @@ func (m *PayerBandwidthAllocationRequest) Reset() { *m = PayerBandwidthA
|
||||
func (m *PayerBandwidthAllocationRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*PayerBandwidthAllocationRequest) ProtoMessage() {}
|
||||
func (*PayerBandwidthAllocationRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_pointerdb_21b4d7ef3abc5ac1, []int{13}
|
||||
return fileDescriptor_pointerdb_b7facd921d32685d, []int{13}
|
||||
}
|
||||
func (m *PayerBandwidthAllocationRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_PayerBandwidthAllocationRequest.Unmarshal(m, b)
|
||||
@ -875,7 +877,7 @@ func (m *PayerBandwidthAllocationResponse) Reset() { *m = PayerBandwidth
|
||||
func (m *PayerBandwidthAllocationResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*PayerBandwidthAllocationResponse) ProtoMessage() {}
|
||||
func (*PayerBandwidthAllocationResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_pointerdb_21b4d7ef3abc5ac1, []int{14}
|
||||
return fileDescriptor_pointerdb_b7facd921d32685d, []int{14}
|
||||
}
|
||||
func (m *PayerBandwidthAllocationResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_PayerBandwidthAllocationResponse.Unmarshal(m, b)
|
||||
@ -931,8 +933,9 @@ var _ grpc.ClientConn
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
const _ = grpc.SupportPackageIsVersion4
|
||||
|
||||
// Client API for PointerDB service
|
||||
|
||||
// PointerDBClient is the client API for PointerDB service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
||||
type PointerDBClient interface {
|
||||
// Put formats and hands off a file path to be saved to boltdb
|
||||
Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*PutResponse, error)
|
||||
@ -999,8 +1002,7 @@ func (c *pointerDBClient) PayerBandwidthAllocation(ctx context.Context, in *Paye
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// Server API for PointerDB service
|
||||
|
||||
// PointerDBServer is the server API for PointerDB service.
|
||||
type PointerDBServer interface {
|
||||
// Put formats and hands off a file path to be saved to boltdb
|
||||
Put(context.Context, *PutRequest) (*PutResponse, error)
|
||||
@ -1137,9 +1139,9 @@ var _PointerDB_serviceDesc = grpc.ServiceDesc{
|
||||
Metadata: "pointerdb.proto",
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("pointerdb.proto", fileDescriptor_pointerdb_21b4d7ef3abc5ac1) }
|
||||
func init() { proto.RegisterFile("pointerdb.proto", fileDescriptor_pointerdb_b7facd921d32685d) }
|
||||
|
||||
var fileDescriptor_pointerdb_21b4d7ef3abc5ac1 = []byte{
|
||||
var fileDescriptor_pointerdb_b7facd921d32685d = []byte{
|
||||
// 1092 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0x5d, 0x6f, 0x1b, 0x45,
|
||||
0x17, 0xae, 0xbf, 0xe3, 0xb3, 0x76, 0xea, 0x77, 0xd4, 0x37, 0xdd, 0xba, 0x45, 0x09, 0x8b, 0x80,
|
||||
|
220
pkg/pb/streams.pb.go
Normal file
220
pkg/pb/streams.pb.go
Normal file
@ -0,0 +1,220 @@
|
||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: streams.proto
|
||||
|
||||
package pb
|
||||
|
||||
import proto "github.com/gogo/protobuf/proto"
|
||||
import fmt "fmt"
|
||||
import math "math"
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
// A compilation error at this line likely means your copy of the
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
|
||||
|
||||
type SegmentMeta struct {
|
||||
EncryptedKey []byte `protobuf:"bytes,1,opt,name=encrypted_key,json=encryptedKey,proto3" json:"encrypted_key,omitempty"`
|
||||
KeyNonce []byte `protobuf:"bytes,2,opt,name=key_nonce,json=keyNonce,proto3" json:"key_nonce,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *SegmentMeta) Reset() { *m = SegmentMeta{} }
|
||||
func (m *SegmentMeta) String() string { return proto.CompactTextString(m) }
|
||||
func (*SegmentMeta) ProtoMessage() {}
|
||||
func (*SegmentMeta) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_streams_2b972859339b7bc3, []int{0}
|
||||
}
|
||||
func (m *SegmentMeta) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_SegmentMeta.Unmarshal(m, b)
|
||||
}
|
||||
func (m *SegmentMeta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_SegmentMeta.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (dst *SegmentMeta) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_SegmentMeta.Merge(dst, src)
|
||||
}
|
||||
func (m *SegmentMeta) XXX_Size() int {
|
||||
return xxx_messageInfo_SegmentMeta.Size(m)
|
||||
}
|
||||
func (m *SegmentMeta) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_SegmentMeta.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_SegmentMeta proto.InternalMessageInfo
|
||||
|
||||
func (m *SegmentMeta) GetEncryptedKey() []byte {
|
||||
if m != nil {
|
||||
return m.EncryptedKey
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *SegmentMeta) GetKeyNonce() []byte {
|
||||
if m != nil {
|
||||
return m.KeyNonce
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type StreamInfo struct {
|
||||
NumberOfSegments int64 `protobuf:"varint,1,opt,name=number_of_segments,json=numberOfSegments,proto3" json:"number_of_segments,omitempty"`
|
||||
SegmentsSize int64 `protobuf:"varint,2,opt,name=segments_size,json=segmentsSize,proto3" json:"segments_size,omitempty"`
|
||||
LastSegmentSize int64 `protobuf:"varint,3,opt,name=last_segment_size,json=lastSegmentSize,proto3" json:"last_segment_size,omitempty"`
|
||||
Metadata []byte `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *StreamInfo) Reset() { *m = StreamInfo{} }
|
||||
func (m *StreamInfo) String() string { return proto.CompactTextString(m) }
|
||||
func (*StreamInfo) ProtoMessage() {}
|
||||
func (*StreamInfo) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_streams_2b972859339b7bc3, []int{1}
|
||||
}
|
||||
func (m *StreamInfo) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_StreamInfo.Unmarshal(m, b)
|
||||
}
|
||||
func (m *StreamInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_StreamInfo.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (dst *StreamInfo) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_StreamInfo.Merge(dst, src)
|
||||
}
|
||||
func (m *StreamInfo) XXX_Size() int {
|
||||
return xxx_messageInfo_StreamInfo.Size(m)
|
||||
}
|
||||
func (m *StreamInfo) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_StreamInfo.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_StreamInfo proto.InternalMessageInfo
|
||||
|
||||
func (m *StreamInfo) GetNumberOfSegments() int64 {
|
||||
if m != nil {
|
||||
return m.NumberOfSegments
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *StreamInfo) GetSegmentsSize() int64 {
|
||||
if m != nil {
|
||||
return m.SegmentsSize
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *StreamInfo) GetLastSegmentSize() int64 {
|
||||
if m != nil {
|
||||
return m.LastSegmentSize
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *StreamInfo) GetMetadata() []byte {
|
||||
if m != nil {
|
||||
return m.Metadata
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type StreamMeta struct {
|
||||
EncryptedStreamInfo []byte `protobuf:"bytes,1,opt,name=encrypted_stream_info,json=encryptedStreamInfo,proto3" json:"encrypted_stream_info,omitempty"`
|
||||
EncryptionType int32 `protobuf:"varint,2,opt,name=encryption_type,json=encryptionType,proto3" json:"encryption_type,omitempty"`
|
||||
EncryptionBlockSize int32 `protobuf:"varint,3,opt,name=encryption_block_size,json=encryptionBlockSize,proto3" json:"encryption_block_size,omitempty"`
|
||||
LastSegmentMeta *SegmentMeta `protobuf:"bytes,4,opt,name=last_segment_meta,json=lastSegmentMeta" json:"last_segment_meta,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *StreamMeta) Reset() { *m = StreamMeta{} }
|
||||
func (m *StreamMeta) String() string { return proto.CompactTextString(m) }
|
||||
func (*StreamMeta) ProtoMessage() {}
|
||||
func (*StreamMeta) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_streams_2b972859339b7bc3, []int{2}
|
||||
}
|
||||
func (m *StreamMeta) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_StreamMeta.Unmarshal(m, b)
|
||||
}
|
||||
func (m *StreamMeta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_StreamMeta.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (dst *StreamMeta) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_StreamMeta.Merge(dst, src)
|
||||
}
|
||||
func (m *StreamMeta) XXX_Size() int {
|
||||
return xxx_messageInfo_StreamMeta.Size(m)
|
||||
}
|
||||
func (m *StreamMeta) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_StreamMeta.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_StreamMeta proto.InternalMessageInfo
|
||||
|
||||
func (m *StreamMeta) GetEncryptedStreamInfo() []byte {
|
||||
if m != nil {
|
||||
return m.EncryptedStreamInfo
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *StreamMeta) GetEncryptionType() int32 {
|
||||
if m != nil {
|
||||
return m.EncryptionType
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *StreamMeta) GetEncryptionBlockSize() int32 {
|
||||
if m != nil {
|
||||
return m.EncryptionBlockSize
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *StreamMeta) GetLastSegmentMeta() *SegmentMeta {
|
||||
if m != nil {
|
||||
return m.LastSegmentMeta
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*SegmentMeta)(nil), "streams.SegmentMeta")
|
||||
proto.RegisterType((*StreamInfo)(nil), "streams.StreamInfo")
|
||||
proto.RegisterType((*StreamMeta)(nil), "streams.StreamMeta")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("streams.proto", fileDescriptor_streams_2b972859339b7bc3) }
|
||||
|
||||
var fileDescriptor_streams_2b972859339b7bc3 = []byte{
|
||||
// 304 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x51, 0xcb, 0x4e, 0xc3, 0x30,
|
||||
0x10, 0x54, 0x5f, 0x50, 0xb6, 0x29, 0x05, 0x03, 0x52, 0x04, 0x17, 0x14, 0x0e, 0x20, 0x84, 0x7a,
|
||||
0x28, 0x3f, 0x80, 0x7a, 0x43, 0x08, 0x2a, 0x25, 0x9c, 0xb8, 0x58, 0x4e, 0xba, 0x41, 0x51, 0x1a,
|
||||
0x3b, 0x8a, 0xcd, 0xc1, 0xfd, 0x21, 0x3e, 0x8b, 0x5f, 0x41, 0xb6, 0xf3, 0x82, 0xe3, 0xce, 0x8c,
|
||||
0x66, 0x67, 0x76, 0x61, 0x2e, 0x55, 0x85, 0xac, 0x90, 0xcb, 0xb2, 0x12, 0x4a, 0x90, 0xc3, 0x7a,
|
||||
0x0c, 0x36, 0x30, 0x8b, 0xf0, 0xb3, 0x40, 0xae, 0x5e, 0x51, 0x31, 0x72, 0x03, 0x73, 0xe4, 0x49,
|
||||
0xa5, 0x4b, 0x85, 0x5b, 0x9a, 0xa3, 0xf6, 0x07, 0xd7, 0x83, 0x3b, 0x2f, 0xf4, 0x5a, 0xf0, 0x05,
|
||||
0x35, 0xb9, 0x82, 0xa3, 0x1c, 0x35, 0xe5, 0x82, 0x27, 0xe8, 0x0f, 0xad, 0x60, 0x9a, 0xa3, 0x7e,
|
||||
0x33, 0x73, 0xf0, 0x3d, 0x00, 0x88, 0xac, 0xf9, 0x33, 0x4f, 0x05, 0x79, 0x00, 0xc2, 0xbf, 0x8a,
|
||||
0x18, 0x2b, 0x2a, 0x52, 0x2a, 0xdd, 0x26, 0x69, 0x5d, 0x47, 0xe1, 0x89, 0x63, 0x36, 0x69, 0x9d,
|
||||
0x40, 0x9a, 0xf5, 0x8d, 0x86, 0xca, 0x6c, 0xef, 0xdc, 0x47, 0xa1, 0xd7, 0x80, 0x51, 0xb6, 0x47,
|
||||
0x72, 0x0f, 0xa7, 0x3b, 0x26, 0x55, 0xe3, 0xe6, 0x84, 0x23, 0x2b, 0x5c, 0x18, 0xa2, 0x76, 0xb3,
|
||||
0xda, 0x4b, 0x98, 0x16, 0xa8, 0xd8, 0x96, 0x29, 0xe6, 0x8f, 0x5d, 0xd2, 0x66, 0x0e, 0x7e, 0xda,
|
||||
0xa4, 0xb6, 0xfa, 0x0a, 0x2e, 0xba, 0xea, 0xee, 0x3c, 0x34, 0xe3, 0xa9, 0xa8, 0x4f, 0x70, 0xd6,
|
||||
0x92, 0xbd, 0x76, 0xb7, 0xb0, 0xa8, 0xe1, 0x4c, 0x70, 0xaa, 0x74, 0xe9, 0x12, 0x4f, 0xc2, 0xe3,
|
||||
0x0e, 0x7e, 0xd7, 0x25, 0xf6, 0xcc, 0x8d, 0x30, 0xde, 0x89, 0x24, 0xef, 0x72, 0x4f, 0x5a, 0xf3,
|
||||
0x4c, 0xf0, 0xb5, 0xe1, 0x6c, 0xf6, 0xa7, 0x7f, 0x3d, 0x4d, 0x70, 0x5b, 0x62, 0xb6, 0x3a, 0x5f,
|
||||
0x36, 0xef, 0xec, 0x3d, 0xef, 0x4f, 0x7b, 0x03, 0xac, 0xc7, 0x1f, 0xc3, 0x32, 0x8e, 0x0f, 0xec,
|
||||
0xcb, 0x1f, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xdf, 0x5e, 0x32, 0x31, 0x03, 0x02, 0x00, 0x00,
|
||||
}
|
26
pkg/pb/streams.proto
Normal file
26
pkg/pb/streams.proto
Normal file
@ -0,0 +1,26 @@
|
||||
// Copyright (C) 2018 Storj Labs, Inc.
|
||||
// See LICENSE for copying information.
|
||||
|
||||
syntax = "proto3";
|
||||
option go_package = "pb";
|
||||
|
||||
package streams;
|
||||
|
||||
message SegmentMeta {
|
||||
bytes encrypted_key = 1;
|
||||
bytes key_nonce = 2;
|
||||
}
|
||||
|
||||
message StreamInfo {
|
||||
int64 number_of_segments = 1;
|
||||
int64 segments_size = 2;
|
||||
int64 last_segment_size = 3;
|
||||
bytes metadata = 4;
|
||||
}
|
||||
|
||||
message StreamMeta {
|
||||
bytes encrypted_stream_info = 1;
|
||||
int32 encryption_type = 2;
|
||||
int32 encryption_block_size = 3;
|
||||
SegmentMeta last_segment_meta = 4;
|
||||
}
|
@ -13,5 +13,3 @@ type NodeID = storj.NodeID
|
||||
|
||||
// NodeIDList is an alias to storj.NodeIDList for use in generated protobuf code
|
||||
type NodeIDList = storj.NodeIDList
|
||||
|
||||
//go:generate protoc -I. --gogo_out=plugins=grpc:. meta.proto overlay.proto pointerdb.proto piecestore.proto bandwidth.proto inspector.proto datarepair.proto node.proto
|
@ -19,5 +19,3 @@ type Node = pb.Node
|
||||
|
||||
// NodeStats is an alias to storj.NodeStats for use in generated protobuf code
|
||||
type NodeStats = pb.NodeStats
|
||||
|
||||
//go:generate protoc --gogo_out=plugins=grpc:. -I=. -I=$GOPATH/src/storj.io/storj/pkg/pb statdb.proto
|
||||
|
@ -8,8 +8,10 @@ import fmt "fmt"
|
||||
import math "math"
|
||||
import _ "github.com/gogo/protobuf/gogoproto"
|
||||
|
||||
import context "golang.org/x/net/context"
|
||||
import grpc "google.golang.org/grpc"
|
||||
import (
|
||||
context "golang.org/x/net/context"
|
||||
grpc "google.golang.org/grpc"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
@ -35,7 +37,7 @@ func (m *CreateRequest) Reset() { *m = CreateRequest{} }
|
||||
func (m *CreateRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*CreateRequest) ProtoMessage() {}
|
||||
func (*CreateRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_statdb_99e851656c5814ac, []int{0}
|
||||
return fileDescriptor_statdb_1131c2a7357160d1, []int{0}
|
||||
}
|
||||
func (m *CreateRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_CreateRequest.Unmarshal(m, b)
|
||||
@ -81,7 +83,7 @@ func (m *CreateResponse) Reset() { *m = CreateResponse{} }
|
||||
func (m *CreateResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*CreateResponse) ProtoMessage() {}
|
||||
func (*CreateResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_statdb_99e851656c5814ac, []int{1}
|
||||
return fileDescriptor_statdb_1131c2a7357160d1, []int{1}
|
||||
}
|
||||
func (m *CreateResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_CreateResponse.Unmarshal(m, b)
|
||||
@ -120,7 +122,7 @@ func (m *GetRequest) Reset() { *m = GetRequest{} }
|
||||
func (m *GetRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*GetRequest) ProtoMessage() {}
|
||||
func (*GetRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_statdb_99e851656c5814ac, []int{2}
|
||||
return fileDescriptor_statdb_1131c2a7357160d1, []int{2}
|
||||
}
|
||||
func (m *GetRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_GetRequest.Unmarshal(m, b)
|
||||
@ -152,7 +154,7 @@ func (m *GetResponse) Reset() { *m = GetResponse{} }
|
||||
func (m *GetResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*GetResponse) ProtoMessage() {}
|
||||
func (*GetResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_statdb_99e851656c5814ac, []int{3}
|
||||
return fileDescriptor_statdb_1131c2a7357160d1, []int{3}
|
||||
}
|
||||
func (m *GetResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_GetResponse.Unmarshal(m, b)
|
||||
@ -192,7 +194,7 @@ func (m *FindValidNodesRequest) Reset() { *m = FindValidNodesRequest{} }
|
||||
func (m *FindValidNodesRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*FindValidNodesRequest) ProtoMessage() {}
|
||||
func (*FindValidNodesRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_statdb_99e851656c5814ac, []int{4}
|
||||
return fileDescriptor_statdb_1131c2a7357160d1, []int{4}
|
||||
}
|
||||
func (m *FindValidNodesRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_FindValidNodesRequest.Unmarshal(m, b)
|
||||
@ -232,7 +234,7 @@ func (m *FindValidNodesResponse) Reset() { *m = FindValidNodesResponse{}
|
||||
func (m *FindValidNodesResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*FindValidNodesResponse) ProtoMessage() {}
|
||||
func (*FindValidNodesResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_statdb_99e851656c5814ac, []int{5}
|
||||
return fileDescriptor_statdb_1131c2a7357160d1, []int{5}
|
||||
}
|
||||
func (m *FindValidNodesResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_FindValidNodesResponse.Unmarshal(m, b)
|
||||
@ -264,7 +266,7 @@ func (m *UpdateRequest) Reset() { *m = UpdateRequest{} }
|
||||
func (m *UpdateRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*UpdateRequest) ProtoMessage() {}
|
||||
func (*UpdateRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_statdb_99e851656c5814ac, []int{6}
|
||||
return fileDescriptor_statdb_1131c2a7357160d1, []int{6}
|
||||
}
|
||||
func (m *UpdateRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_UpdateRequest.Unmarshal(m, b)
|
||||
@ -303,7 +305,7 @@ func (m *UpdateResponse) Reset() { *m = UpdateResponse{} }
|
||||
func (m *UpdateResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*UpdateResponse) ProtoMessage() {}
|
||||
func (*UpdateResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_statdb_99e851656c5814ac, []int{7}
|
||||
return fileDescriptor_statdb_1131c2a7357160d1, []int{7}
|
||||
}
|
||||
func (m *UpdateResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_UpdateResponse.Unmarshal(m, b)
|
||||
@ -342,7 +344,7 @@ func (m *UpdateUptimeRequest) Reset() { *m = UpdateUptimeRequest{} }
|
||||
func (m *UpdateUptimeRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*UpdateUptimeRequest) ProtoMessage() {}
|
||||
func (*UpdateUptimeRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_statdb_99e851656c5814ac, []int{8}
|
||||
return fileDescriptor_statdb_1131c2a7357160d1, []int{8}
|
||||
}
|
||||
func (m *UpdateUptimeRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_UpdateUptimeRequest.Unmarshal(m, b)
|
||||
@ -381,7 +383,7 @@ func (m *UpdateUptimeResponse) Reset() { *m = UpdateUptimeResponse{} }
|
||||
func (m *UpdateUptimeResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*UpdateUptimeResponse) ProtoMessage() {}
|
||||
func (*UpdateUptimeResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_statdb_99e851656c5814ac, []int{9}
|
||||
return fileDescriptor_statdb_1131c2a7357160d1, []int{9}
|
||||
}
|
||||
func (m *UpdateUptimeResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_UpdateUptimeResponse.Unmarshal(m, b)
|
||||
@ -420,7 +422,7 @@ func (m *UpdateAuditSuccessRequest) Reset() { *m = UpdateAuditSuccessReq
|
||||
func (m *UpdateAuditSuccessRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*UpdateAuditSuccessRequest) ProtoMessage() {}
|
||||
func (*UpdateAuditSuccessRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_statdb_99e851656c5814ac, []int{10}
|
||||
return fileDescriptor_statdb_1131c2a7357160d1, []int{10}
|
||||
}
|
||||
func (m *UpdateAuditSuccessRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_UpdateAuditSuccessRequest.Unmarshal(m, b)
|
||||
@ -459,7 +461,7 @@ func (m *UpdateAuditSuccessResponse) Reset() { *m = UpdateAuditSuccessRe
|
||||
func (m *UpdateAuditSuccessResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*UpdateAuditSuccessResponse) ProtoMessage() {}
|
||||
func (*UpdateAuditSuccessResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_statdb_99e851656c5814ac, []int{11}
|
||||
return fileDescriptor_statdb_1131c2a7357160d1, []int{11}
|
||||
}
|
||||
func (m *UpdateAuditSuccessResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_UpdateAuditSuccessResponse.Unmarshal(m, b)
|
||||
@ -498,7 +500,7 @@ func (m *UpdateBatchRequest) Reset() { *m = UpdateBatchRequest{} }
|
||||
func (m *UpdateBatchRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*UpdateBatchRequest) ProtoMessage() {}
|
||||
func (*UpdateBatchRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_statdb_99e851656c5814ac, []int{12}
|
||||
return fileDescriptor_statdb_1131c2a7357160d1, []int{12}
|
||||
}
|
||||
func (m *UpdateBatchRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_UpdateBatchRequest.Unmarshal(m, b)
|
||||
@ -538,7 +540,7 @@ func (m *UpdateBatchResponse) Reset() { *m = UpdateBatchResponse{} }
|
||||
func (m *UpdateBatchResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*UpdateBatchResponse) ProtoMessage() {}
|
||||
func (*UpdateBatchResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_statdb_99e851656c5814ac, []int{13}
|
||||
return fileDescriptor_statdb_1131c2a7357160d1, []int{13}
|
||||
}
|
||||
func (m *UpdateBatchResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_UpdateBatchResponse.Unmarshal(m, b)
|
||||
@ -584,7 +586,7 @@ func (m *CreateEntryIfNotExistsRequest) Reset() { *m = CreateEntryIfNotE
|
||||
func (m *CreateEntryIfNotExistsRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*CreateEntryIfNotExistsRequest) ProtoMessage() {}
|
||||
func (*CreateEntryIfNotExistsRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_statdb_99e851656c5814ac, []int{14}
|
||||
return fileDescriptor_statdb_1131c2a7357160d1, []int{14}
|
||||
}
|
||||
func (m *CreateEntryIfNotExistsRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_CreateEntryIfNotExistsRequest.Unmarshal(m, b)
|
||||
@ -623,7 +625,7 @@ func (m *CreateEntryIfNotExistsResponse) Reset() { *m = CreateEntryIfNot
|
||||
func (m *CreateEntryIfNotExistsResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*CreateEntryIfNotExistsResponse) ProtoMessage() {}
|
||||
func (*CreateEntryIfNotExistsResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_statdb_99e851656c5814ac, []int{15}
|
||||
return fileDescriptor_statdb_1131c2a7357160d1, []int{15}
|
||||
}
|
||||
func (m *CreateEntryIfNotExistsResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_CreateEntryIfNotExistsResponse.Unmarshal(m, b)
|
||||
@ -677,8 +679,9 @@ var _ grpc.ClientConn
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
const _ = grpc.SupportPackageIsVersion4
|
||||
|
||||
// Client API for StatDB service
|
||||
|
||||
// StatDBClient is the client API for StatDB service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
||||
type StatDBClient interface {
|
||||
// Create a db entry for the provided storagenode ID
|
||||
Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error)
|
||||
@ -778,8 +781,7 @@ func (c *statDBClient) CreateEntryIfNotExists(ctx context.Context, in *CreateEnt
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// Server API for StatDB service
|
||||
|
||||
// StatDBServer is the server API for StatDB service.
|
||||
type StatDBServer interface {
|
||||
// Create a db entry for the provided storagenode ID
|
||||
Create(context.Context, *CreateRequest) (*CreateResponse, error)
|
||||
@ -988,9 +990,9 @@ var _StatDB_serviceDesc = grpc.ServiceDesc{
|
||||
Metadata: "statdb.proto",
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("statdb.proto", fileDescriptor_statdb_99e851656c5814ac) }
|
||||
func init() { proto.RegisterFile("statdb.proto", fileDescriptor_statdb_1131c2a7357160d1) }
|
||||
|
||||
var fileDescriptor_statdb_99e851656c5814ac = []byte{
|
||||
var fileDescriptor_statdb_1131c2a7357160d1 = []byte{
|
||||
// 569 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x55, 0xdd, 0x6a, 0x13, 0x41,
|
||||
0x14, 0x36, 0x6d, 0xdd, 0x36, 0x27, 0xdb, 0x08, 0x53, 0x1b, 0xea, 0xd4, 0xa6, 0xba, 0x10, 0x6d,
|
||||
|
@ -8,6 +8,7 @@ import (
|
||||
"io"
|
||||
"time"
|
||||
|
||||
"storj.io/storj/pkg/pb"
|
||||
"storj.io/storj/pkg/ranger"
|
||||
"storj.io/storj/pkg/storage/objects"
|
||||
"storj.io/storj/pkg/storj"
|
||||
@ -38,7 +39,7 @@ func (o *prefixedObjStore) Get(ctx context.Context, path storj.Path) (rr ranger.
|
||||
return o.store.Get(ctx, storj.JoinPaths(o.prefix, path))
|
||||
}
|
||||
|
||||
func (o *prefixedObjStore) Put(ctx context.Context, path storj.Path, data io.Reader, metadata objects.SerializableMeta, expiration time.Time) (meta objects.Meta, err error) {
|
||||
func (o *prefixedObjStore) Put(ctx context.Context, path storj.Path, data io.Reader, metadata pb.SerializableMeta, expiration time.Time) (meta objects.Meta, err error) {
|
||||
defer mon.Task()(&ctx)(&err)
|
||||
|
||||
if len(path) == 0 {
|
||||
|
@ -12,6 +12,7 @@ import (
|
||||
monkit "gopkg.in/spacemonkeygo/monkit.v2"
|
||||
|
||||
"storj.io/storj/pkg/encryption"
|
||||
"storj.io/storj/pkg/pb"
|
||||
"storj.io/storj/pkg/storage/meta"
|
||||
"storj.io/storj/pkg/storage/objects"
|
||||
"storj.io/storj/pkg/storage/streams"
|
||||
@ -111,7 +112,7 @@ func (b *BucketStore) Put(ctx context.Context, bucket string, pathCipher storj.C
|
||||
"path-enc-type": strconv.Itoa(int(pathCipher)),
|
||||
}
|
||||
var exp time.Time
|
||||
m, err := b.store.Put(ctx, bucket, r, objects.SerializableMeta{UserDefined: userMeta}, exp)
|
||||
m, err := b.store.Put(ctx, bucket, r, pb.SerializableMeta{UserDefined: userMeta}, exp)
|
||||
if err != nil {
|
||||
return Meta{}, err
|
||||
}
|
||||
|
@ -1,91 +0,0 @@
|
||||
// Copyright (C) 2018 Storj Labs, Inc.
|
||||
// See LICENSE for copying information.
|
||||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// source: meta.proto
|
||||
|
||||
package objects
|
||||
|
||||
import proto "github.com/golang/protobuf/proto"
|
||||
import fmt "fmt"
|
||||
import math "math"
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
// A compilation error at this line likely means your copy of the
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
|
||||
|
||||
// SerializableMeta is the object metadata that will be stored serialized
|
||||
type SerializableMeta struct {
|
||||
ContentType string `protobuf:"bytes,1,opt,name=ContentType,proto3" json:"ContentType,omitempty"`
|
||||
UserDefined map[string]string `protobuf:"bytes,2,rep,name=UserDefined,proto3" json:"UserDefined,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *SerializableMeta) Reset() { *m = SerializableMeta{} }
|
||||
func (m *SerializableMeta) String() string { return proto.CompactTextString(m) }
|
||||
func (*SerializableMeta) ProtoMessage() {}
|
||||
func (*SerializableMeta) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_meta_5a7fa61f937f80b3, []int{0}
|
||||
}
|
||||
func (m *SerializableMeta) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_SerializableMeta.Unmarshal(m, b)
|
||||
}
|
||||
func (m *SerializableMeta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_SerializableMeta.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (dst *SerializableMeta) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_SerializableMeta.Merge(dst, src)
|
||||
}
|
||||
func (m *SerializableMeta) XXX_Size() int {
|
||||
return xxx_messageInfo_SerializableMeta.Size(m)
|
||||
}
|
||||
func (m *SerializableMeta) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_SerializableMeta.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_SerializableMeta proto.InternalMessageInfo
|
||||
|
||||
func (m *SerializableMeta) GetContentType() string {
|
||||
if m != nil {
|
||||
return m.ContentType
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *SerializableMeta) GetUserDefined() map[string]string {
|
||||
if m != nil {
|
||||
return m.UserDefined
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*SerializableMeta)(nil), "objects.SerializableMeta")
|
||||
proto.RegisterMapType((map[string]string)(nil), "objects.SerializableMeta.UserDefinedEntry")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("meta.proto", fileDescriptor_meta_5a7fa61f937f80b3) }
|
||||
|
||||
var fileDescriptor_meta_5a7fa61f937f80b3 = []byte{
|
||||
// 172 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0xca, 0x4d, 0x2d, 0x49,
|
||||
0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0xcf, 0x4f, 0xca, 0x4a, 0x4d, 0x2e, 0x29, 0x56,
|
||||
0x3a, 0xc4, 0xc8, 0x25, 0x10, 0x9c, 0x5a, 0x94, 0x99, 0x98, 0x93, 0x59, 0x95, 0x98, 0x94, 0x93,
|
||||
0xea, 0x9b, 0x5a, 0x92, 0x28, 0xa4, 0xc0, 0xc5, 0xed, 0x9c, 0x9f, 0x57, 0x92, 0x9a, 0x57, 0x12,
|
||||
0x52, 0x59, 0x90, 0x2a, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x19, 0x84, 0x2c, 0x24, 0xe4, 0xc3, 0xc5,
|
||||
0x1d, 0x5a, 0x9c, 0x5a, 0xe4, 0x92, 0x9a, 0x96, 0x99, 0x97, 0x9a, 0x22, 0xc1, 0xa4, 0xc0, 0xac,
|
||||
0xc1, 0x6d, 0xa4, 0xa5, 0x07, 0x35, 0x55, 0x0f, 0xdd, 0x44, 0x3d, 0x24, 0xc5, 0xae, 0x79, 0x25,
|
||||
0x45, 0x95, 0x41, 0xc8, 0xda, 0xa5, 0xec, 0xb8, 0x04, 0xd0, 0x15, 0x08, 0x09, 0x70, 0x31, 0x67,
|
||||
0xa7, 0x56, 0x42, 0xed, 0x06, 0x31, 0x85, 0x44, 0xb8, 0x58, 0xcb, 0x12, 0x73, 0x4a, 0x53, 0x25,
|
||||
0x98, 0xc0, 0x62, 0x10, 0x8e, 0x15, 0x93, 0x05, 0x63, 0x12, 0x1b, 0xd8, 0x53, 0xc6, 0x80, 0x00,
|
||||
0x00, 0x00, 0xff, 0xff, 0x65, 0x5b, 0x93, 0x65, 0xe2, 0x00, 0x00, 0x00,
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
// Copyright (C) 2018 Storj Labs, Inc.
|
||||
// See LICENSE for copying information.
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
package objects;
|
||||
|
||||
// SerializableMeta is the object metadata that will be stored serialized
|
||||
message SerializableMeta {
|
||||
string ContentType = 1;
|
||||
map<string, string> UserDefined = 2;
|
||||
}
|
@ -12,6 +12,7 @@ import (
|
||||
"go.uber.org/zap"
|
||||
monkit "gopkg.in/spacemonkeygo/monkit.v2"
|
||||
|
||||
"storj.io/storj/pkg/pb"
|
||||
"storj.io/storj/pkg/ranger"
|
||||
"storj.io/storj/pkg/storage/streams"
|
||||
"storj.io/storj/pkg/storj"
|
||||
@ -22,7 +23,7 @@ var mon = monkit.Package()
|
||||
|
||||
// Meta is the full object metadata
|
||||
type Meta struct {
|
||||
SerializableMeta
|
||||
pb.SerializableMeta
|
||||
Modified time.Time
|
||||
Expiration time.Time
|
||||
Size int64
|
||||
@ -40,7 +41,7 @@ type ListItem struct {
|
||||
type Store interface {
|
||||
Meta(ctx context.Context, path storj.Path) (meta Meta, err error)
|
||||
Get(ctx context.Context, path storj.Path) (rr ranger.Ranger, meta Meta, err error)
|
||||
Put(ctx context.Context, path storj.Path, data io.Reader, metadata SerializableMeta, expiration time.Time) (meta Meta, err error)
|
||||
Put(ctx context.Context, path storj.Path, data io.Reader, metadata pb.SerializableMeta, expiration time.Time) (meta Meta, err error)
|
||||
Delete(ctx context.Context, path storj.Path) (err error)
|
||||
List(ctx context.Context, prefix, startAfter, endBefore storj.Path, recursive bool, limit int, metaFlags uint32) (items []ListItem, more bool, err error)
|
||||
}
|
||||
@ -88,7 +89,7 @@ func (o *objStore) Get(ctx context.Context, path storj.Path) (
|
||||
return rr, convertMeta(m), err
|
||||
}
|
||||
|
||||
func (o *objStore) Put(ctx context.Context, path storj.Path, data io.Reader, metadata SerializableMeta, expiration time.Time) (meta Meta, err error) {
|
||||
func (o *objStore) Put(ctx context.Context, path storj.Path, data io.Reader, metadata pb.SerializableMeta, expiration time.Time) (meta Meta, err error) {
|
||||
defer mon.Task()(&ctx)(&err)
|
||||
|
||||
if len(path) == 0 {
|
||||
@ -145,7 +146,7 @@ func (o *objStore) List(ctx context.Context, prefix, startAfter, endBefore storj
|
||||
|
||||
// convertMeta converts stream metadata to object metadata
|
||||
func convertMeta(m streams.Meta) Meta {
|
||||
ser := SerializableMeta{}
|
||||
ser := pb.SerializableMeta{}
|
||||
err := proto.Unmarshal(m.Data, &ser)
|
||||
if err != nil {
|
||||
zap.S().Warnf("Failed deserializing metadata: %v", err)
|
||||
|
@ -1,9 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# see https://github.com/gogo/protobuf#most-speed-and-most-customization
|
||||
go get github.com/gogo/protobuf/proto
|
||||
go get github.com/gogo/protobuf/jsonpb
|
||||
go get github.com/gogo/protobuf/protoc-gen-gogo
|
||||
go get github.com/gogo/protobuf/gogoproto
|
||||
|
||||
go generate ./pkg/pb ./pkg/statdb/proto
|
@ -2,6 +2,7 @@
|
||||
// See LICENSE for copying information.
|
||||
|
||||
// +build ignore
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
|
213
scripts/protobuf.go
Normal file
213
scripts/protobuf.go
Normal file
@ -0,0 +1,213 @@
|
||||
// Copyright (C) 2018 Storj Labs, Inc.
|
||||
// See LICENSE for copying information.
|
||||
|
||||
// +build ignore
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"flag"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"sort"
|
||||
"strings"
|
||||
)
|
||||
|
||||
var ignoreProto = map[string]bool{
|
||||
"gogo.proto": true,
|
||||
}
|
||||
|
||||
var protoc = flag.String("protoc", "protoc", "protoc location")
|
||||
|
||||
func main() {
|
||||
flag.Parse()
|
||||
|
||||
root := flag.Arg(1)
|
||||
if root == "" {
|
||||
root = "."
|
||||
}
|
||||
|
||||
var err error
|
||||
|
||||
switch flag.Arg(0) {
|
||||
case "install":
|
||||
// TODO: lock versions
|
||||
err = install(
|
||||
"github.com/ckaznocha/protoc-gen-lint",
|
||||
// See https://github.com/gogo/protobuf#most-speed-and-most-customization
|
||||
"github.com/gogo/protobuf/proto",
|
||||
"github.com/gogo/protobuf/jsonpb",
|
||||
"github.com/gogo/protobuf/protoc-gen-gogo",
|
||||
"github.com/gogo/protobuf/gogoproto",
|
||||
)
|
||||
case "generate":
|
||||
err = walkdirs(root, generate)
|
||||
case "lint":
|
||||
err = walkdirs(root, lint)
|
||||
default:
|
||||
fmt.Fprintf(os.Stderr, "unknown command %q\n", flag.Arg(0))
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "failure: %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
func install(deps ...string) error {
|
||||
gomod, err := ioutil.ReadFile("go.mod")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer func() {
|
||||
stat, err := os.Stat("go.mod")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
err = ioutil.WriteFile("go.mod", gomod, stat.Mode())
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}()
|
||||
|
||||
args := []string{"get", "-u"}
|
||||
args = append(args, deps...)
|
||||
|
||||
cmd := exec.Command("go", args...)
|
||||
fmt.Println(strings.Join(cmd.Args, " "))
|
||||
out, err := cmd.CombinedOutput()
|
||||
if len(out) > 0 {
|
||||
fmt.Println(string(out))
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func generate(dir string, dirs []string, files []string) error {
|
||||
defer switchdir(dir)()
|
||||
|
||||
args := []string{"--gogo_out=plugins=grpc:.", "--lint_out=."}
|
||||
args = appendCommonArguments(args, dir, dirs, files)
|
||||
|
||||
cmd := exec.Command(*protoc, args...)
|
||||
fmt.Println(strings.Join(cmd.Args, " "))
|
||||
out, err := cmd.CombinedOutput()
|
||||
if len(out) > 0 {
|
||||
fmt.Println(string(out))
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func appendCommonArguments(args []string, dir string, dirs []string, files []string) []string {
|
||||
for _, otherdir := range dirs {
|
||||
if otherdir == dir {
|
||||
args = append(args, "-I=.")
|
||||
continue
|
||||
}
|
||||
|
||||
reldir, err := filepath.Rel(dir, otherdir)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
args = append(args, "-I="+reldir)
|
||||
}
|
||||
|
||||
args = append(args, files...)
|
||||
|
||||
return args
|
||||
}
|
||||
|
||||
func lint(dir string, dirs []string, files []string) error {
|
||||
defer switchdir(dir)()
|
||||
|
||||
args := []string{"--lint_out=."}
|
||||
args = appendCommonArguments(args, dir, dirs, files)
|
||||
|
||||
cmd := exec.Command(*protoc, args...)
|
||||
fmt.Println(strings.Join(cmd.Args, " "))
|
||||
out, err := cmd.CombinedOutput()
|
||||
if len(out) > 0 {
|
||||
fmt.Println(string(out))
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func switchdir(to string) func() {
|
||||
local, err := os.Getwd()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
if err := os.Chdir(to); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return func() {
|
||||
if err := os.Chdir(local); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func walkdirs(root string, fn func(dir string, dirs []string, files []string) error) error {
|
||||
matches, err := listProtoFiles(root)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
byDir := map[string][]string{}
|
||||
for _, match := range matches {
|
||||
dir, file := filepath.Dir(match), filepath.Base(match)
|
||||
if ignoreProto[file] {
|
||||
continue
|
||||
}
|
||||
byDir[dir] = append(byDir[dir], file)
|
||||
}
|
||||
|
||||
dirs := []string{}
|
||||
for dir := range byDir {
|
||||
dirs = append(dirs, dir)
|
||||
}
|
||||
sort.Strings(dirs)
|
||||
|
||||
var errs []string
|
||||
for _, dir := range dirs {
|
||||
files := byDir[dir]
|
||||
sort.Strings(files)
|
||||
err := fn(dir, dirs, files)
|
||||
if err != nil {
|
||||
errs = append(errs, err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
if len(errs) > 0 {
|
||||
return errors.New(strings.Join(errs, "\n"))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func listProtoFiles(root string) ([]string, error) {
|
||||
files := []string{}
|
||||
|
||||
err := filepath.Walk(root, func(path string, info os.FileInfo, err error) error {
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
return nil
|
||||
}
|
||||
if info.IsDir() && info.Name() == ".git" {
|
||||
return filepath.SkipDir
|
||||
}
|
||||
if filepath.Ext(path) == ".proto" {
|
||||
files = append(files, path)
|
||||
}
|
||||
return nil
|
||||
})
|
||||
|
||||
return files, err
|
||||
}
|
Loading…
Reference in New Issue
Block a user