From 60eba990ebe7468597de7bc1043a7d795f57c486 Mon Sep 17 00:00:00 2001 From: Jeff Wendling Date: Wed, 4 Sep 2019 17:05:51 -0600 Subject: [PATCH] use-drpc: use protoc-gen-drpc to generate protobufs Change-Id: I5c23256068e30864022dba5137c499796ab9d6ad --- go.mod | 3 +- go.sum | 9 +- pkg/pb/certificate.pb.go | 66 +++ pkg/pb/contact.pb.go | 131 +++++ pkg/pb/inspector.pb.go | 678 +++++++++++++++++++++++++ pkg/pb/metainfo.pb.go | 1006 ++++++++++++++++++++++++++++++++++++++ pkg/pb/nodestats.pb.go | 102 ++++ pkg/pb/orders.pb.go | 93 ++++ pkg/pb/overlay.pb.go | 138 ++++++ pkg/pb/piecestore2.pb.go | 253 +++++++++- pkg/pb/vouchers.pb.go | 66 +++ scripts/protobuf.go | 14 +- 12 files changed, 2525 insertions(+), 34 deletions(-) diff --git a/go.mod b/go.mod index 4b83e24ca..5a7fe5c39 100644 --- a/go.mod +++ b/go.mod @@ -107,7 +107,7 @@ require ( github.com/vivint/infectious v0.0.0-20190108171102-2455b059135b github.com/yuin/gopher-lua v0.0.0-20180918061612-799fa34954fb // indirect github.com/zeebo/admission v0.0.0-20180821192747-f24f2a94a40c - github.com/zeebo/errs v1.2.1-0.20190617123220-06a113fed680 + github.com/zeebo/errs v1.2.2 github.com/zeebo/float16 v0.1.0 // indirect github.com/zeebo/incenc v0.0.0-20180505221441-0d92902eec54 // indirect github.com/zeebo/structs v1.0.2 @@ -126,4 +126,5 @@ require ( gopkg.in/olivere/elastic.v5 v5.0.76 // indirect gopkg.in/spacemonkeygo/monkit.v2 v2.0.0-20190612171030-cf5a9e6f8fd2 gopkg.in/yaml.v2 v2.2.2 + storj.io/drpc v0.0.1 ) diff --git a/go.sum b/go.sum index 46ca78f17..7865fc010 100644 --- a/go.sum +++ b/go.sum @@ -394,10 +394,12 @@ github.com/zeebo/admission v0.0.0-20180821192747-f24f2a94a40c h1:WoYvMZp+keiJz+Z github.com/zeebo/admission v0.0.0-20180821192747-f24f2a94a40c/go.mod h1:Aq7yiXoKLFIDzh4eR6EG4owIO9alpttZ0XJ5c/z/QrE= github.com/zeebo/assert v0.0.0-20181109011804-10f827ce2ed6 h1:bs7mSHVrLRQHxqWcm0hyez0sA23YuXb8Pwnq5NhyZ8A= github.com/zeebo/assert v0.0.0-20181109011804-10f827ce2ed6/go.mod h1:yssERNPivllc1yU3BvpjYI5BUW+zglcz6QWqeVRL5t0= +github.com/zeebo/assert v1.0.0 h1:qw3LXzO7lbptWIQ6DsemJIUOoaqyKbgY3M8b8yvlaaY= +github.com/zeebo/assert v1.0.0/go.mod h1:yssERNPivllc1yU3BvpjYI5BUW+zglcz6QWqeVRL5t0= github.com/zeebo/errs v1.1.1 h1:Cs5Noqj/tj3Ql/hLkD9WdumKlssx/IN2zr7CRGNOKZA= github.com/zeebo/errs v1.1.1/go.mod h1:Yj8dHrUQwls1bF3dr/vcSIu+qf4mI7idnTcHfoACc6I= -github.com/zeebo/errs v1.2.1-0.20190617123220-06a113fed680 h1:nLsPSuW22yF+MmUX0sFaTfnMKL83XuHtx8B1YvNtYys= -github.com/zeebo/errs v1.2.1-0.20190617123220-06a113fed680/go.mod h1:sgbWHsvVuTPHcqJJGQ1WhI5KbWlHYz+2+2C/LSEtCw4= +github.com/zeebo/errs v1.2.2 h1:5NFypMTuSdoySVTqlNs1dEoU21QVamMQJxW/Fii5O7g= +github.com/zeebo/errs v1.2.2/go.mod h1:sgbWHsvVuTPHcqJJGQ1WhI5KbWlHYz+2+2C/LSEtCw4= github.com/zeebo/float16 v0.1.0 h1:kRqxv5og6z1emEyz5FpW0/BVHe5VfxEAw6b1ljCZlUc= github.com/zeebo/float16 v0.1.0/go.mod h1:fssGvvXu+XS8MH57cKmyrLB/cqioYeYX/2mXCN3a5wo= github.com/zeebo/incenc v0.0.0-20180505221441-0d92902eec54 h1:+cwNE5KJ3pika4HuzmDHkDlK5myo0G9Sv+eO7WWxnUQ= @@ -454,7 +456,6 @@ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190730183949-1393eb018365 h1:SaXEMXhWzMJThc05vu6uh61Q245r4KaWMrsTedk0FDc= golang.org/x/sys v0.0.0-20190730183949-1393eb018365/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a h1:aYOabOQFp6Vj6W1F80affTUvO9UxmJRx8K0gsfABByQ= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= @@ -518,3 +519,5 @@ gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +storj.io/drpc v0.0.1 h1:pCun+YtrgpQV+ISFhs3yT8GDfEJi8YyCslwaOpEzFjk= +storj.io/drpc v0.0.1/go.mod h1:/ascUDbzNAv0A3Jj7wUIKFBH2JdJ2uJIBO/b9+2yHgQ= diff --git a/pkg/pb/certificate.pb.go b/pkg/pb/certificate.pb.go index 18a84540e..e1d97f4a0 100644 --- a/pkg/pb/certificate.pb.go +++ b/pkg/pb/certificate.pb.go @@ -10,6 +10,7 @@ import ( proto "github.com/gogo/protobuf/proto" grpc "google.golang.org/grpc" math "math" + drpc "storj.io/drpc" ) // Reference imports to suppress errors if they are not otherwise used. @@ -130,6 +131,71 @@ var fileDescriptor_c0d34c34dd33be4b = []byte{ 0x4f, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x3a, 0xd8, 0xc7, 0x87, 0xf0, 0x00, 0x00, 0x00, } +type DRPCCertificatesClient interface { + DRPCConn() drpc.Conn + + Sign(ctx context.Context, in *SigningRequest) (*SigningResponse, error) +} + +type drpcCertificatesClient struct { + cc drpc.Conn +} + +func NewDRPCCertificatesClient(cc drpc.Conn) DRPCCertificatesClient { + return &drpcCertificatesClient{cc} +} + +func (c *drpcCertificatesClient) DRPCConn() drpc.Conn { return c.cc } + +func (c *drpcCertificatesClient) Sign(ctx context.Context, in *SigningRequest) (*SigningResponse, error) { + out := new(SigningResponse) + err := c.cc.Invoke(ctx, "/node.Certificates/Sign", in, out) + if err != nil { + return nil, err + } + return out, nil +} + +type DRPCCertificatesServer interface { + DRPCSign(context.Context, *SigningRequest) (*SigningResponse, error) +} + +type DRPCCertificatesDescription struct{} + +func (DRPCCertificatesDescription) NumMethods() int { return 1 } + +func (DRPCCertificatesDescription) Method(n int) (string, drpc.Handler, interface{}, bool) { + switch n { + case 0: + return "/node.Certificates/Sign", + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCCertificatesServer). + DRPCSign( + ctx, + in1.(*SigningRequest), + ) + }, DRPCCertificatesServer.DRPCSign, true + default: + return "", nil, nil, false + } +} + +type DRPCCertificates_SignStream interface { + drpc.Stream + SendAndClose(*SigningResponse) error +} + +type drpcCertificatesSignStream struct { + drpc.Stream +} + +func (x *drpcCertificatesSignStream) SendAndClose(m *SigningResponse) error { + if err := x.MsgSend(m); err != nil { + return err + } + return x.CloseSend() +} + // Reference imports to suppress errors if they are not otherwise used. var _ context.Context var _ grpc.ClientConn diff --git a/pkg/pb/contact.pb.go b/pkg/pb/contact.pb.go index ca0271cf2..f5d70d5a4 100644 --- a/pkg/pb/contact.pb.go +++ b/pkg/pb/contact.pb.go @@ -9,6 +9,7 @@ import ( proto "github.com/gogo/protobuf/proto" grpc "google.golang.org/grpc" math "math" + drpc "storj.io/drpc" ) // Reference imports to suppress errors if they are not otherwise used. @@ -214,6 +215,136 @@ var fileDescriptor_a5036fff2565fb15 = []byte{ 0x04, 0x02, 0x00, 0x00, } +type DRPCContactClient interface { + DRPCConn() drpc.Conn + + PingNode(ctx context.Context, in *ContactPingRequest) (*ContactPingResponse, error) +} + +type drpcContactClient struct { + cc drpc.Conn +} + +func NewDRPCContactClient(cc drpc.Conn) DRPCContactClient { + return &drpcContactClient{cc} +} + +func (c *drpcContactClient) DRPCConn() drpc.Conn { return c.cc } + +func (c *drpcContactClient) PingNode(ctx context.Context, in *ContactPingRequest) (*ContactPingResponse, error) { + out := new(ContactPingResponse) + err := c.cc.Invoke(ctx, "/contact.Contact/PingNode", in, out) + if err != nil { + return nil, err + } + return out, nil +} + +type DRPCContactServer interface { + DRPCPingNode(context.Context, *ContactPingRequest) (*ContactPingResponse, error) +} + +type DRPCContactDescription struct{} + +func (DRPCContactDescription) NumMethods() int { return 1 } + +func (DRPCContactDescription) Method(n int) (string, drpc.Handler, interface{}, bool) { + switch n { + case 0: + return "/contact.Contact/PingNode", + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCContactServer). + DRPCPingNode( + ctx, + in1.(*ContactPingRequest), + ) + }, DRPCContactServer.DRPCPingNode, true + default: + return "", nil, nil, false + } +} + +type DRPCContact_PingNodeStream interface { + drpc.Stream + SendAndClose(*ContactPingResponse) error +} + +type drpcContactPingNodeStream struct { + drpc.Stream +} + +func (x *drpcContactPingNodeStream) SendAndClose(m *ContactPingResponse) error { + if err := x.MsgSend(m); err != nil { + return err + } + return x.CloseSend() +} + +type DRPCNodeClient interface { + DRPCConn() drpc.Conn + + Checkin(ctx context.Context, in *CheckinRequest) (*CheckinResponse, error) +} + +type drpcNodeClient struct { + cc drpc.Conn +} + +func NewDRPCNodeClient(cc drpc.Conn) DRPCNodeClient { + return &drpcNodeClient{cc} +} + +func (c *drpcNodeClient) DRPCConn() drpc.Conn { return c.cc } + +func (c *drpcNodeClient) Checkin(ctx context.Context, in *CheckinRequest) (*CheckinResponse, error) { + out := new(CheckinResponse) + err := c.cc.Invoke(ctx, "/contact.Node/Checkin", in, out) + if err != nil { + return nil, err + } + return out, nil +} + +type DRPCNodeServer interface { + DRPCCheckin(context.Context, *CheckinRequest) (*CheckinResponse, error) +} + +type DRPCNodeDescription struct{} + +func (DRPCNodeDescription) NumMethods() int { return 1 } + +func (DRPCNodeDescription) Method(n int) (string, drpc.Handler, interface{}, bool) { + switch n { + case 0: + return "/contact.Node/Checkin", + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCNodeServer). + DRPCCheckin( + ctx, + in1.(*CheckinRequest), + ) + }, DRPCNodeServer.DRPCCheckin, true + default: + return "", nil, nil, false + } +} + +type DRPCNode_CheckinStream interface { + drpc.Stream + SendAndClose(*CheckinResponse) error +} + +type drpcNodeCheckinStream struct { + drpc.Stream +} + +func (x *drpcNodeCheckinStream) SendAndClose(m *CheckinResponse) error { + if err := x.MsgSend(m); err != nil { + return err + } + return x.CloseSend() +} + // Reference imports to suppress errors if they are not otherwise used. var _ context.Context var _ grpc.ClientConn diff --git a/pkg/pb/inspector.pb.go b/pkg/pb/inspector.pb.go index 9ca2d85a7..7f8ea2d5b 100644 --- a/pkg/pb/inspector.pb.go +++ b/pkg/pb/inspector.pb.go @@ -12,6 +12,7 @@ import ( _ "github.com/golang/protobuf/ptypes/timestamp" grpc "google.golang.org/grpc" math "math" + drpc "storj.io/drpc" time "time" ) @@ -1623,6 +1624,683 @@ var fileDescriptor_a07d9034b2dd9d26 = []byte{ 0x00, 0x00, } +type DRPCKadInspectorClient interface { + DRPCConn() drpc.Conn + + // CountNodes returns the number of nodes in the routing table + CountNodes(ctx context.Context, in *CountNodesRequest) (*CountNodesResponse, error) + // PingNode sends a PING RPC to a node and returns its availability + PingNode(ctx context.Context, in *PingNodeRequest) (*PingNodeResponse, error) + // LookupNode triggers a Kademlia FindNode and returns the response + LookupNode(ctx context.Context, in *LookupNodeRequest) (*LookupNodeResponse, error) + // NodeInfo sends a PING RPC to a node and returns its local info + NodeInfo(ctx context.Context, in *NodeInfoRequest) (*NodeInfoResponse, error) + // FindNear returns limit number of IDs "near" the Start ID + FindNear(ctx context.Context, in *FindNearRequest) (*FindNearResponse, error) + // DumpNodes returns all the nodes in the node database + DumpNodes(ctx context.Context, in *DumpNodesRequest) (*DumpNodesResponse, error) + // GetBucketList returns all the buckets with all their nodes + GetBucketList(ctx context.Context, in *GetBucketListRequest) (*GetBucketListResponse, error) +} + +type drpcKadInspectorClient struct { + cc drpc.Conn +} + +func NewDRPCKadInspectorClient(cc drpc.Conn) DRPCKadInspectorClient { + return &drpcKadInspectorClient{cc} +} + +func (c *drpcKadInspectorClient) DRPCConn() drpc.Conn { return c.cc } + +func (c *drpcKadInspectorClient) CountNodes(ctx context.Context, in *CountNodesRequest) (*CountNodesResponse, error) { + out := new(CountNodesResponse) + err := c.cc.Invoke(ctx, "/inspector.KadInspector/CountNodes", in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *drpcKadInspectorClient) PingNode(ctx context.Context, in *PingNodeRequest) (*PingNodeResponse, error) { + out := new(PingNodeResponse) + err := c.cc.Invoke(ctx, "/inspector.KadInspector/PingNode", in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *drpcKadInspectorClient) LookupNode(ctx context.Context, in *LookupNodeRequest) (*LookupNodeResponse, error) { + out := new(LookupNodeResponse) + err := c.cc.Invoke(ctx, "/inspector.KadInspector/LookupNode", in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *drpcKadInspectorClient) NodeInfo(ctx context.Context, in *NodeInfoRequest) (*NodeInfoResponse, error) { + out := new(NodeInfoResponse) + err := c.cc.Invoke(ctx, "/inspector.KadInspector/NodeInfo", in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *drpcKadInspectorClient) FindNear(ctx context.Context, in *FindNearRequest) (*FindNearResponse, error) { + out := new(FindNearResponse) + err := c.cc.Invoke(ctx, "/inspector.KadInspector/FindNear", in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *drpcKadInspectorClient) DumpNodes(ctx context.Context, in *DumpNodesRequest) (*DumpNodesResponse, error) { + out := new(DumpNodesResponse) + err := c.cc.Invoke(ctx, "/inspector.KadInspector/DumpNodes", in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *drpcKadInspectorClient) GetBucketList(ctx context.Context, in *GetBucketListRequest) (*GetBucketListResponse, error) { + out := new(GetBucketListResponse) + err := c.cc.Invoke(ctx, "/inspector.KadInspector/GetBucketList", in, out) + if err != nil { + return nil, err + } + return out, nil +} + +type DRPCKadInspectorServer interface { + // CountNodes returns the number of nodes in the routing table + DRPCCountNodes(context.Context, *CountNodesRequest) (*CountNodesResponse, error) + // PingNode sends a PING RPC to a node and returns its availability + DRPCPingNode(context.Context, *PingNodeRequest) (*PingNodeResponse, error) + // LookupNode triggers a Kademlia FindNode and returns the response + DRPCLookupNode(context.Context, *LookupNodeRequest) (*LookupNodeResponse, error) + // NodeInfo sends a PING RPC to a node and returns its local info + DRPCNodeInfo(context.Context, *NodeInfoRequest) (*NodeInfoResponse, error) + // FindNear returns limit number of IDs "near" the Start ID + DRPCFindNear(context.Context, *FindNearRequest) (*FindNearResponse, error) + // DumpNodes returns all the nodes in the node database + DRPCDumpNodes(context.Context, *DumpNodesRequest) (*DumpNodesResponse, error) + // GetBucketList returns all the buckets with all their nodes + DRPCGetBucketList(context.Context, *GetBucketListRequest) (*GetBucketListResponse, error) +} + +type DRPCKadInspectorDescription struct{} + +func (DRPCKadInspectorDescription) NumMethods() int { return 7 } + +func (DRPCKadInspectorDescription) Method(n int) (string, drpc.Handler, interface{}, bool) { + switch n { + case 0: + return "/inspector.KadInspector/CountNodes", + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCKadInspectorServer). + DRPCCountNodes( + ctx, + in1.(*CountNodesRequest), + ) + }, DRPCKadInspectorServer.DRPCCountNodes, true + case 1: + return "/inspector.KadInspector/PingNode", + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCKadInspectorServer). + DRPCPingNode( + ctx, + in1.(*PingNodeRequest), + ) + }, DRPCKadInspectorServer.DRPCPingNode, true + case 2: + return "/inspector.KadInspector/LookupNode", + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCKadInspectorServer). + DRPCLookupNode( + ctx, + in1.(*LookupNodeRequest), + ) + }, DRPCKadInspectorServer.DRPCLookupNode, true + case 3: + return "/inspector.KadInspector/NodeInfo", + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCKadInspectorServer). + DRPCNodeInfo( + ctx, + in1.(*NodeInfoRequest), + ) + }, DRPCKadInspectorServer.DRPCNodeInfo, true + case 4: + return "/inspector.KadInspector/FindNear", + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCKadInspectorServer). + DRPCFindNear( + ctx, + in1.(*FindNearRequest), + ) + }, DRPCKadInspectorServer.DRPCFindNear, true + case 5: + return "/inspector.KadInspector/DumpNodes", + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCKadInspectorServer). + DRPCDumpNodes( + ctx, + in1.(*DumpNodesRequest), + ) + }, DRPCKadInspectorServer.DRPCDumpNodes, true + case 6: + return "/inspector.KadInspector/GetBucketList", + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCKadInspectorServer). + DRPCGetBucketList( + ctx, + in1.(*GetBucketListRequest), + ) + }, DRPCKadInspectorServer.DRPCGetBucketList, true + default: + return "", nil, nil, false + } +} + +type DRPCKadInspector_CountNodesStream interface { + drpc.Stream + SendAndClose(*CountNodesResponse) error +} + +type drpcKadInspectorCountNodesStream struct { + drpc.Stream +} + +func (x *drpcKadInspectorCountNodesStream) SendAndClose(m *CountNodesResponse) error { + if err := x.MsgSend(m); err != nil { + return err + } + return x.CloseSend() +} + +type DRPCKadInspector_PingNodeStream interface { + drpc.Stream + SendAndClose(*PingNodeResponse) error +} + +type drpcKadInspectorPingNodeStream struct { + drpc.Stream +} + +func (x *drpcKadInspectorPingNodeStream) SendAndClose(m *PingNodeResponse) error { + if err := x.MsgSend(m); err != nil { + return err + } + return x.CloseSend() +} + +type DRPCKadInspector_LookupNodeStream interface { + drpc.Stream + SendAndClose(*LookupNodeResponse) error +} + +type drpcKadInspectorLookupNodeStream struct { + drpc.Stream +} + +func (x *drpcKadInspectorLookupNodeStream) SendAndClose(m *LookupNodeResponse) error { + if err := x.MsgSend(m); err != nil { + return err + } + return x.CloseSend() +} + +type DRPCKadInspector_NodeInfoStream interface { + drpc.Stream + SendAndClose(*NodeInfoResponse) error +} + +type drpcKadInspectorNodeInfoStream struct { + drpc.Stream +} + +func (x *drpcKadInspectorNodeInfoStream) SendAndClose(m *NodeInfoResponse) error { + if err := x.MsgSend(m); err != nil { + return err + } + return x.CloseSend() +} + +type DRPCKadInspector_FindNearStream interface { + drpc.Stream + SendAndClose(*FindNearResponse) error +} + +type drpcKadInspectorFindNearStream struct { + drpc.Stream +} + +func (x *drpcKadInspectorFindNearStream) SendAndClose(m *FindNearResponse) error { + if err := x.MsgSend(m); err != nil { + return err + } + return x.CloseSend() +} + +type DRPCKadInspector_DumpNodesStream interface { + drpc.Stream + SendAndClose(*DumpNodesResponse) error +} + +type drpcKadInspectorDumpNodesStream struct { + drpc.Stream +} + +func (x *drpcKadInspectorDumpNodesStream) SendAndClose(m *DumpNodesResponse) error { + if err := x.MsgSend(m); err != nil { + return err + } + return x.CloseSend() +} + +type DRPCKadInspector_GetBucketListStream interface { + drpc.Stream + SendAndClose(*GetBucketListResponse) error +} + +type drpcKadInspectorGetBucketListStream struct { + drpc.Stream +} + +func (x *drpcKadInspectorGetBucketListStream) SendAndClose(m *GetBucketListResponse) error { + if err := x.MsgSend(m); err != nil { + return err + } + return x.CloseSend() +} + +type DRPCOverlayInspectorClient interface { + DRPCConn() drpc.Conn + + // CountNodes returns the number of nodes in the cache + CountNodes(ctx context.Context, in *CountNodesRequest) (*CountNodesResponse, error) + // DumpNodes returns all the nodes in the cache + DumpNodes(ctx context.Context, in *DumpNodesRequest) (*DumpNodesResponse, error) +} + +type drpcOverlayInspectorClient struct { + cc drpc.Conn +} + +func NewDRPCOverlayInspectorClient(cc drpc.Conn) DRPCOverlayInspectorClient { + return &drpcOverlayInspectorClient{cc} +} + +func (c *drpcOverlayInspectorClient) DRPCConn() drpc.Conn { return c.cc } + +func (c *drpcOverlayInspectorClient) CountNodes(ctx context.Context, in *CountNodesRequest) (*CountNodesResponse, error) { + out := new(CountNodesResponse) + err := c.cc.Invoke(ctx, "/inspector.OverlayInspector/CountNodes", in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *drpcOverlayInspectorClient) DumpNodes(ctx context.Context, in *DumpNodesRequest) (*DumpNodesResponse, error) { + out := new(DumpNodesResponse) + err := c.cc.Invoke(ctx, "/inspector.OverlayInspector/DumpNodes", in, out) + if err != nil { + return nil, err + } + return out, nil +} + +type DRPCOverlayInspectorServer interface { + // CountNodes returns the number of nodes in the cache + DRPCCountNodes(context.Context, *CountNodesRequest) (*CountNodesResponse, error) + // DumpNodes returns all the nodes in the cache + DRPCDumpNodes(context.Context, *DumpNodesRequest) (*DumpNodesResponse, error) +} + +type DRPCOverlayInspectorDescription struct{} + +func (DRPCOverlayInspectorDescription) NumMethods() int { return 2 } + +func (DRPCOverlayInspectorDescription) Method(n int) (string, drpc.Handler, interface{}, bool) { + switch n { + case 0: + return "/inspector.OverlayInspector/CountNodes", + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCOverlayInspectorServer). + DRPCCountNodes( + ctx, + in1.(*CountNodesRequest), + ) + }, DRPCOverlayInspectorServer.DRPCCountNodes, true + case 1: + return "/inspector.OverlayInspector/DumpNodes", + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCOverlayInspectorServer). + DRPCDumpNodes( + ctx, + in1.(*DumpNodesRequest), + ) + }, DRPCOverlayInspectorServer.DRPCDumpNodes, true + default: + return "", nil, nil, false + } +} + +type DRPCOverlayInspector_CountNodesStream interface { + drpc.Stream + SendAndClose(*CountNodesResponse) error +} + +type drpcOverlayInspectorCountNodesStream struct { + drpc.Stream +} + +func (x *drpcOverlayInspectorCountNodesStream) SendAndClose(m *CountNodesResponse) error { + if err := x.MsgSend(m); err != nil { + return err + } + return x.CloseSend() +} + +type DRPCOverlayInspector_DumpNodesStream interface { + drpc.Stream + SendAndClose(*DumpNodesResponse) error +} + +type drpcOverlayInspectorDumpNodesStream struct { + drpc.Stream +} + +func (x *drpcOverlayInspectorDumpNodesStream) SendAndClose(m *DumpNodesResponse) error { + if err := x.MsgSend(m); err != nil { + return err + } + return x.CloseSend() +} + +type DRPCPieceStoreInspectorClient interface { + DRPCConn() drpc.Conn + + // Stats return space and bandwidth stats for a storagenode + Stats(ctx context.Context, in *StatsRequest) (*StatSummaryResponse, error) + // Dashboard returns stats for a specific storagenode + Dashboard(ctx context.Context, in *DashboardRequest) (*DashboardResponse, error) +} + +type drpcPieceStoreInspectorClient struct { + cc drpc.Conn +} + +func NewDRPCPieceStoreInspectorClient(cc drpc.Conn) DRPCPieceStoreInspectorClient { + return &drpcPieceStoreInspectorClient{cc} +} + +func (c *drpcPieceStoreInspectorClient) DRPCConn() drpc.Conn { return c.cc } + +func (c *drpcPieceStoreInspectorClient) Stats(ctx context.Context, in *StatsRequest) (*StatSummaryResponse, error) { + out := new(StatSummaryResponse) + err := c.cc.Invoke(ctx, "/inspector.PieceStoreInspector/Stats", in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *drpcPieceStoreInspectorClient) Dashboard(ctx context.Context, in *DashboardRequest) (*DashboardResponse, error) { + out := new(DashboardResponse) + err := c.cc.Invoke(ctx, "/inspector.PieceStoreInspector/Dashboard", in, out) + if err != nil { + return nil, err + } + return out, nil +} + +type DRPCPieceStoreInspectorServer interface { + // Stats return space and bandwidth stats for a storagenode + DRPCStats(context.Context, *StatsRequest) (*StatSummaryResponse, error) + // Dashboard returns stats for a specific storagenode + DRPCDashboard(context.Context, *DashboardRequest) (*DashboardResponse, error) +} + +type DRPCPieceStoreInspectorDescription struct{} + +func (DRPCPieceStoreInspectorDescription) NumMethods() int { return 2 } + +func (DRPCPieceStoreInspectorDescription) Method(n int) (string, drpc.Handler, interface{}, bool) { + switch n { + case 0: + return "/inspector.PieceStoreInspector/Stats", + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCPieceStoreInspectorServer). + DRPCStats( + ctx, + in1.(*StatsRequest), + ) + }, DRPCPieceStoreInspectorServer.DRPCStats, true + case 1: + return "/inspector.PieceStoreInspector/Dashboard", + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCPieceStoreInspectorServer). + DRPCDashboard( + ctx, + in1.(*DashboardRequest), + ) + }, DRPCPieceStoreInspectorServer.DRPCDashboard, true + default: + return "", nil, nil, false + } +} + +type DRPCPieceStoreInspector_StatsStream interface { + drpc.Stream + SendAndClose(*StatSummaryResponse) error +} + +type drpcPieceStoreInspectorStatsStream struct { + drpc.Stream +} + +func (x *drpcPieceStoreInspectorStatsStream) SendAndClose(m *StatSummaryResponse) error { + if err := x.MsgSend(m); err != nil { + return err + } + return x.CloseSend() +} + +type DRPCPieceStoreInspector_DashboardStream interface { + drpc.Stream + SendAndClose(*DashboardResponse) error +} + +type drpcPieceStoreInspectorDashboardStream struct { + drpc.Stream +} + +func (x *drpcPieceStoreInspectorDashboardStream) SendAndClose(m *DashboardResponse) error { + if err := x.MsgSend(m); err != nil { + return err + } + return x.CloseSend() +} + +type DRPCIrreparableInspectorClient interface { + DRPCConn() drpc.Conn + + // ListIrreparableSegments returns damaged segments + ListIrreparableSegments(ctx context.Context, in *ListIrreparableSegmentsRequest) (*ListIrreparableSegmentsResponse, error) +} + +type drpcIrreparableInspectorClient struct { + cc drpc.Conn +} + +func NewDRPCIrreparableInspectorClient(cc drpc.Conn) DRPCIrreparableInspectorClient { + return &drpcIrreparableInspectorClient{cc} +} + +func (c *drpcIrreparableInspectorClient) DRPCConn() drpc.Conn { return c.cc } + +func (c *drpcIrreparableInspectorClient) ListIrreparableSegments(ctx context.Context, in *ListIrreparableSegmentsRequest) (*ListIrreparableSegmentsResponse, error) { + out := new(ListIrreparableSegmentsResponse) + err := c.cc.Invoke(ctx, "/inspector.IrreparableInspector/ListIrreparableSegments", in, out) + if err != nil { + return nil, err + } + return out, nil +} + +type DRPCIrreparableInspectorServer interface { + // ListIrreparableSegments returns damaged segments + DRPCListIrreparableSegments(context.Context, *ListIrreparableSegmentsRequest) (*ListIrreparableSegmentsResponse, error) +} + +type DRPCIrreparableInspectorDescription struct{} + +func (DRPCIrreparableInspectorDescription) NumMethods() int { return 1 } + +func (DRPCIrreparableInspectorDescription) Method(n int) (string, drpc.Handler, interface{}, bool) { + switch n { + case 0: + return "/inspector.IrreparableInspector/ListIrreparableSegments", + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCIrreparableInspectorServer). + DRPCListIrreparableSegments( + ctx, + in1.(*ListIrreparableSegmentsRequest), + ) + }, DRPCIrreparableInspectorServer.DRPCListIrreparableSegments, true + default: + return "", nil, nil, false + } +} + +type DRPCIrreparableInspector_ListIrreparableSegmentsStream interface { + drpc.Stream + SendAndClose(*ListIrreparableSegmentsResponse) error +} + +type drpcIrreparableInspectorListIrreparableSegmentsStream struct { + drpc.Stream +} + +func (x *drpcIrreparableInspectorListIrreparableSegmentsStream) SendAndClose(m *ListIrreparableSegmentsResponse) error { + if err := x.MsgSend(m); err != nil { + return err + } + return x.CloseSend() +} + +type DRPCHealthInspectorClient interface { + DRPCConn() drpc.Conn + + // ObjectHealth will return stats about the health of an object + ObjectHealth(ctx context.Context, in *ObjectHealthRequest) (*ObjectHealthResponse, error) + // SegmentHealth will return stats about the health of a segment + SegmentHealth(ctx context.Context, in *SegmentHealthRequest) (*SegmentHealthResponse, error) +} + +type drpcHealthInspectorClient struct { + cc drpc.Conn +} + +func NewDRPCHealthInspectorClient(cc drpc.Conn) DRPCHealthInspectorClient { + return &drpcHealthInspectorClient{cc} +} + +func (c *drpcHealthInspectorClient) DRPCConn() drpc.Conn { return c.cc } + +func (c *drpcHealthInspectorClient) ObjectHealth(ctx context.Context, in *ObjectHealthRequest) (*ObjectHealthResponse, error) { + out := new(ObjectHealthResponse) + err := c.cc.Invoke(ctx, "/inspector.HealthInspector/ObjectHealth", in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *drpcHealthInspectorClient) SegmentHealth(ctx context.Context, in *SegmentHealthRequest) (*SegmentHealthResponse, error) { + out := new(SegmentHealthResponse) + err := c.cc.Invoke(ctx, "/inspector.HealthInspector/SegmentHealth", in, out) + if err != nil { + return nil, err + } + return out, nil +} + +type DRPCHealthInspectorServer interface { + // ObjectHealth will return stats about the health of an object + DRPCObjectHealth(context.Context, *ObjectHealthRequest) (*ObjectHealthResponse, error) + // SegmentHealth will return stats about the health of a segment + DRPCSegmentHealth(context.Context, *SegmentHealthRequest) (*SegmentHealthResponse, error) +} + +type DRPCHealthInspectorDescription struct{} + +func (DRPCHealthInspectorDescription) NumMethods() int { return 2 } + +func (DRPCHealthInspectorDescription) Method(n int) (string, drpc.Handler, interface{}, bool) { + switch n { + case 0: + return "/inspector.HealthInspector/ObjectHealth", + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCHealthInspectorServer). + DRPCObjectHealth( + ctx, + in1.(*ObjectHealthRequest), + ) + }, DRPCHealthInspectorServer.DRPCObjectHealth, true + case 1: + return "/inspector.HealthInspector/SegmentHealth", + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCHealthInspectorServer). + DRPCSegmentHealth( + ctx, + in1.(*SegmentHealthRequest), + ) + }, DRPCHealthInspectorServer.DRPCSegmentHealth, true + default: + return "", nil, nil, false + } +} + +type DRPCHealthInspector_ObjectHealthStream interface { + drpc.Stream + SendAndClose(*ObjectHealthResponse) error +} + +type drpcHealthInspectorObjectHealthStream struct { + drpc.Stream +} + +func (x *drpcHealthInspectorObjectHealthStream) SendAndClose(m *ObjectHealthResponse) error { + if err := x.MsgSend(m); err != nil { + return err + } + return x.CloseSend() +} + +type DRPCHealthInspector_SegmentHealthStream interface { + drpc.Stream + SendAndClose(*SegmentHealthResponse) error +} + +type drpcHealthInspectorSegmentHealthStream struct { + drpc.Stream +} + +func (x *drpcHealthInspectorSegmentHealthStream) SendAndClose(m *SegmentHealthResponse) error { + if err := x.MsgSend(m); err != nil { + return err + } + return x.CloseSend() +} + // Reference imports to suppress errors if they are not otherwise used. var _ context.Context var _ grpc.ClientConn diff --git a/pkg/pb/metainfo.pb.go b/pkg/pb/metainfo.pb.go index 4118fd740..e71f8bbf2 100644 --- a/pkg/pb/metainfo.pb.go +++ b/pkg/pb/metainfo.pb.go @@ -11,6 +11,7 @@ import ( _ "github.com/golang/protobuf/ptypes/timestamp" grpc "google.golang.org/grpc" math "math" + drpc "storj.io/drpc" time "time" ) @@ -5111,6 +5112,1011 @@ var fileDescriptor_631e2f30a93cd64e = []byte{ 0x85, 0xf8, 0x5e, 0x21, 0x3f, 0x00, 0x00, } +type DRPCMetainfoClient interface { + DRPCConn() drpc.Conn + + // Bucket + CreateBucket(ctx context.Context, in *BucketCreateRequest) (*BucketCreateResponse, error) + GetBucket(ctx context.Context, in *BucketGetRequest) (*BucketGetResponse, error) + DeleteBucket(ctx context.Context, in *BucketDeleteRequest) (*BucketDeleteResponse, error) + ListBuckets(ctx context.Context, in *BucketListRequest) (*BucketListResponse, error) + SetBucketAttribution(ctx context.Context, in *BucketSetAttributionRequest) (*BucketSetAttributionResponse, error) + // Object + BeginObject(ctx context.Context, in *ObjectBeginRequest) (*ObjectBeginResponse, error) + CommitObject(ctx context.Context, in *ObjectCommitRequest) (*ObjectCommitResponse, error) + GetObject(ctx context.Context, in *ObjectGetRequest) (*ObjectGetResponse, error) + ListObjects(ctx context.Context, in *ObjectListRequest) (*ObjectListResponse, error) + BeginDeleteObject(ctx context.Context, in *ObjectBeginDeleteRequest) (*ObjectBeginDeleteResponse, error) + FinishDeleteObject(ctx context.Context, in *ObjectFinishDeleteRequest) (*ObjectFinishDeleteResponse, error) + BeginSegment(ctx context.Context, in *SegmentBeginRequest) (*SegmentBeginResponse, error) + CommitSegment(ctx context.Context, in *SegmentCommitRequest) (*SegmentCommitResponse, error) + MakeInlineSegment(ctx context.Context, in *SegmentMakeInlineRequest) (*SegmentMakeInlineResponse, error) + BeginDeleteSegment(ctx context.Context, in *SegmentBeginDeleteRequest) (*SegmentBeginDeleteResponse, error) + FinishDeleteSegment(ctx context.Context, in *SegmentFinishDeleteRequest) (*SegmentFinishDeleteResponse, error) + ListSegments(ctx context.Context, in *SegmentListRequest) (*SegmentListResponse, error) + DownloadSegment(ctx context.Context, in *SegmentDownloadRequest) (*SegmentDownloadResponse, error) + Batch(ctx context.Context, in *BatchRequest) (*BatchResponse, error) + CreateSegmentOld(ctx context.Context, in *SegmentWriteRequestOld) (*SegmentWriteResponseOld, error) + CommitSegmentOld(ctx context.Context, in *SegmentCommitRequestOld) (*SegmentCommitResponseOld, error) + SegmentInfoOld(ctx context.Context, in *SegmentInfoRequestOld) (*SegmentInfoResponseOld, error) + DownloadSegmentOld(ctx context.Context, in *SegmentDownloadRequestOld) (*SegmentDownloadResponseOld, error) + DeleteSegmentOld(ctx context.Context, in *SegmentDeleteRequestOld) (*SegmentDeleteResponseOld, error) + ListSegmentsOld(ctx context.Context, in *ListSegmentsRequestOld) (*ListSegmentsResponseOld, error) + SetAttributionOld(ctx context.Context, in *SetAttributionRequestOld) (*SetAttributionResponseOld, error) + ProjectInfo(ctx context.Context, in *ProjectInfoRequest) (*ProjectInfoResponse, error) +} + +type drpcMetainfoClient struct { + cc drpc.Conn +} + +func NewDRPCMetainfoClient(cc drpc.Conn) DRPCMetainfoClient { + return &drpcMetainfoClient{cc} +} + +func (c *drpcMetainfoClient) DRPCConn() drpc.Conn { return c.cc } + +func (c *drpcMetainfoClient) CreateBucket(ctx context.Context, in *BucketCreateRequest) (*BucketCreateResponse, error) { + out := new(BucketCreateResponse) + err := c.cc.Invoke(ctx, "/metainfo.Metainfo/CreateBucket", in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *drpcMetainfoClient) GetBucket(ctx context.Context, in *BucketGetRequest) (*BucketGetResponse, error) { + out := new(BucketGetResponse) + err := c.cc.Invoke(ctx, "/metainfo.Metainfo/GetBucket", in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *drpcMetainfoClient) DeleteBucket(ctx context.Context, in *BucketDeleteRequest) (*BucketDeleteResponse, error) { + out := new(BucketDeleteResponse) + err := c.cc.Invoke(ctx, "/metainfo.Metainfo/DeleteBucket", in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *drpcMetainfoClient) ListBuckets(ctx context.Context, in *BucketListRequest) (*BucketListResponse, error) { + out := new(BucketListResponse) + err := c.cc.Invoke(ctx, "/metainfo.Metainfo/ListBuckets", in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *drpcMetainfoClient) SetBucketAttribution(ctx context.Context, in *BucketSetAttributionRequest) (*BucketSetAttributionResponse, error) { + out := new(BucketSetAttributionResponse) + err := c.cc.Invoke(ctx, "/metainfo.Metainfo/SetBucketAttribution", in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *drpcMetainfoClient) BeginObject(ctx context.Context, in *ObjectBeginRequest) (*ObjectBeginResponse, error) { + out := new(ObjectBeginResponse) + err := c.cc.Invoke(ctx, "/metainfo.Metainfo/BeginObject", in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *drpcMetainfoClient) CommitObject(ctx context.Context, in *ObjectCommitRequest) (*ObjectCommitResponse, error) { + out := new(ObjectCommitResponse) + err := c.cc.Invoke(ctx, "/metainfo.Metainfo/CommitObject", in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *drpcMetainfoClient) GetObject(ctx context.Context, in *ObjectGetRequest) (*ObjectGetResponse, error) { + out := new(ObjectGetResponse) + err := c.cc.Invoke(ctx, "/metainfo.Metainfo/GetObject", in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *drpcMetainfoClient) ListObjects(ctx context.Context, in *ObjectListRequest) (*ObjectListResponse, error) { + out := new(ObjectListResponse) + err := c.cc.Invoke(ctx, "/metainfo.Metainfo/ListObjects", in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *drpcMetainfoClient) BeginDeleteObject(ctx context.Context, in *ObjectBeginDeleteRequest) (*ObjectBeginDeleteResponse, error) { + out := new(ObjectBeginDeleteResponse) + err := c.cc.Invoke(ctx, "/metainfo.Metainfo/BeginDeleteObject", in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *drpcMetainfoClient) FinishDeleteObject(ctx context.Context, in *ObjectFinishDeleteRequest) (*ObjectFinishDeleteResponse, error) { + out := new(ObjectFinishDeleteResponse) + err := c.cc.Invoke(ctx, "/metainfo.Metainfo/FinishDeleteObject", in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *drpcMetainfoClient) BeginSegment(ctx context.Context, in *SegmentBeginRequest) (*SegmentBeginResponse, error) { + out := new(SegmentBeginResponse) + err := c.cc.Invoke(ctx, "/metainfo.Metainfo/BeginSegment", in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *drpcMetainfoClient) CommitSegment(ctx context.Context, in *SegmentCommitRequest) (*SegmentCommitResponse, error) { + out := new(SegmentCommitResponse) + err := c.cc.Invoke(ctx, "/metainfo.Metainfo/CommitSegment", in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *drpcMetainfoClient) MakeInlineSegment(ctx context.Context, in *SegmentMakeInlineRequest) (*SegmentMakeInlineResponse, error) { + out := new(SegmentMakeInlineResponse) + err := c.cc.Invoke(ctx, "/metainfo.Metainfo/MakeInlineSegment", in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *drpcMetainfoClient) BeginDeleteSegment(ctx context.Context, in *SegmentBeginDeleteRequest) (*SegmentBeginDeleteResponse, error) { + out := new(SegmentBeginDeleteResponse) + err := c.cc.Invoke(ctx, "/metainfo.Metainfo/BeginDeleteSegment", in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *drpcMetainfoClient) FinishDeleteSegment(ctx context.Context, in *SegmentFinishDeleteRequest) (*SegmentFinishDeleteResponse, error) { + out := new(SegmentFinishDeleteResponse) + err := c.cc.Invoke(ctx, "/metainfo.Metainfo/FinishDeleteSegment", in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *drpcMetainfoClient) ListSegments(ctx context.Context, in *SegmentListRequest) (*SegmentListResponse, error) { + out := new(SegmentListResponse) + err := c.cc.Invoke(ctx, "/metainfo.Metainfo/ListSegments", in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *drpcMetainfoClient) DownloadSegment(ctx context.Context, in *SegmentDownloadRequest) (*SegmentDownloadResponse, error) { + out := new(SegmentDownloadResponse) + err := c.cc.Invoke(ctx, "/metainfo.Metainfo/DownloadSegment", in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *drpcMetainfoClient) Batch(ctx context.Context, in *BatchRequest) (*BatchResponse, error) { + out := new(BatchResponse) + err := c.cc.Invoke(ctx, "/metainfo.Metainfo/Batch", in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *drpcMetainfoClient) CreateSegmentOld(ctx context.Context, in *SegmentWriteRequestOld) (*SegmentWriteResponseOld, error) { + out := new(SegmentWriteResponseOld) + err := c.cc.Invoke(ctx, "/metainfo.Metainfo/CreateSegmentOld", in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *drpcMetainfoClient) CommitSegmentOld(ctx context.Context, in *SegmentCommitRequestOld) (*SegmentCommitResponseOld, error) { + out := new(SegmentCommitResponseOld) + err := c.cc.Invoke(ctx, "/metainfo.Metainfo/CommitSegmentOld", in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *drpcMetainfoClient) SegmentInfoOld(ctx context.Context, in *SegmentInfoRequestOld) (*SegmentInfoResponseOld, error) { + out := new(SegmentInfoResponseOld) + err := c.cc.Invoke(ctx, "/metainfo.Metainfo/SegmentInfoOld", in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *drpcMetainfoClient) DownloadSegmentOld(ctx context.Context, in *SegmentDownloadRequestOld) (*SegmentDownloadResponseOld, error) { + out := new(SegmentDownloadResponseOld) + err := c.cc.Invoke(ctx, "/metainfo.Metainfo/DownloadSegmentOld", in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *drpcMetainfoClient) DeleteSegmentOld(ctx context.Context, in *SegmentDeleteRequestOld) (*SegmentDeleteResponseOld, error) { + out := new(SegmentDeleteResponseOld) + err := c.cc.Invoke(ctx, "/metainfo.Metainfo/DeleteSegmentOld", in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *drpcMetainfoClient) ListSegmentsOld(ctx context.Context, in *ListSegmentsRequestOld) (*ListSegmentsResponseOld, error) { + out := new(ListSegmentsResponseOld) + err := c.cc.Invoke(ctx, "/metainfo.Metainfo/ListSegmentsOld", in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *drpcMetainfoClient) SetAttributionOld(ctx context.Context, in *SetAttributionRequestOld) (*SetAttributionResponseOld, error) { + out := new(SetAttributionResponseOld) + err := c.cc.Invoke(ctx, "/metainfo.Metainfo/SetAttributionOld", in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *drpcMetainfoClient) ProjectInfo(ctx context.Context, in *ProjectInfoRequest) (*ProjectInfoResponse, error) { + out := new(ProjectInfoResponse) + err := c.cc.Invoke(ctx, "/metainfo.Metainfo/ProjectInfo", in, out) + if err != nil { + return nil, err + } + return out, nil +} + +type DRPCMetainfoServer interface { + // Bucket + DRPCCreateBucket(context.Context, *BucketCreateRequest) (*BucketCreateResponse, error) + DRPCGetBucket(context.Context, *BucketGetRequest) (*BucketGetResponse, error) + DRPCDeleteBucket(context.Context, *BucketDeleteRequest) (*BucketDeleteResponse, error) + DRPCListBuckets(context.Context, *BucketListRequest) (*BucketListResponse, error) + DRPCSetBucketAttribution(context.Context, *BucketSetAttributionRequest) (*BucketSetAttributionResponse, error) + // Object + DRPCBeginObject(context.Context, *ObjectBeginRequest) (*ObjectBeginResponse, error) + DRPCCommitObject(context.Context, *ObjectCommitRequest) (*ObjectCommitResponse, error) + DRPCGetObject(context.Context, *ObjectGetRequest) (*ObjectGetResponse, error) + DRPCListObjects(context.Context, *ObjectListRequest) (*ObjectListResponse, error) + DRPCBeginDeleteObject(context.Context, *ObjectBeginDeleteRequest) (*ObjectBeginDeleteResponse, error) + DRPCFinishDeleteObject(context.Context, *ObjectFinishDeleteRequest) (*ObjectFinishDeleteResponse, error) + DRPCBeginSegment(context.Context, *SegmentBeginRequest) (*SegmentBeginResponse, error) + DRPCCommitSegment(context.Context, *SegmentCommitRequest) (*SegmentCommitResponse, error) + DRPCMakeInlineSegment(context.Context, *SegmentMakeInlineRequest) (*SegmentMakeInlineResponse, error) + DRPCBeginDeleteSegment(context.Context, *SegmentBeginDeleteRequest) (*SegmentBeginDeleteResponse, error) + DRPCFinishDeleteSegment(context.Context, *SegmentFinishDeleteRequest) (*SegmentFinishDeleteResponse, error) + DRPCListSegments(context.Context, *SegmentListRequest) (*SegmentListResponse, error) + DRPCDownloadSegment(context.Context, *SegmentDownloadRequest) (*SegmentDownloadResponse, error) + DRPCBatch(context.Context, *BatchRequest) (*BatchResponse, error) + DRPCCreateSegmentOld(context.Context, *SegmentWriteRequestOld) (*SegmentWriteResponseOld, error) + DRPCCommitSegmentOld(context.Context, *SegmentCommitRequestOld) (*SegmentCommitResponseOld, error) + DRPCSegmentInfoOld(context.Context, *SegmentInfoRequestOld) (*SegmentInfoResponseOld, error) + DRPCDownloadSegmentOld(context.Context, *SegmentDownloadRequestOld) (*SegmentDownloadResponseOld, error) + DRPCDeleteSegmentOld(context.Context, *SegmentDeleteRequestOld) (*SegmentDeleteResponseOld, error) + DRPCListSegmentsOld(context.Context, *ListSegmentsRequestOld) (*ListSegmentsResponseOld, error) + DRPCSetAttributionOld(context.Context, *SetAttributionRequestOld) (*SetAttributionResponseOld, error) + DRPCProjectInfo(context.Context, *ProjectInfoRequest) (*ProjectInfoResponse, error) +} + +type DRPCMetainfoDescription struct{} + +func (DRPCMetainfoDescription) NumMethods() int { return 27 } + +func (DRPCMetainfoDescription) Method(n int) (string, drpc.Handler, interface{}, bool) { + switch n { + case 0: + return "/metainfo.Metainfo/CreateBucket", + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCMetainfoServer). + DRPCCreateBucket( + ctx, + in1.(*BucketCreateRequest), + ) + }, DRPCMetainfoServer.DRPCCreateBucket, true + case 1: + return "/metainfo.Metainfo/GetBucket", + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCMetainfoServer). + DRPCGetBucket( + ctx, + in1.(*BucketGetRequest), + ) + }, DRPCMetainfoServer.DRPCGetBucket, true + case 2: + return "/metainfo.Metainfo/DeleteBucket", + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCMetainfoServer). + DRPCDeleteBucket( + ctx, + in1.(*BucketDeleteRequest), + ) + }, DRPCMetainfoServer.DRPCDeleteBucket, true + case 3: + return "/metainfo.Metainfo/ListBuckets", + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCMetainfoServer). + DRPCListBuckets( + ctx, + in1.(*BucketListRequest), + ) + }, DRPCMetainfoServer.DRPCListBuckets, true + case 4: + return "/metainfo.Metainfo/SetBucketAttribution", + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCMetainfoServer). + DRPCSetBucketAttribution( + ctx, + in1.(*BucketSetAttributionRequest), + ) + }, DRPCMetainfoServer.DRPCSetBucketAttribution, true + case 5: + return "/metainfo.Metainfo/BeginObject", + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCMetainfoServer). + DRPCBeginObject( + ctx, + in1.(*ObjectBeginRequest), + ) + }, DRPCMetainfoServer.DRPCBeginObject, true + case 6: + return "/metainfo.Metainfo/CommitObject", + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCMetainfoServer). + DRPCCommitObject( + ctx, + in1.(*ObjectCommitRequest), + ) + }, DRPCMetainfoServer.DRPCCommitObject, true + case 7: + return "/metainfo.Metainfo/GetObject", + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCMetainfoServer). + DRPCGetObject( + ctx, + in1.(*ObjectGetRequest), + ) + }, DRPCMetainfoServer.DRPCGetObject, true + case 8: + return "/metainfo.Metainfo/ListObjects", + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCMetainfoServer). + DRPCListObjects( + ctx, + in1.(*ObjectListRequest), + ) + }, DRPCMetainfoServer.DRPCListObjects, true + case 9: + return "/metainfo.Metainfo/BeginDeleteObject", + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCMetainfoServer). + DRPCBeginDeleteObject( + ctx, + in1.(*ObjectBeginDeleteRequest), + ) + }, DRPCMetainfoServer.DRPCBeginDeleteObject, true + case 10: + return "/metainfo.Metainfo/FinishDeleteObject", + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCMetainfoServer). + DRPCFinishDeleteObject( + ctx, + in1.(*ObjectFinishDeleteRequest), + ) + }, DRPCMetainfoServer.DRPCFinishDeleteObject, true + case 11: + return "/metainfo.Metainfo/BeginSegment", + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCMetainfoServer). + DRPCBeginSegment( + ctx, + in1.(*SegmentBeginRequest), + ) + }, DRPCMetainfoServer.DRPCBeginSegment, true + case 12: + return "/metainfo.Metainfo/CommitSegment", + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCMetainfoServer). + DRPCCommitSegment( + ctx, + in1.(*SegmentCommitRequest), + ) + }, DRPCMetainfoServer.DRPCCommitSegment, true + case 13: + return "/metainfo.Metainfo/MakeInlineSegment", + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCMetainfoServer). + DRPCMakeInlineSegment( + ctx, + in1.(*SegmentMakeInlineRequest), + ) + }, DRPCMetainfoServer.DRPCMakeInlineSegment, true + case 14: + return "/metainfo.Metainfo/BeginDeleteSegment", + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCMetainfoServer). + DRPCBeginDeleteSegment( + ctx, + in1.(*SegmentBeginDeleteRequest), + ) + }, DRPCMetainfoServer.DRPCBeginDeleteSegment, true + case 15: + return "/metainfo.Metainfo/FinishDeleteSegment", + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCMetainfoServer). + DRPCFinishDeleteSegment( + ctx, + in1.(*SegmentFinishDeleteRequest), + ) + }, DRPCMetainfoServer.DRPCFinishDeleteSegment, true + case 16: + return "/metainfo.Metainfo/ListSegments", + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCMetainfoServer). + DRPCListSegments( + ctx, + in1.(*SegmentListRequest), + ) + }, DRPCMetainfoServer.DRPCListSegments, true + case 17: + return "/metainfo.Metainfo/DownloadSegment", + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCMetainfoServer). + DRPCDownloadSegment( + ctx, + in1.(*SegmentDownloadRequest), + ) + }, DRPCMetainfoServer.DRPCDownloadSegment, true + case 18: + return "/metainfo.Metainfo/Batch", + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCMetainfoServer). + DRPCBatch( + ctx, + in1.(*BatchRequest), + ) + }, DRPCMetainfoServer.DRPCBatch, true + case 19: + return "/metainfo.Metainfo/CreateSegmentOld", + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCMetainfoServer). + DRPCCreateSegmentOld( + ctx, + in1.(*SegmentWriteRequestOld), + ) + }, DRPCMetainfoServer.DRPCCreateSegmentOld, true + case 20: + return "/metainfo.Metainfo/CommitSegmentOld", + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCMetainfoServer). + DRPCCommitSegmentOld( + ctx, + in1.(*SegmentCommitRequestOld), + ) + }, DRPCMetainfoServer.DRPCCommitSegmentOld, true + case 21: + return "/metainfo.Metainfo/SegmentInfoOld", + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCMetainfoServer). + DRPCSegmentInfoOld( + ctx, + in1.(*SegmentInfoRequestOld), + ) + }, DRPCMetainfoServer.DRPCSegmentInfoOld, true + case 22: + return "/metainfo.Metainfo/DownloadSegmentOld", + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCMetainfoServer). + DRPCDownloadSegmentOld( + ctx, + in1.(*SegmentDownloadRequestOld), + ) + }, DRPCMetainfoServer.DRPCDownloadSegmentOld, true + case 23: + return "/metainfo.Metainfo/DeleteSegmentOld", + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCMetainfoServer). + DRPCDeleteSegmentOld( + ctx, + in1.(*SegmentDeleteRequestOld), + ) + }, DRPCMetainfoServer.DRPCDeleteSegmentOld, true + case 24: + return "/metainfo.Metainfo/ListSegmentsOld", + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCMetainfoServer). + DRPCListSegmentsOld( + ctx, + in1.(*ListSegmentsRequestOld), + ) + }, DRPCMetainfoServer.DRPCListSegmentsOld, true + case 25: + return "/metainfo.Metainfo/SetAttributionOld", + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCMetainfoServer). + DRPCSetAttributionOld( + ctx, + in1.(*SetAttributionRequestOld), + ) + }, DRPCMetainfoServer.DRPCSetAttributionOld, true + case 26: + return "/metainfo.Metainfo/ProjectInfo", + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCMetainfoServer). + DRPCProjectInfo( + ctx, + in1.(*ProjectInfoRequest), + ) + }, DRPCMetainfoServer.DRPCProjectInfo, true + default: + return "", nil, nil, false + } +} + +type DRPCMetainfo_CreateBucketStream interface { + drpc.Stream + SendAndClose(*BucketCreateResponse) error +} + +type drpcMetainfoCreateBucketStream struct { + drpc.Stream +} + +func (x *drpcMetainfoCreateBucketStream) SendAndClose(m *BucketCreateResponse) error { + if err := x.MsgSend(m); err != nil { + return err + } + return x.CloseSend() +} + +type DRPCMetainfo_GetBucketStream interface { + drpc.Stream + SendAndClose(*BucketGetResponse) error +} + +type drpcMetainfoGetBucketStream struct { + drpc.Stream +} + +func (x *drpcMetainfoGetBucketStream) SendAndClose(m *BucketGetResponse) error { + if err := x.MsgSend(m); err != nil { + return err + } + return x.CloseSend() +} + +type DRPCMetainfo_DeleteBucketStream interface { + drpc.Stream + SendAndClose(*BucketDeleteResponse) error +} + +type drpcMetainfoDeleteBucketStream struct { + drpc.Stream +} + +func (x *drpcMetainfoDeleteBucketStream) SendAndClose(m *BucketDeleteResponse) error { + if err := x.MsgSend(m); err != nil { + return err + } + return x.CloseSend() +} + +type DRPCMetainfo_ListBucketsStream interface { + drpc.Stream + SendAndClose(*BucketListResponse) error +} + +type drpcMetainfoListBucketsStream struct { + drpc.Stream +} + +func (x *drpcMetainfoListBucketsStream) SendAndClose(m *BucketListResponse) error { + if err := x.MsgSend(m); err != nil { + return err + } + return x.CloseSend() +} + +type DRPCMetainfo_SetBucketAttributionStream interface { + drpc.Stream + SendAndClose(*BucketSetAttributionResponse) error +} + +type drpcMetainfoSetBucketAttributionStream struct { + drpc.Stream +} + +func (x *drpcMetainfoSetBucketAttributionStream) SendAndClose(m *BucketSetAttributionResponse) error { + if err := x.MsgSend(m); err != nil { + return err + } + return x.CloseSend() +} + +type DRPCMetainfo_BeginObjectStream interface { + drpc.Stream + SendAndClose(*ObjectBeginResponse) error +} + +type drpcMetainfoBeginObjectStream struct { + drpc.Stream +} + +func (x *drpcMetainfoBeginObjectStream) SendAndClose(m *ObjectBeginResponse) error { + if err := x.MsgSend(m); err != nil { + return err + } + return x.CloseSend() +} + +type DRPCMetainfo_CommitObjectStream interface { + drpc.Stream + SendAndClose(*ObjectCommitResponse) error +} + +type drpcMetainfoCommitObjectStream struct { + drpc.Stream +} + +func (x *drpcMetainfoCommitObjectStream) SendAndClose(m *ObjectCommitResponse) error { + if err := x.MsgSend(m); err != nil { + return err + } + return x.CloseSend() +} + +type DRPCMetainfo_GetObjectStream interface { + drpc.Stream + SendAndClose(*ObjectGetResponse) error +} + +type drpcMetainfoGetObjectStream struct { + drpc.Stream +} + +func (x *drpcMetainfoGetObjectStream) SendAndClose(m *ObjectGetResponse) error { + if err := x.MsgSend(m); err != nil { + return err + } + return x.CloseSend() +} + +type DRPCMetainfo_ListObjectsStream interface { + drpc.Stream + SendAndClose(*ObjectListResponse) error +} + +type drpcMetainfoListObjectsStream struct { + drpc.Stream +} + +func (x *drpcMetainfoListObjectsStream) SendAndClose(m *ObjectListResponse) error { + if err := x.MsgSend(m); err != nil { + return err + } + return x.CloseSend() +} + +type DRPCMetainfo_BeginDeleteObjectStream interface { + drpc.Stream + SendAndClose(*ObjectBeginDeleteResponse) error +} + +type drpcMetainfoBeginDeleteObjectStream struct { + drpc.Stream +} + +func (x *drpcMetainfoBeginDeleteObjectStream) SendAndClose(m *ObjectBeginDeleteResponse) error { + if err := x.MsgSend(m); err != nil { + return err + } + return x.CloseSend() +} + +type DRPCMetainfo_FinishDeleteObjectStream interface { + drpc.Stream + SendAndClose(*ObjectFinishDeleteResponse) error +} + +type drpcMetainfoFinishDeleteObjectStream struct { + drpc.Stream +} + +func (x *drpcMetainfoFinishDeleteObjectStream) SendAndClose(m *ObjectFinishDeleteResponse) error { + if err := x.MsgSend(m); err != nil { + return err + } + return x.CloseSend() +} + +type DRPCMetainfo_BeginSegmentStream interface { + drpc.Stream + SendAndClose(*SegmentBeginResponse) error +} + +type drpcMetainfoBeginSegmentStream struct { + drpc.Stream +} + +func (x *drpcMetainfoBeginSegmentStream) SendAndClose(m *SegmentBeginResponse) error { + if err := x.MsgSend(m); err != nil { + return err + } + return x.CloseSend() +} + +type DRPCMetainfo_CommitSegmentStream interface { + drpc.Stream + SendAndClose(*SegmentCommitResponse) error +} + +type drpcMetainfoCommitSegmentStream struct { + drpc.Stream +} + +func (x *drpcMetainfoCommitSegmentStream) SendAndClose(m *SegmentCommitResponse) error { + if err := x.MsgSend(m); err != nil { + return err + } + return x.CloseSend() +} + +type DRPCMetainfo_MakeInlineSegmentStream interface { + drpc.Stream + SendAndClose(*SegmentMakeInlineResponse) error +} + +type drpcMetainfoMakeInlineSegmentStream struct { + drpc.Stream +} + +func (x *drpcMetainfoMakeInlineSegmentStream) SendAndClose(m *SegmentMakeInlineResponse) error { + if err := x.MsgSend(m); err != nil { + return err + } + return x.CloseSend() +} + +type DRPCMetainfo_BeginDeleteSegmentStream interface { + drpc.Stream + SendAndClose(*SegmentBeginDeleteResponse) error +} + +type drpcMetainfoBeginDeleteSegmentStream struct { + drpc.Stream +} + +func (x *drpcMetainfoBeginDeleteSegmentStream) SendAndClose(m *SegmentBeginDeleteResponse) error { + if err := x.MsgSend(m); err != nil { + return err + } + return x.CloseSend() +} + +type DRPCMetainfo_FinishDeleteSegmentStream interface { + drpc.Stream + SendAndClose(*SegmentFinishDeleteResponse) error +} + +type drpcMetainfoFinishDeleteSegmentStream struct { + drpc.Stream +} + +func (x *drpcMetainfoFinishDeleteSegmentStream) SendAndClose(m *SegmentFinishDeleteResponse) error { + if err := x.MsgSend(m); err != nil { + return err + } + return x.CloseSend() +} + +type DRPCMetainfo_ListSegmentsStream interface { + drpc.Stream + SendAndClose(*SegmentListResponse) error +} + +type drpcMetainfoListSegmentsStream struct { + drpc.Stream +} + +func (x *drpcMetainfoListSegmentsStream) SendAndClose(m *SegmentListResponse) error { + if err := x.MsgSend(m); err != nil { + return err + } + return x.CloseSend() +} + +type DRPCMetainfo_DownloadSegmentStream interface { + drpc.Stream + SendAndClose(*SegmentDownloadResponse) error +} + +type drpcMetainfoDownloadSegmentStream struct { + drpc.Stream +} + +func (x *drpcMetainfoDownloadSegmentStream) SendAndClose(m *SegmentDownloadResponse) error { + if err := x.MsgSend(m); err != nil { + return err + } + return x.CloseSend() +} + +type DRPCMetainfo_BatchStream interface { + drpc.Stream + SendAndClose(*BatchResponse) error +} + +type drpcMetainfoBatchStream struct { + drpc.Stream +} + +func (x *drpcMetainfoBatchStream) SendAndClose(m *BatchResponse) error { + if err := x.MsgSend(m); err != nil { + return err + } + return x.CloseSend() +} + +type DRPCMetainfo_CreateSegmentOldStream interface { + drpc.Stream + SendAndClose(*SegmentWriteResponseOld) error +} + +type drpcMetainfoCreateSegmentOldStream struct { + drpc.Stream +} + +func (x *drpcMetainfoCreateSegmentOldStream) SendAndClose(m *SegmentWriteResponseOld) error { + if err := x.MsgSend(m); err != nil { + return err + } + return x.CloseSend() +} + +type DRPCMetainfo_CommitSegmentOldStream interface { + drpc.Stream + SendAndClose(*SegmentCommitResponseOld) error +} + +type drpcMetainfoCommitSegmentOldStream struct { + drpc.Stream +} + +func (x *drpcMetainfoCommitSegmentOldStream) SendAndClose(m *SegmentCommitResponseOld) error { + if err := x.MsgSend(m); err != nil { + return err + } + return x.CloseSend() +} + +type DRPCMetainfo_SegmentInfoOldStream interface { + drpc.Stream + SendAndClose(*SegmentInfoResponseOld) error +} + +type drpcMetainfoSegmentInfoOldStream struct { + drpc.Stream +} + +func (x *drpcMetainfoSegmentInfoOldStream) SendAndClose(m *SegmentInfoResponseOld) error { + if err := x.MsgSend(m); err != nil { + return err + } + return x.CloseSend() +} + +type DRPCMetainfo_DownloadSegmentOldStream interface { + drpc.Stream + SendAndClose(*SegmentDownloadResponseOld) error +} + +type drpcMetainfoDownloadSegmentOldStream struct { + drpc.Stream +} + +func (x *drpcMetainfoDownloadSegmentOldStream) SendAndClose(m *SegmentDownloadResponseOld) error { + if err := x.MsgSend(m); err != nil { + return err + } + return x.CloseSend() +} + +type DRPCMetainfo_DeleteSegmentOldStream interface { + drpc.Stream + SendAndClose(*SegmentDeleteResponseOld) error +} + +type drpcMetainfoDeleteSegmentOldStream struct { + drpc.Stream +} + +func (x *drpcMetainfoDeleteSegmentOldStream) SendAndClose(m *SegmentDeleteResponseOld) error { + if err := x.MsgSend(m); err != nil { + return err + } + return x.CloseSend() +} + +type DRPCMetainfo_ListSegmentsOldStream interface { + drpc.Stream + SendAndClose(*ListSegmentsResponseOld) error +} + +type drpcMetainfoListSegmentsOldStream struct { + drpc.Stream +} + +func (x *drpcMetainfoListSegmentsOldStream) SendAndClose(m *ListSegmentsResponseOld) error { + if err := x.MsgSend(m); err != nil { + return err + } + return x.CloseSend() +} + +type DRPCMetainfo_SetAttributionOldStream interface { + drpc.Stream + SendAndClose(*SetAttributionResponseOld) error +} + +type drpcMetainfoSetAttributionOldStream struct { + drpc.Stream +} + +func (x *drpcMetainfoSetAttributionOldStream) SendAndClose(m *SetAttributionResponseOld) error { + if err := x.MsgSend(m); err != nil { + return err + } + return x.CloseSend() +} + +type DRPCMetainfo_ProjectInfoStream interface { + drpc.Stream + SendAndClose(*ProjectInfoResponse) error +} + +type drpcMetainfoProjectInfoStream struct { + drpc.Stream +} + +func (x *drpcMetainfoProjectInfoStream) SendAndClose(m *ProjectInfoResponse) error { + if err := x.MsgSend(m); err != nil { + return err + } + return x.CloseSend() +} + // Reference imports to suppress errors if they are not otherwise used. var _ context.Context var _ grpc.ClientConn diff --git a/pkg/pb/nodestats.pb.go b/pkg/pb/nodestats.pb.go index 63604bac1..cbf70b373 100644 --- a/pkg/pb/nodestats.pb.go +++ b/pkg/pb/nodestats.pb.go @@ -11,6 +11,7 @@ import ( _ "github.com/golang/protobuf/ptypes/timestamp" grpc "google.golang.org/grpc" math "math" + drpc "storj.io/drpc" time "time" ) @@ -361,6 +362,107 @@ var fileDescriptor_e0b184ee117142aa = []byte{ 0x00, 0x00, 0xff, 0xff, 0xad, 0xd9, 0x13, 0x89, 0x80, 0x04, 0x00, 0x00, } +type DRPCNodeStatsClient interface { + DRPCConn() drpc.Conn + + GetStats(ctx context.Context, in *GetStatsRequest) (*GetStatsResponse, error) + DailyStorageUsage(ctx context.Context, in *DailyStorageUsageRequest) (*DailyStorageUsageResponse, error) +} + +type drpcNodeStatsClient struct { + cc drpc.Conn +} + +func NewDRPCNodeStatsClient(cc drpc.Conn) DRPCNodeStatsClient { + return &drpcNodeStatsClient{cc} +} + +func (c *drpcNodeStatsClient) DRPCConn() drpc.Conn { return c.cc } + +func (c *drpcNodeStatsClient) GetStats(ctx context.Context, in *GetStatsRequest) (*GetStatsResponse, error) { + out := new(GetStatsResponse) + err := c.cc.Invoke(ctx, "/nodestats.NodeStats/GetStats", in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *drpcNodeStatsClient) DailyStorageUsage(ctx context.Context, in *DailyStorageUsageRequest) (*DailyStorageUsageResponse, error) { + out := new(DailyStorageUsageResponse) + err := c.cc.Invoke(ctx, "/nodestats.NodeStats/DailyStorageUsage", in, out) + if err != nil { + return nil, err + } + return out, nil +} + +type DRPCNodeStatsServer interface { + DRPCGetStats(context.Context, *GetStatsRequest) (*GetStatsResponse, error) + DRPCDailyStorageUsage(context.Context, *DailyStorageUsageRequest) (*DailyStorageUsageResponse, error) +} + +type DRPCNodeStatsDescription struct{} + +func (DRPCNodeStatsDescription) NumMethods() int { return 2 } + +func (DRPCNodeStatsDescription) Method(n int) (string, drpc.Handler, interface{}, bool) { + switch n { + case 0: + return "/nodestats.NodeStats/GetStats", + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCNodeStatsServer). + DRPCGetStats( + ctx, + in1.(*GetStatsRequest), + ) + }, DRPCNodeStatsServer.DRPCGetStats, true + case 1: + return "/nodestats.NodeStats/DailyStorageUsage", + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCNodeStatsServer). + DRPCDailyStorageUsage( + ctx, + in1.(*DailyStorageUsageRequest), + ) + }, DRPCNodeStatsServer.DRPCDailyStorageUsage, true + default: + return "", nil, nil, false + } +} + +type DRPCNodeStats_GetStatsStream interface { + drpc.Stream + SendAndClose(*GetStatsResponse) error +} + +type drpcNodeStatsGetStatsStream struct { + drpc.Stream +} + +func (x *drpcNodeStatsGetStatsStream) SendAndClose(m *GetStatsResponse) error { + if err := x.MsgSend(m); err != nil { + return err + } + return x.CloseSend() +} + +type DRPCNodeStats_DailyStorageUsageStream interface { + drpc.Stream + SendAndClose(*DailyStorageUsageResponse) error +} + +type drpcNodeStatsDailyStorageUsageStream struct { + drpc.Stream +} + +func (x *drpcNodeStatsDailyStorageUsageStream) SendAndClose(m *DailyStorageUsageResponse) error { + if err := x.MsgSend(m); err != nil { + return err + } + return x.CloseSend() +} + // Reference imports to suppress errors if they are not otherwise used. var _ context.Context var _ grpc.ClientConn diff --git a/pkg/pb/orders.pb.go b/pkg/pb/orders.pb.go index 8ef14bb43..7182286a3 100644 --- a/pkg/pb/orders.pb.go +++ b/pkg/pb/orders.pb.go @@ -11,6 +11,7 @@ import ( _ "github.com/golang/protobuf/ptypes/timestamp" grpc "google.golang.org/grpc" math "math" + drpc "storj.io/drpc" time "time" ) @@ -716,6 +717,98 @@ var fileDescriptor_e0f5d4cf0fc9e41b = []byte{ 0x00, 0xff, 0xff, 0x87, 0x49, 0x03, 0x47, 0xfa, 0x0a, 0x00, 0x00, } +type DRPCOrdersClient interface { + DRPCConn() drpc.Conn + + Settlement(ctx context.Context) (DRPCOrders_SettlementClient, error) +} + +type drpcOrdersClient struct { + cc drpc.Conn +} + +func NewDRPCOrdersClient(cc drpc.Conn) DRPCOrdersClient { + return &drpcOrdersClient{cc} +} + +func (c *drpcOrdersClient) DRPCConn() drpc.Conn { return c.cc } + +func (c *drpcOrdersClient) Settlement(ctx context.Context) (DRPCOrders_SettlementClient, error) { + stream, err := c.cc.NewStream(ctx, "/orders.Orders/Settlement") + if err != nil { + return nil, err + } + x := &drpcOrdersSettlementClient{stream} + return x, nil +} + +type DRPCOrders_SettlementClient interface { + drpc.Stream + Send(*SettlementRequest) error + Recv() (*SettlementResponse, error) +} + +type drpcOrdersSettlementClient struct { + drpc.Stream +} + +func (x *drpcOrdersSettlementClient) Send(m *SettlementRequest) error { + return x.MsgSend(m) +} + +func (x *drpcOrdersSettlementClient) Recv() (*SettlementResponse, error) { + m := new(SettlementResponse) + if err := x.MsgRecv(m); err != nil { + return nil, err + } + return m, nil +} + +type DRPCOrdersServer interface { + DRPCSettlement(DRPCOrders_SettlementStream) error +} + +type DRPCOrdersDescription struct{} + +func (DRPCOrdersDescription) NumMethods() int { return 1 } + +func (DRPCOrdersDescription) Method(n int) (string, drpc.Handler, interface{}, bool) { + switch n { + case 0: + return "/orders.Orders/Settlement", + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return nil, srv.(DRPCOrdersServer). + DRPCSettlement( + &drpcOrdersSettlementStream{in1.(drpc.Stream)}, + ) + }, DRPCOrdersServer.DRPCSettlement, true + default: + return "", nil, nil, false + } +} + +type DRPCOrders_SettlementStream interface { + drpc.Stream + Send(*SettlementResponse) error + Recv() (*SettlementRequest, error) +} + +type drpcOrdersSettlementStream struct { + drpc.Stream +} + +func (x *drpcOrdersSettlementStream) Send(m *SettlementResponse) error { + return x.MsgSend(m) +} + +func (x *drpcOrdersSettlementStream) Recv() (*SettlementRequest, error) { + m := new(SettlementRequest) + if err := x.MsgRecv(m); err != nil { + return nil, err + } + return m, nil +} + // Reference imports to suppress errors if they are not otherwise used. var _ context.Context var _ grpc.ClientConn diff --git a/pkg/pb/overlay.pb.go b/pkg/pb/overlay.pb.go index d56ae3c58..6ac122390 100644 --- a/pkg/pb/overlay.pb.go +++ b/pkg/pb/overlay.pb.go @@ -10,6 +10,7 @@ import ( proto "github.com/gogo/protobuf/proto" grpc "google.golang.org/grpc" math "math" + drpc "storj.io/drpc" ) // Reference imports to suppress errors if they are not otherwise used. @@ -456,6 +457,143 @@ var fileDescriptor_61fc82527fbe24ad = []byte{ 0xad, 0x04, 0x05, 0x04, 0x00, 0x00, } +type DRPCNodesClient interface { + DRPCConn() drpc.Conn + + Query(ctx context.Context, in *QueryRequest) (*QueryResponse, error) + Ping(ctx context.Context, in *PingRequest) (*PingResponse, error) + RequestInfo(ctx context.Context, in *InfoRequest) (*InfoResponse, error) +} + +type drpcNodesClient struct { + cc drpc.Conn +} + +func NewDRPCNodesClient(cc drpc.Conn) DRPCNodesClient { + return &drpcNodesClient{cc} +} + +func (c *drpcNodesClient) DRPCConn() drpc.Conn { return c.cc } + +func (c *drpcNodesClient) Query(ctx context.Context, in *QueryRequest) (*QueryResponse, error) { + out := new(QueryResponse) + err := c.cc.Invoke(ctx, "/overlay.Nodes/Query", in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *drpcNodesClient) Ping(ctx context.Context, in *PingRequest) (*PingResponse, error) { + out := new(PingResponse) + err := c.cc.Invoke(ctx, "/overlay.Nodes/Ping", in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *drpcNodesClient) RequestInfo(ctx context.Context, in *InfoRequest) (*InfoResponse, error) { + out := new(InfoResponse) + err := c.cc.Invoke(ctx, "/overlay.Nodes/RequestInfo", in, out) + if err != nil { + return nil, err + } + return out, nil +} + +type DRPCNodesServer interface { + DRPCQuery(context.Context, *QueryRequest) (*QueryResponse, error) + DRPCPing(context.Context, *PingRequest) (*PingResponse, error) + DRPCRequestInfo(context.Context, *InfoRequest) (*InfoResponse, error) +} + +type DRPCNodesDescription struct{} + +func (DRPCNodesDescription) NumMethods() int { return 3 } + +func (DRPCNodesDescription) Method(n int) (string, drpc.Handler, interface{}, bool) { + switch n { + case 0: + return "/overlay.Nodes/Query", + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCNodesServer). + DRPCQuery( + ctx, + in1.(*QueryRequest), + ) + }, DRPCNodesServer.DRPCQuery, true + case 1: + return "/overlay.Nodes/Ping", + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCNodesServer). + DRPCPing( + ctx, + in1.(*PingRequest), + ) + }, DRPCNodesServer.DRPCPing, true + case 2: + return "/overlay.Nodes/RequestInfo", + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCNodesServer). + DRPCRequestInfo( + ctx, + in1.(*InfoRequest), + ) + }, DRPCNodesServer.DRPCRequestInfo, true + default: + return "", nil, nil, false + } +} + +type DRPCNodes_QueryStream interface { + drpc.Stream + SendAndClose(*QueryResponse) error +} + +type drpcNodesQueryStream struct { + drpc.Stream +} + +func (x *drpcNodesQueryStream) SendAndClose(m *QueryResponse) error { + if err := x.MsgSend(m); err != nil { + return err + } + return x.CloseSend() +} + +type DRPCNodes_PingStream interface { + drpc.Stream + SendAndClose(*PingResponse) error +} + +type drpcNodesPingStream struct { + drpc.Stream +} + +func (x *drpcNodesPingStream) SendAndClose(m *PingResponse) error { + if err := x.MsgSend(m); err != nil { + return err + } + return x.CloseSend() +} + +type DRPCNodes_RequestInfoStream interface { + drpc.Stream + SendAndClose(*InfoResponse) error +} + +type drpcNodesRequestInfoStream struct { + drpc.Stream +} + +func (x *drpcNodesRequestInfoStream) SendAndClose(m *InfoResponse) error { + if err := x.MsgSend(m); err != nil { + return err + } + return x.CloseSend() +} + // Reference imports to suppress errors if they are not otherwise used. var _ context.Context var _ grpc.ClientConn diff --git a/pkg/pb/piecestore2.pb.go b/pkg/pb/piecestore2.pb.go index 835c2d488..440e4a212 100644 --- a/pkg/pb/piecestore2.pb.go +++ b/pkg/pb/piecestore2.pb.go @@ -10,9 +10,8 @@ import ( proto "github.com/gogo/protobuf/proto" _ "github.com/golang/protobuf/ptypes/timestamp" grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" math "math" + drpc "storj.io/drpc" time "time" ) @@ -709,6 +708,239 @@ var fileDescriptor_23ff32dd550c2439 = []byte{ 0x8a, 0x5d, 0xb7, 0x8b, 0xce, 0x06, 0x00, 0x00, } +type DRPCPiecestoreClient interface { + DRPCConn() drpc.Conn + + Upload(ctx context.Context) (DRPCPiecestore_UploadClient, error) + Download(ctx context.Context) (DRPCPiecestore_DownloadClient, error) + Delete(ctx context.Context, in *PieceDeleteRequest) (*PieceDeleteResponse, error) + Retain(ctx context.Context, in *RetainRequest) (*RetainResponse, error) +} + +type drpcPiecestoreClient struct { + cc drpc.Conn +} + +func NewDRPCPiecestoreClient(cc drpc.Conn) DRPCPiecestoreClient { + return &drpcPiecestoreClient{cc} +} + +func (c *drpcPiecestoreClient) DRPCConn() drpc.Conn { return c.cc } + +func (c *drpcPiecestoreClient) Upload(ctx context.Context) (DRPCPiecestore_UploadClient, error) { + stream, err := c.cc.NewStream(ctx, "/piecestore.Piecestore/Upload") + if err != nil { + return nil, err + } + x := &drpcPiecestoreUploadClient{stream} + return x, nil +} + +type DRPCPiecestore_UploadClient interface { + drpc.Stream + Send(*PieceUploadRequest) error + CloseAndRecv() (*PieceUploadResponse, error) +} + +type drpcPiecestoreUploadClient struct { + drpc.Stream +} + +func (x *drpcPiecestoreUploadClient) Send(m *PieceUploadRequest) error { + return x.MsgSend(m) +} + +func (x *drpcPiecestoreUploadClient) CloseAndRecv() (*PieceUploadResponse, error) { + if err := x.CloseSend(); err != nil { + return nil, err + } + m := new(PieceUploadResponse) + if err := x.MsgRecv(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *drpcPiecestoreClient) Download(ctx context.Context) (DRPCPiecestore_DownloadClient, error) { + stream, err := c.cc.NewStream(ctx, "/piecestore.Piecestore/Download") + if err != nil { + return nil, err + } + x := &drpcPiecestoreDownloadClient{stream} + return x, nil +} + +type DRPCPiecestore_DownloadClient interface { + drpc.Stream + Send(*PieceDownloadRequest) error + Recv() (*PieceDownloadResponse, error) +} + +type drpcPiecestoreDownloadClient struct { + drpc.Stream +} + +func (x *drpcPiecestoreDownloadClient) Send(m *PieceDownloadRequest) error { + return x.MsgSend(m) +} + +func (x *drpcPiecestoreDownloadClient) Recv() (*PieceDownloadResponse, error) { + m := new(PieceDownloadResponse) + if err := x.MsgRecv(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *drpcPiecestoreClient) Delete(ctx context.Context, in *PieceDeleteRequest) (*PieceDeleteResponse, error) { + out := new(PieceDeleteResponse) + err := c.cc.Invoke(ctx, "/piecestore.Piecestore/Delete", in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *drpcPiecestoreClient) Retain(ctx context.Context, in *RetainRequest) (*RetainResponse, error) { + out := new(RetainResponse) + err := c.cc.Invoke(ctx, "/piecestore.Piecestore/Retain", in, out) + if err != nil { + return nil, err + } + return out, nil +} + +type DRPCPiecestoreServer interface { + DRPCUpload(DRPCPiecestore_UploadStream) error + DRPCDownload(DRPCPiecestore_DownloadStream) error + DRPCDelete(context.Context, *PieceDeleteRequest) (*PieceDeleteResponse, error) + DRPCRetain(context.Context, *RetainRequest) (*RetainResponse, error) +} + +type DRPCPiecestoreDescription struct{} + +func (DRPCPiecestoreDescription) NumMethods() int { return 4 } + +func (DRPCPiecestoreDescription) Method(n int) (string, drpc.Handler, interface{}, bool) { + switch n { + case 0: + return "/piecestore.Piecestore/Upload", + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return nil, srv.(DRPCPiecestoreServer). + DRPCUpload( + &drpcPiecestoreUploadStream{in1.(drpc.Stream)}, + ) + }, DRPCPiecestoreServer.DRPCUpload, true + case 1: + return "/piecestore.Piecestore/Download", + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return nil, srv.(DRPCPiecestoreServer). + DRPCDownload( + &drpcPiecestoreDownloadStream{in1.(drpc.Stream)}, + ) + }, DRPCPiecestoreServer.DRPCDownload, true + case 2: + return "/piecestore.Piecestore/Delete", + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCPiecestoreServer). + DRPCDelete( + ctx, + in1.(*PieceDeleteRequest), + ) + }, DRPCPiecestoreServer.DRPCDelete, true + case 3: + return "/piecestore.Piecestore/Retain", + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCPiecestoreServer). + DRPCRetain( + ctx, + in1.(*RetainRequest), + ) + }, DRPCPiecestoreServer.DRPCRetain, true + default: + return "", nil, nil, false + } +} + +type DRPCPiecestore_UploadStream interface { + drpc.Stream + SendAndClose(*PieceUploadResponse) error + Recv() (*PieceUploadRequest, error) +} + +type drpcPiecestoreUploadStream struct { + drpc.Stream +} + +func (x *drpcPiecestoreUploadStream) SendAndClose(m *PieceUploadResponse) error { + if err := x.MsgSend(m); err != nil { + return err + } + return x.CloseSend() +} + +func (x *drpcPiecestoreUploadStream) Recv() (*PieceUploadRequest, error) { + m := new(PieceUploadRequest) + if err := x.MsgRecv(m); err != nil { + return nil, err + } + return m, nil +} + +type DRPCPiecestore_DownloadStream interface { + drpc.Stream + Send(*PieceDownloadResponse) error + Recv() (*PieceDownloadRequest, error) +} + +type drpcPiecestoreDownloadStream struct { + drpc.Stream +} + +func (x *drpcPiecestoreDownloadStream) Send(m *PieceDownloadResponse) error { + return x.MsgSend(m) +} + +func (x *drpcPiecestoreDownloadStream) Recv() (*PieceDownloadRequest, error) { + m := new(PieceDownloadRequest) + if err := x.MsgRecv(m); err != nil { + return nil, err + } + return m, nil +} + +type DRPCPiecestore_DeleteStream interface { + drpc.Stream + SendAndClose(*PieceDeleteResponse) error +} + +type drpcPiecestoreDeleteStream struct { + drpc.Stream +} + +func (x *drpcPiecestoreDeleteStream) SendAndClose(m *PieceDeleteResponse) error { + if err := x.MsgSend(m); err != nil { + return err + } + return x.CloseSend() +} + +type DRPCPiecestore_RetainStream interface { + drpc.Stream + SendAndClose(*RetainResponse) error +} + +type drpcPiecestoreRetainStream struct { + drpc.Stream +} + +func (x *drpcPiecestoreRetainStream) SendAndClose(m *RetainResponse) error { + if err := x.MsgSend(m); err != nil { + return err + } + return x.CloseSend() +} + // Reference imports to suppress errors if they are not otherwise used. var _ context.Context var _ grpc.ClientConn @@ -826,23 +1058,6 @@ type PiecestoreServer interface { Retain(context.Context, *RetainRequest) (*RetainResponse, error) } -// UnimplementedPiecestoreServer can be embedded to have forward compatible implementations. -type UnimplementedPiecestoreServer struct { -} - -func (*UnimplementedPiecestoreServer) Upload(srv Piecestore_UploadServer) error { - return status.Errorf(codes.Unimplemented, "method Upload not implemented") -} -func (*UnimplementedPiecestoreServer) Download(srv Piecestore_DownloadServer) error { - return status.Errorf(codes.Unimplemented, "method Download not implemented") -} -func (*UnimplementedPiecestoreServer) Delete(ctx context.Context, req *PieceDeleteRequest) (*PieceDeleteResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented") -} -func (*UnimplementedPiecestoreServer) Retain(ctx context.Context, req *RetainRequest) (*RetainResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Retain not implemented") -} - func RegisterPiecestoreServer(s *grpc.Server, srv PiecestoreServer) { s.RegisterService(&_Piecestore_serviceDesc, srv) } diff --git a/pkg/pb/vouchers.pb.go b/pkg/pb/vouchers.pb.go index 94341d481..c2ffed0e2 100644 --- a/pkg/pb/vouchers.pb.go +++ b/pkg/pb/vouchers.pb.go @@ -11,6 +11,7 @@ import ( _ "github.com/golang/protobuf/ptypes/timestamp" grpc "google.golang.org/grpc" math "math" + drpc "storj.io/drpc" time "time" ) @@ -215,6 +216,71 @@ var fileDescriptor_3659b9a115b8060d = []byte{ 0xdd, 0x67, 0x9f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xf1, 0x1f, 0x45, 0xc2, 0x51, 0x02, 0x00, 0x00, } +type DRPCVouchersClient interface { + DRPCConn() drpc.Conn + + Request(ctx context.Context, in *VoucherRequest) (*VoucherResponse, error) +} + +type drpcVouchersClient struct { + cc drpc.Conn +} + +func NewDRPCVouchersClient(cc drpc.Conn) DRPCVouchersClient { + return &drpcVouchersClient{cc} +} + +func (c *drpcVouchersClient) DRPCConn() drpc.Conn { return c.cc } + +func (c *drpcVouchersClient) Request(ctx context.Context, in *VoucherRequest) (*VoucherResponse, error) { + out := new(VoucherResponse) + err := c.cc.Invoke(ctx, "/vouchers.Vouchers/Request", in, out) + if err != nil { + return nil, err + } + return out, nil +} + +type DRPCVouchersServer interface { + DRPCRequest(context.Context, *VoucherRequest) (*VoucherResponse, error) +} + +type DRPCVouchersDescription struct{} + +func (DRPCVouchersDescription) NumMethods() int { return 1 } + +func (DRPCVouchersDescription) Method(n int) (string, drpc.Handler, interface{}, bool) { + switch n { + case 0: + return "/vouchers.Vouchers/Request", + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCVouchersServer). + DRPCRequest( + ctx, + in1.(*VoucherRequest), + ) + }, DRPCVouchersServer.DRPCRequest, true + default: + return "", nil, nil, false + } +} + +type DRPCVouchers_RequestStream interface { + drpc.Stream + SendAndClose(*VoucherResponse) error +} + +type drpcVouchersRequestStream struct { + drpc.Stream +} + +func (x *drpcVouchersRequestStream) SendAndClose(m *VoucherResponse) error { + if err := x.MsgSend(m); err != nil { + return err + } + return x.CloseSend() +} + // Reference imports to suppress errors if they are not otherwise used. var _ context.Context var _ grpc.ClientConn diff --git a/scripts/protobuf.go b/scripts/protobuf.go index 604ed494d..fb478ec1f 100644 --- a/scripts/protobuf.go +++ b/scripts/protobuf.go @@ -55,18 +55,12 @@ func run(command, root string) error { if err != nil { return err } - - gogoVersion, err := versionOf("github.com/gogo/protobuf") - if err != nil { - return err - } - return install( "github.com/ckaznocha/protoc-gen-lint@68a05858965b31eb872cbeb8d027507a94011acc", - // See https://github.com/gogo/protobuf#most-speed-and-most-customization - "github.com/gogo/protobuf/protoc-gen-gogo@"+gogoVersion, + "storj.io/drpc/cmd/protoc-gen-drpc@v0.0.1", "github.com/nilslice/protolock/cmd/protolock@v0.12.0", ) + case "generate": return walkdirs(root, generate) case "lint": @@ -76,8 +70,6 @@ func run(command, root string) error { default: return errors.New("unknown command " + command) } - - return nil } func installGoBin() error { @@ -141,7 +133,7 @@ func generate(dir string, dirs []string, files []string) error { return err } - args := []string{"--gogo_out=plugins=grpc:.", "--lint_out=."} + args := []string{"--drpc_out=plugins=grpc+drpc:.", "--lint_out=."} args = appendCommonArguments(args, dir, dirs, files) cmd = exec.Command(*protoc, args...)