use-drpc: use protoc-gen-drpc to generate protobufs

Change-Id: I5c23256068e30864022dba5137c499796ab9d6ad
This commit is contained in:
Jeff Wendling 2019-09-04 17:05:51 -06:00
parent fb10815229
commit 60eba990eb
12 changed files with 2525 additions and 34 deletions

3
go.mod
View File

@ -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
)

9
go.sum
View File

@ -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=

View File

@ -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

View File

@ -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

View File

@ -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

File diff suppressed because it is too large Load Diff

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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)
}

View File

@ -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

View File

@ -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...)