mod: update drpc to v0.0.19

Change-Id: Ia2e0e0a371368700c596ce89e24748ea4b5c016a
This commit is contained in:
Egon Elbre 2021-03-23 12:41:41 +02:00
parent 50b08a5b00
commit 54c2ace483
15 changed files with 1369 additions and 1119 deletions

9
go.mod
View File

@ -35,19 +35,18 @@ require (
github.com/stretchr/testify v1.7.0
github.com/stripe/stripe-go v70.15.0+incompatible
github.com/vivint/infectious v0.0.0-20200605153912-25a574ae18a3
github.com/zeebo/assert v1.1.0
github.com/zeebo/assert v1.3.0
github.com/zeebo/errs v1.2.2
go.etcd.io/bbolt v1.3.5
go.uber.org/zap v1.16.0
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221
golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e
google.golang.org/api v0.20.0 // indirect
google.golang.org/protobuf v1.25.0 // indirect
storj.io/common v0.0.0-20210315162710-05d54340fb1e
storj.io/drpc v0.0.16
storj.io/common v0.0.0-20210323150557-ed9a63c60e36
storj.io/drpc v0.0.19
storj.io/monkit-jaeger v0.0.0-20210225162224-66fb37637bf6
storj.io/private v0.0.0-20210203200143-9d2ec06f0d3c
storj.io/uplink v1.4.6-0.20210212112107-f7f8a3c8321a

15
go.sum
View File

@ -539,7 +539,6 @@ github.com/spacemonkeygo/monkit/v3 v3.0.4/go.mod h1:JcK1pCbReQsOsMKF/POFSZCq7drX
github.com/spacemonkeygo/monkit/v3 v3.0.5/go.mod h1:JcK1pCbReQsOsMKF/POFSZCq7drXFybgGmbc27tuwes=
github.com/spacemonkeygo/monkit/v3 v3.0.7-0.20200515175308-072401d8c752/go.mod h1:kj1ViJhlyADa7DiA4xVnTuPA46lFKbM7mxQTrXCuJP4=
github.com/spacemonkeygo/monkit/v3 v3.0.7/go.mod h1:kj1ViJhlyADa7DiA4xVnTuPA46lFKbM7mxQTrXCuJP4=
github.com/spacemonkeygo/monkit/v3 v3.0.9/go.mod h1:kj1ViJhlyADa7DiA4xVnTuPA46lFKbM7mxQTrXCuJP4=
github.com/spacemonkeygo/monkit/v3 v3.0.10 h1:jJPiF4EdetQAHAyHyX0wYIv9c/Vl0oN3KJKtnakfR+A=
github.com/spacemonkeygo/monkit/v3 v3.0.10/go.mod h1:kj1ViJhlyADa7DiA4xVnTuPA46lFKbM7mxQTrXCuJP4=
github.com/spacemonkeygo/monotime v0.0.0-20180824235756-e3f48a95f98a/go.mod h1:ul4bvvnCOPZgq8w0nTkSmWVg/hauVpFS97Am1YM1XXo=
@ -597,8 +596,9 @@ github.com/zeebo/admission/v3 v3.0.1/go.mod h1:BP3isIv9qa2A7ugEratNq1dnl2oZRXaQU
github.com/zeebo/admission/v3 v3.0.2 h1:nI9rBKR97NS42JZ1o0Ki2NsF5DRq+7udnbVXYt3tRPI=
github.com/zeebo/admission/v3 v3.0.2/go.mod h1:BP3isIv9qa2A7ugEratNq1dnl2oZRXaQUGdU7WXKtbw=
github.com/zeebo/assert v0.0.0-20181109011804-10f827ce2ed6/go.mod h1:yssERNPivllc1yU3BvpjYI5BUW+zglcz6QWqeVRL5t0=
github.com/zeebo/assert v1.1.0 h1:hU1L1vLTHsnO8x8c9KAR5GmM5QscxHg5RNU5z5qbUWY=
github.com/zeebo/assert v1.1.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0=
github.com/zeebo/assert v1.3.0 h1:g7C04CbJuIDKNPFHmsk4hwZDO5O+kntRxzaUoNXj+IQ=
github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0=
github.com/zeebo/errs v1.1.1/go.mod h1:Yj8dHrUQwls1bF3dr/vcSIu+qf4mI7idnTcHfoACc6I=
github.com/zeebo/errs v1.2.2 h1:5NFypMTuSdoySVTqlNs1dEoU21QVamMQJxW/Fii5O7g=
github.com/zeebo/errs v1.2.2/go.mod h1:sgbWHsvVuTPHcqJJGQ1WhI5KbWlHYz+2+2C/LSEtCw4=
@ -743,8 +743,9 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs=
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@ -941,12 +942,14 @@ sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3
storj.io/common v0.0.0-20200424175742-65ac59022f4f/go.mod h1:pZyXiIE7bGETIRXtfs0nICqMwp7PM8HqnDuyUeldNA0=
storj.io/common v0.0.0-20201026135900-1aaeec90670b/go.mod h1:GqdmNf3fLm2UZX/7Zr0BLFCJ4gFjgm6eHrk/fnmr5jQ=
storj.io/common v0.0.0-20210208122718-577b1f8a0a0f/go.mod h1:b8XP/TdW8OyTZ/J2BDFOIE9KojSUNZgImBFZI99zS04=
storj.io/common v0.0.0-20210315162710-05d54340fb1e h1:F3hJhxnIqwWUURYsF/rTZiy4DGxpNdjOmPD6bdxWdGM=
storj.io/common v0.0.0-20210315162710-05d54340fb1e/go.mod h1:OAPn3OXJBq4omkIlWSrTsLa6hm4FnaLs12Odn/ksQL4=
storj.io/common v0.0.0-20210323150557-ed9a63c60e36 h1:rcBAaunnHWrNo1kmgnh5psZUQATYVppkPmpWkSA3y+I=
storj.io/common v0.0.0-20210323150557-ed9a63c60e36/go.mod h1:paL4AeCebM8mZ2CjHshCUZjCRNaj8MWZ7ubcB+pQa5s=
storj.io/drpc v0.0.11/go.mod h1:TiFc2obNjL9/3isMW1Rpxjy8V9uE0B2HMeMFGiiI7Iw=
storj.io/drpc v0.0.14/go.mod h1:82nfl+6YwRwF6UG31cEWWUqv/FaKvP5SGqUvoqTxCMA=
storj.io/drpc v0.0.16 h1:9sxypc5lKi/0D69cR21BR0S21+IvXfON8L5nXMVNTwQ=
storj.io/drpc v0.0.16/go.mod h1:zdmQ93nx4Z35u11pQ+GAnBy4DGOK3HJCSOfeh2RryTo=
storj.io/drpc v0.0.18/go.mod h1:eAxUDk8HWvGl9iqznpuphtZ+WIjIGPJFqNXuKHgRiMM=
storj.io/drpc v0.0.19 h1:Z7wzmKwfBmGg06z9oW2/s4AyzFafIwok8uvBU/15K1o=
storj.io/drpc v0.0.19/go.mod h1:eAxUDk8HWvGl9iqznpuphtZ+WIjIGPJFqNXuKHgRiMM=
storj.io/monkit-jaeger v0.0.0-20200518165323-80778fc3f91b/go.mod h1:gj4vuCeyCRjRmH8LIrgoyU9Dc9uR6H+/GcDUXmTbf80=
storj.io/monkit-jaeger v0.0.0-20210225162224-66fb37637bf6 h1:LTDmeZDrFWD9byqNOf/Bc1VmMNKvja/9Cs52d1V5aTk=
storj.io/monkit-jaeger v0.0.0-20210225162224-66fb37637bf6/go.mod h1:gj4vuCeyCRjRmH8LIrgoyU9Dc9uR6H+/GcDUXmTbf80=

View File

@ -66,7 +66,8 @@ func main() {
overrideImports := ",Mgoogle/protobuf/timestamp.proto=" + *mainpkg
args := []string{
"--lint_out=.",
"--drpc_out=plugins=drpc,paths=source_relative" + overrideImports + ":.",
"--gogo_out=paths=source_relative" + overrideImports + ":.",
"--go-drpc_out=protolib=github.com/gogo/protobuf,paths=source_relative:.",
"-I=.",
}
args = append(args, protofiles...)

View File

@ -4,14 +4,11 @@
package multinodepb
import (
context "context"
fmt "fmt"
math "math"
time "time"
proto "github.com/gogo/protobuf/proto"
drpc "storj.io/drpc"
)
// Reference imports to suppress errors if they are not otherwise used.
@ -968,427 +965,3 @@ var fileDescriptor_9a45fd79b06f3a1b = []byte{
0xfc, 0xe8, 0xc6, 0x49, 0x70, 0x49, 0x05, 0x76, 0x0b, 0xf7, 0xf8, 0xfc, 0xdc, 0x94, 0xbf, 0xc2,
0x87, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0xdd, 0x3f, 0xac, 0xd3, 0x03, 0x0a, 0x00, 0x00,
}
// --- DRPC BEGIN ---
type DRPCStorageClient interface {
DRPCConn() drpc.Conn
DiskSpace(ctx context.Context, in *DiskSpaceRequest) (*DiskSpaceResponse, error)
}
type drpcStorageClient struct {
cc drpc.Conn
}
func NewDRPCStorageClient(cc drpc.Conn) DRPCStorageClient {
return &drpcStorageClient{cc}
}
func (c *drpcStorageClient) DRPCConn() drpc.Conn { return c.cc }
func (c *drpcStorageClient) DiskSpace(ctx context.Context, in *DiskSpaceRequest) (*DiskSpaceResponse, error) {
out := new(DiskSpaceResponse)
err := c.cc.Invoke(ctx, "/multinode.Storage/DiskSpace", in, out)
if err != nil {
return nil, err
}
return out, nil
}
type DRPCStorageServer interface {
DiskSpace(context.Context, *DiskSpaceRequest) (*DiskSpaceResponse, error)
}
type DRPCStorageDescription struct{}
func (DRPCStorageDescription) NumMethods() int { return 1 }
func (DRPCStorageDescription) Method(n int) (string, drpc.Receiver, interface{}, bool) {
switch n {
case 0:
return "/multinode.Storage/DiskSpace",
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCStorageServer).
DiskSpace(
ctx,
in1.(*DiskSpaceRequest),
)
}, DRPCStorageServer.DiskSpace, true
default:
return "", nil, nil, false
}
}
func DRPCRegisterStorage(mux drpc.Mux, impl DRPCStorageServer) error {
return mux.Register(impl, DRPCStorageDescription{})
}
type DRPCStorage_DiskSpaceStream interface {
drpc.Stream
SendAndClose(*DiskSpaceResponse) error
}
type drpcStorageDiskSpaceStream struct {
drpc.Stream
}
func (x *drpcStorageDiskSpaceStream) SendAndClose(m *DiskSpaceResponse) error {
if err := x.MsgSend(m); err != nil {
return err
}
return x.CloseSend()
}
type DRPCBandwidthClient interface {
DRPCConn() drpc.Conn
MonthSummary(ctx context.Context, in *BandwidthMonthSummaryRequest) (*BandwidthMonthSummaryResponse, error)
}
type drpcBandwidthClient struct {
cc drpc.Conn
}
func NewDRPCBandwidthClient(cc drpc.Conn) DRPCBandwidthClient {
return &drpcBandwidthClient{cc}
}
func (c *drpcBandwidthClient) DRPCConn() drpc.Conn { return c.cc }
func (c *drpcBandwidthClient) MonthSummary(ctx context.Context, in *BandwidthMonthSummaryRequest) (*BandwidthMonthSummaryResponse, error) {
out := new(BandwidthMonthSummaryResponse)
err := c.cc.Invoke(ctx, "/multinode.Bandwidth/MonthSummary", in, out)
if err != nil {
return nil, err
}
return out, nil
}
type DRPCBandwidthServer interface {
MonthSummary(context.Context, *BandwidthMonthSummaryRequest) (*BandwidthMonthSummaryResponse, error)
}
type DRPCBandwidthDescription struct{}
func (DRPCBandwidthDescription) NumMethods() int { return 1 }
func (DRPCBandwidthDescription) Method(n int) (string, drpc.Receiver, interface{}, bool) {
switch n {
case 0:
return "/multinode.Bandwidth/MonthSummary",
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCBandwidthServer).
MonthSummary(
ctx,
in1.(*BandwidthMonthSummaryRequest),
)
}, DRPCBandwidthServer.MonthSummary, true
default:
return "", nil, nil, false
}
}
func DRPCRegisterBandwidth(mux drpc.Mux, impl DRPCBandwidthServer) error {
return mux.Register(impl, DRPCBandwidthDescription{})
}
type DRPCBandwidth_MonthSummaryStream interface {
drpc.Stream
SendAndClose(*BandwidthMonthSummaryResponse) error
}
type drpcBandwidthMonthSummaryStream struct {
drpc.Stream
}
func (x *drpcBandwidthMonthSummaryStream) SendAndClose(m *BandwidthMonthSummaryResponse) error {
if err := x.MsgSend(m); err != nil {
return err
}
return x.CloseSend()
}
type DRPCNodeClient interface {
DRPCConn() drpc.Conn
Version(ctx context.Context, in *VersionRequest) (*VersionResponse, error)
LastContact(ctx context.Context, in *LastContactRequest) (*LastContactResponse, error)
Reputation(ctx context.Context, in *ReputationRequest) (*ReputationResponse, error)
TrustedSatellites(ctx context.Context, in *TrustedSatellitesRequest) (*TrustedSatellitesResponse, 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) Version(ctx context.Context, in *VersionRequest) (*VersionResponse, error) {
out := new(VersionResponse)
err := c.cc.Invoke(ctx, "/multinode.Node/Version", in, out)
if err != nil {
return nil, err
}
return out, nil
}
func (c *drpcNodeClient) LastContact(ctx context.Context, in *LastContactRequest) (*LastContactResponse, error) {
out := new(LastContactResponse)
err := c.cc.Invoke(ctx, "/multinode.Node/LastContact", in, out)
if err != nil {
return nil, err
}
return out, nil
}
func (c *drpcNodeClient) Reputation(ctx context.Context, in *ReputationRequest) (*ReputationResponse, error) {
out := new(ReputationResponse)
err := c.cc.Invoke(ctx, "/multinode.Node/Reputation", in, out)
if err != nil {
return nil, err
}
return out, nil
}
func (c *drpcNodeClient) TrustedSatellites(ctx context.Context, in *TrustedSatellitesRequest) (*TrustedSatellitesResponse, error) {
out := new(TrustedSatellitesResponse)
err := c.cc.Invoke(ctx, "/multinode.Node/TrustedSatellites", in, out)
if err != nil {
return nil, err
}
return out, nil
}
type DRPCNodeServer interface {
Version(context.Context, *VersionRequest) (*VersionResponse, error)
LastContact(context.Context, *LastContactRequest) (*LastContactResponse, error)
Reputation(context.Context, *ReputationRequest) (*ReputationResponse, error)
TrustedSatellites(context.Context, *TrustedSatellitesRequest) (*TrustedSatellitesResponse, error)
}
type DRPCNodeDescription struct{}
func (DRPCNodeDescription) NumMethods() int { return 4 }
func (DRPCNodeDescription) Method(n int) (string, drpc.Receiver, interface{}, bool) {
switch n {
case 0:
return "/multinode.Node/Version",
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCNodeServer).
Version(
ctx,
in1.(*VersionRequest),
)
}, DRPCNodeServer.Version, true
case 1:
return "/multinode.Node/LastContact",
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCNodeServer).
LastContact(
ctx,
in1.(*LastContactRequest),
)
}, DRPCNodeServer.LastContact, true
case 2:
return "/multinode.Node/Reputation",
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCNodeServer).
Reputation(
ctx,
in1.(*ReputationRequest),
)
}, DRPCNodeServer.Reputation, true
case 3:
return "/multinode.Node/TrustedSatellites",
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCNodeServer).
TrustedSatellites(
ctx,
in1.(*TrustedSatellitesRequest),
)
}, DRPCNodeServer.TrustedSatellites, true
default:
return "", nil, nil, false
}
}
func DRPCRegisterNode(mux drpc.Mux, impl DRPCNodeServer) error {
return mux.Register(impl, DRPCNodeDescription{})
}
type DRPCNode_VersionStream interface {
drpc.Stream
SendAndClose(*VersionResponse) error
}
type drpcNodeVersionStream struct {
drpc.Stream
}
func (x *drpcNodeVersionStream) SendAndClose(m *VersionResponse) error {
if err := x.MsgSend(m); err != nil {
return err
}
return x.CloseSend()
}
type DRPCNode_LastContactStream interface {
drpc.Stream
SendAndClose(*LastContactResponse) error
}
type drpcNodeLastContactStream struct {
drpc.Stream
}
func (x *drpcNodeLastContactStream) SendAndClose(m *LastContactResponse) error {
if err := x.MsgSend(m); err != nil {
return err
}
return x.CloseSend()
}
type DRPCNode_ReputationStream interface {
drpc.Stream
SendAndClose(*ReputationResponse) error
}
type drpcNodeReputationStream struct {
drpc.Stream
}
func (x *drpcNodeReputationStream) SendAndClose(m *ReputationResponse) error {
if err := x.MsgSend(m); err != nil {
return err
}
return x.CloseSend()
}
type DRPCNode_TrustedSatellitesStream interface {
drpc.Stream
SendAndClose(*TrustedSatellitesResponse) error
}
type drpcNodeTrustedSatellitesStream struct {
drpc.Stream
}
func (x *drpcNodeTrustedSatellitesStream) SendAndClose(m *TrustedSatellitesResponse) error {
if err := x.MsgSend(m); err != nil {
return err
}
return x.CloseSend()
}
type DRPCPayoutClient interface {
DRPCConn() drpc.Conn
Earned(ctx context.Context, in *EarnedRequest) (*EarnedResponse, error)
EarnedPerSatellite(ctx context.Context, in *EarnedPerSatelliteRequest) (*EarnedPerSatelliteResponse, error)
}
type drpcPayoutClient struct {
cc drpc.Conn
}
func NewDRPCPayoutClient(cc drpc.Conn) DRPCPayoutClient {
return &drpcPayoutClient{cc}
}
func (c *drpcPayoutClient) DRPCConn() drpc.Conn { return c.cc }
func (c *drpcPayoutClient) Earned(ctx context.Context, in *EarnedRequest) (*EarnedResponse, error) {
out := new(EarnedResponse)
err := c.cc.Invoke(ctx, "/multinode.Payout/Earned", in, out)
if err != nil {
return nil, err
}
return out, nil
}
func (c *drpcPayoutClient) EarnedPerSatellite(ctx context.Context, in *EarnedPerSatelliteRequest) (*EarnedPerSatelliteResponse, error) {
out := new(EarnedPerSatelliteResponse)
err := c.cc.Invoke(ctx, "/multinode.Payout/EarnedPerSatellite", in, out)
if err != nil {
return nil, err
}
return out, nil
}
type DRPCPayoutServer interface {
Earned(context.Context, *EarnedRequest) (*EarnedResponse, error)
EarnedPerSatellite(context.Context, *EarnedPerSatelliteRequest) (*EarnedPerSatelliteResponse, error)
}
type DRPCPayoutDescription struct{}
func (DRPCPayoutDescription) NumMethods() int { return 2 }
func (DRPCPayoutDescription) Method(n int) (string, drpc.Receiver, interface{}, bool) {
switch n {
case 0:
return "/multinode.Payout/Earned",
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCPayoutServer).
Earned(
ctx,
in1.(*EarnedRequest),
)
}, DRPCPayoutServer.Earned, true
case 1:
return "/multinode.Payout/EarnedPerSatellite",
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCPayoutServer).
EarnedPerSatellite(
ctx,
in1.(*EarnedPerSatelliteRequest),
)
}, DRPCPayoutServer.EarnedPerSatellite, true
default:
return "", nil, nil, false
}
}
func DRPCRegisterPayout(mux drpc.Mux, impl DRPCPayoutServer) error {
return mux.Register(impl, DRPCPayoutDescription{})
}
type DRPCPayout_EarnedStream interface {
drpc.Stream
SendAndClose(*EarnedResponse) error
}
type drpcPayoutEarnedStream struct {
drpc.Stream
}
func (x *drpcPayoutEarnedStream) SendAndClose(m *EarnedResponse) error {
if err := x.MsgSend(m); err != nil {
return err
}
return x.CloseSend()
}
type DRPCPayout_EarnedPerSatelliteStream interface {
drpc.Stream
SendAndClose(*EarnedPerSatelliteResponse) error
}
type drpcPayoutEarnedPerSatelliteStream struct {
drpc.Stream
}
func (x *drpcPayoutEarnedPerSatelliteStream) SendAndClose(m *EarnedPerSatelliteResponse) error {
if err := x.MsgSend(m); err != nil {
return err
}
return x.CloseSend()
}
// --- DRPC END ---

View File

@ -0,0 +1,500 @@
// Code generated by protoc-gen-go-drpc. DO NOT EDIT.
// protoc-gen-go-drpc version: v0.0.19
// source: multinode.proto
package multinodepb
import (
bytes "bytes"
context "context"
errors "errors"
jsonpb "github.com/gogo/protobuf/jsonpb"
proto "github.com/gogo/protobuf/proto"
drpc "storj.io/drpc"
drpcerr "storj.io/drpc/drpcerr"
)
type drpcEncoding_File_multinode_proto struct{}
func (drpcEncoding_File_multinode_proto) Marshal(msg drpc.Message) ([]byte, error) {
return proto.Marshal(msg.(proto.Message))
}
func (drpcEncoding_File_multinode_proto) Unmarshal(buf []byte, msg drpc.Message) error {
return proto.Unmarshal(buf, msg.(proto.Message))
}
func (drpcEncoding_File_multinode_proto) JSONMarshal(msg drpc.Message) ([]byte, error) {
var buf bytes.Buffer
err := new(jsonpb.Marshaler).Marshal(&buf, msg.(proto.Message))
if err != nil {
return nil, err
}
return buf.Bytes(), nil
}
func (drpcEncoding_File_multinode_proto) JSONUnmarshal(buf []byte, msg drpc.Message) error {
return jsonpb.Unmarshal(bytes.NewReader(buf), msg.(proto.Message))
}
type DRPCStorageClient interface {
DRPCConn() drpc.Conn
DiskSpace(ctx context.Context, in *DiskSpaceRequest) (*DiskSpaceResponse, error)
}
type drpcStorageClient struct {
cc drpc.Conn
}
func NewDRPCStorageClient(cc drpc.Conn) DRPCStorageClient {
return &drpcStorageClient{cc}
}
func (c *drpcStorageClient) DRPCConn() drpc.Conn { return c.cc }
func (c *drpcStorageClient) DiskSpace(ctx context.Context, in *DiskSpaceRequest) (*DiskSpaceResponse, error) {
out := new(DiskSpaceResponse)
err := c.cc.Invoke(ctx, "/multinode.Storage/DiskSpace", drpcEncoding_File_multinode_proto{}, in, out)
if err != nil {
return nil, err
}
return out, nil
}
type DRPCStorageServer interface {
DiskSpace(context.Context, *DiskSpaceRequest) (*DiskSpaceResponse, error)
}
type DRPCStorageUnimplementedServer struct{}
func (s *DRPCStorageUnimplementedServer) DiskSpace(context.Context, *DiskSpaceRequest) (*DiskSpaceResponse, error) {
return nil, drpcerr.WithCode(errors.New("Unimplemented"), 12)
}
type DRPCStorageDescription struct{}
func (DRPCStorageDescription) NumMethods() int { return 1 }
func (DRPCStorageDescription) Method(n int) (string, drpc.Encoding, drpc.Receiver, interface{}, bool) {
switch n {
case 0:
return "/multinode.Storage/DiskSpace", drpcEncoding_File_multinode_proto{},
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCStorageServer).
DiskSpace(
ctx,
in1.(*DiskSpaceRequest),
)
}, DRPCStorageServer.DiskSpace, true
default:
return "", nil, nil, nil, false
}
}
func DRPCRegisterStorage(mux drpc.Mux, impl DRPCStorageServer) error {
return mux.Register(impl, DRPCStorageDescription{})
}
type DRPCStorage_DiskSpaceStream interface {
drpc.Stream
SendAndClose(*DiskSpaceResponse) error
}
type drpcStorage_DiskSpaceStream struct {
drpc.Stream
}
func (x *drpcStorage_DiskSpaceStream) SendAndClose(m *DiskSpaceResponse) error {
if err := x.MsgSend(m, drpcEncoding_File_multinode_proto{}); err != nil {
return err
}
return x.CloseSend()
}
type DRPCBandwidthClient interface {
DRPCConn() drpc.Conn
MonthSummary(ctx context.Context, in *BandwidthMonthSummaryRequest) (*BandwidthMonthSummaryResponse, error)
}
type drpcBandwidthClient struct {
cc drpc.Conn
}
func NewDRPCBandwidthClient(cc drpc.Conn) DRPCBandwidthClient {
return &drpcBandwidthClient{cc}
}
func (c *drpcBandwidthClient) DRPCConn() drpc.Conn { return c.cc }
func (c *drpcBandwidthClient) MonthSummary(ctx context.Context, in *BandwidthMonthSummaryRequest) (*BandwidthMonthSummaryResponse, error) {
out := new(BandwidthMonthSummaryResponse)
err := c.cc.Invoke(ctx, "/multinode.Bandwidth/MonthSummary", drpcEncoding_File_multinode_proto{}, in, out)
if err != nil {
return nil, err
}
return out, nil
}
type DRPCBandwidthServer interface {
MonthSummary(context.Context, *BandwidthMonthSummaryRequest) (*BandwidthMonthSummaryResponse, error)
}
type DRPCBandwidthUnimplementedServer struct{}
func (s *DRPCBandwidthUnimplementedServer) MonthSummary(context.Context, *BandwidthMonthSummaryRequest) (*BandwidthMonthSummaryResponse, error) {
return nil, drpcerr.WithCode(errors.New("Unimplemented"), 12)
}
type DRPCBandwidthDescription struct{}
func (DRPCBandwidthDescription) NumMethods() int { return 1 }
func (DRPCBandwidthDescription) Method(n int) (string, drpc.Encoding, drpc.Receiver, interface{}, bool) {
switch n {
case 0:
return "/multinode.Bandwidth/MonthSummary", drpcEncoding_File_multinode_proto{},
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCBandwidthServer).
MonthSummary(
ctx,
in1.(*BandwidthMonthSummaryRequest),
)
}, DRPCBandwidthServer.MonthSummary, true
default:
return "", nil, nil, nil, false
}
}
func DRPCRegisterBandwidth(mux drpc.Mux, impl DRPCBandwidthServer) error {
return mux.Register(impl, DRPCBandwidthDescription{})
}
type DRPCBandwidth_MonthSummaryStream interface {
drpc.Stream
SendAndClose(*BandwidthMonthSummaryResponse) error
}
type drpcBandwidth_MonthSummaryStream struct {
drpc.Stream
}
func (x *drpcBandwidth_MonthSummaryStream) SendAndClose(m *BandwidthMonthSummaryResponse) error {
if err := x.MsgSend(m, drpcEncoding_File_multinode_proto{}); err != nil {
return err
}
return x.CloseSend()
}
type DRPCNodeClient interface {
DRPCConn() drpc.Conn
Version(ctx context.Context, in *VersionRequest) (*VersionResponse, error)
LastContact(ctx context.Context, in *LastContactRequest) (*LastContactResponse, error)
Reputation(ctx context.Context, in *ReputationRequest) (*ReputationResponse, error)
TrustedSatellites(ctx context.Context, in *TrustedSatellitesRequest) (*TrustedSatellitesResponse, 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) Version(ctx context.Context, in *VersionRequest) (*VersionResponse, error) {
out := new(VersionResponse)
err := c.cc.Invoke(ctx, "/multinode.Node/Version", drpcEncoding_File_multinode_proto{}, in, out)
if err != nil {
return nil, err
}
return out, nil
}
func (c *drpcNodeClient) LastContact(ctx context.Context, in *LastContactRequest) (*LastContactResponse, error) {
out := new(LastContactResponse)
err := c.cc.Invoke(ctx, "/multinode.Node/LastContact", drpcEncoding_File_multinode_proto{}, in, out)
if err != nil {
return nil, err
}
return out, nil
}
func (c *drpcNodeClient) Reputation(ctx context.Context, in *ReputationRequest) (*ReputationResponse, error) {
out := new(ReputationResponse)
err := c.cc.Invoke(ctx, "/multinode.Node/Reputation", drpcEncoding_File_multinode_proto{}, in, out)
if err != nil {
return nil, err
}
return out, nil
}
func (c *drpcNodeClient) TrustedSatellites(ctx context.Context, in *TrustedSatellitesRequest) (*TrustedSatellitesResponse, error) {
out := new(TrustedSatellitesResponse)
err := c.cc.Invoke(ctx, "/multinode.Node/TrustedSatellites", drpcEncoding_File_multinode_proto{}, in, out)
if err != nil {
return nil, err
}
return out, nil
}
type DRPCNodeServer interface {
Version(context.Context, *VersionRequest) (*VersionResponse, error)
LastContact(context.Context, *LastContactRequest) (*LastContactResponse, error)
Reputation(context.Context, *ReputationRequest) (*ReputationResponse, error)
TrustedSatellites(context.Context, *TrustedSatellitesRequest) (*TrustedSatellitesResponse, error)
}
type DRPCNodeUnimplementedServer struct{}
func (s *DRPCNodeUnimplementedServer) Version(context.Context, *VersionRequest) (*VersionResponse, error) {
return nil, drpcerr.WithCode(errors.New("Unimplemented"), 12)
}
func (s *DRPCNodeUnimplementedServer) LastContact(context.Context, *LastContactRequest) (*LastContactResponse, error) {
return nil, drpcerr.WithCode(errors.New("Unimplemented"), 12)
}
func (s *DRPCNodeUnimplementedServer) Reputation(context.Context, *ReputationRequest) (*ReputationResponse, error) {
return nil, drpcerr.WithCode(errors.New("Unimplemented"), 12)
}
func (s *DRPCNodeUnimplementedServer) TrustedSatellites(context.Context, *TrustedSatellitesRequest) (*TrustedSatellitesResponse, error) {
return nil, drpcerr.WithCode(errors.New("Unimplemented"), 12)
}
type DRPCNodeDescription struct{}
func (DRPCNodeDescription) NumMethods() int { return 4 }
func (DRPCNodeDescription) Method(n int) (string, drpc.Encoding, drpc.Receiver, interface{}, bool) {
switch n {
case 0:
return "/multinode.Node/Version", drpcEncoding_File_multinode_proto{},
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCNodeServer).
Version(
ctx,
in1.(*VersionRequest),
)
}, DRPCNodeServer.Version, true
case 1:
return "/multinode.Node/LastContact", drpcEncoding_File_multinode_proto{},
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCNodeServer).
LastContact(
ctx,
in1.(*LastContactRequest),
)
}, DRPCNodeServer.LastContact, true
case 2:
return "/multinode.Node/Reputation", drpcEncoding_File_multinode_proto{},
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCNodeServer).
Reputation(
ctx,
in1.(*ReputationRequest),
)
}, DRPCNodeServer.Reputation, true
case 3:
return "/multinode.Node/TrustedSatellites", drpcEncoding_File_multinode_proto{},
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCNodeServer).
TrustedSatellites(
ctx,
in1.(*TrustedSatellitesRequest),
)
}, DRPCNodeServer.TrustedSatellites, true
default:
return "", nil, nil, nil, false
}
}
func DRPCRegisterNode(mux drpc.Mux, impl DRPCNodeServer) error {
return mux.Register(impl, DRPCNodeDescription{})
}
type DRPCNode_VersionStream interface {
drpc.Stream
SendAndClose(*VersionResponse) error
}
type drpcNode_VersionStream struct {
drpc.Stream
}
func (x *drpcNode_VersionStream) SendAndClose(m *VersionResponse) error {
if err := x.MsgSend(m, drpcEncoding_File_multinode_proto{}); err != nil {
return err
}
return x.CloseSend()
}
type DRPCNode_LastContactStream interface {
drpc.Stream
SendAndClose(*LastContactResponse) error
}
type drpcNode_LastContactStream struct {
drpc.Stream
}
func (x *drpcNode_LastContactStream) SendAndClose(m *LastContactResponse) error {
if err := x.MsgSend(m, drpcEncoding_File_multinode_proto{}); err != nil {
return err
}
return x.CloseSend()
}
type DRPCNode_ReputationStream interface {
drpc.Stream
SendAndClose(*ReputationResponse) error
}
type drpcNode_ReputationStream struct {
drpc.Stream
}
func (x *drpcNode_ReputationStream) SendAndClose(m *ReputationResponse) error {
if err := x.MsgSend(m, drpcEncoding_File_multinode_proto{}); err != nil {
return err
}
return x.CloseSend()
}
type DRPCNode_TrustedSatellitesStream interface {
drpc.Stream
SendAndClose(*TrustedSatellitesResponse) error
}
type drpcNode_TrustedSatellitesStream struct {
drpc.Stream
}
func (x *drpcNode_TrustedSatellitesStream) SendAndClose(m *TrustedSatellitesResponse) error {
if err := x.MsgSend(m, drpcEncoding_File_multinode_proto{}); err != nil {
return err
}
return x.CloseSend()
}
type DRPCPayoutClient interface {
DRPCConn() drpc.Conn
Earned(ctx context.Context, in *EarnedRequest) (*EarnedResponse, error)
EarnedPerSatellite(ctx context.Context, in *EarnedPerSatelliteRequest) (*EarnedPerSatelliteResponse, error)
}
type drpcPayoutClient struct {
cc drpc.Conn
}
func NewDRPCPayoutClient(cc drpc.Conn) DRPCPayoutClient {
return &drpcPayoutClient{cc}
}
func (c *drpcPayoutClient) DRPCConn() drpc.Conn { return c.cc }
func (c *drpcPayoutClient) Earned(ctx context.Context, in *EarnedRequest) (*EarnedResponse, error) {
out := new(EarnedResponse)
err := c.cc.Invoke(ctx, "/multinode.Payout/Earned", drpcEncoding_File_multinode_proto{}, in, out)
if err != nil {
return nil, err
}
return out, nil
}
func (c *drpcPayoutClient) EarnedPerSatellite(ctx context.Context, in *EarnedPerSatelliteRequest) (*EarnedPerSatelliteResponse, error) {
out := new(EarnedPerSatelliteResponse)
err := c.cc.Invoke(ctx, "/multinode.Payout/EarnedPerSatellite", drpcEncoding_File_multinode_proto{}, in, out)
if err != nil {
return nil, err
}
return out, nil
}
type DRPCPayoutServer interface {
Earned(context.Context, *EarnedRequest) (*EarnedResponse, error)
EarnedPerSatellite(context.Context, *EarnedPerSatelliteRequest) (*EarnedPerSatelliteResponse, error)
}
type DRPCPayoutUnimplementedServer struct{}
func (s *DRPCPayoutUnimplementedServer) Earned(context.Context, *EarnedRequest) (*EarnedResponse, error) {
return nil, drpcerr.WithCode(errors.New("Unimplemented"), 12)
}
func (s *DRPCPayoutUnimplementedServer) EarnedPerSatellite(context.Context, *EarnedPerSatelliteRequest) (*EarnedPerSatelliteResponse, error) {
return nil, drpcerr.WithCode(errors.New("Unimplemented"), 12)
}
type DRPCPayoutDescription struct{}
func (DRPCPayoutDescription) NumMethods() int { return 2 }
func (DRPCPayoutDescription) Method(n int) (string, drpc.Encoding, drpc.Receiver, interface{}, bool) {
switch n {
case 0:
return "/multinode.Payout/Earned", drpcEncoding_File_multinode_proto{},
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCPayoutServer).
Earned(
ctx,
in1.(*EarnedRequest),
)
}, DRPCPayoutServer.Earned, true
case 1:
return "/multinode.Payout/EarnedPerSatellite", drpcEncoding_File_multinode_proto{},
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCPayoutServer).
EarnedPerSatellite(
ctx,
in1.(*EarnedPerSatelliteRequest),
)
}, DRPCPayoutServer.EarnedPerSatellite, true
default:
return "", nil, nil, nil, false
}
}
func DRPCRegisterPayout(mux drpc.Mux, impl DRPCPayoutServer) error {
return mux.Register(impl, DRPCPayoutDescription{})
}
type DRPCPayout_EarnedStream interface {
drpc.Stream
SendAndClose(*EarnedResponse) error
}
type drpcPayout_EarnedStream struct {
drpc.Stream
}
func (x *drpcPayout_EarnedStream) SendAndClose(m *EarnedResponse) error {
if err := x.MsgSend(m, drpcEncoding_File_multinode_proto{}); err != nil {
return err
}
return x.CloseSend()
}
type DRPCPayout_EarnedPerSatelliteStream interface {
drpc.Stream
SendAndClose(*EarnedPerSatelliteResponse) error
}
type drpcPayout_EarnedPerSatelliteStream struct {
drpc.Stream
}
func (x *drpcPayout_EarnedPerSatelliteStream) SendAndClose(m *EarnedPerSatelliteResponse) error {
if err := x.MsgSend(m, drpcEncoding_File_multinode_proto{}); err != nil {
return err
}
return x.CloseSend()
}

View File

@ -4,7 +4,6 @@
package internalpb
import (
context "context"
fmt "fmt"
math "math"
time "time"
@ -12,7 +11,6 @@ import (
proto "github.com/gogo/protobuf/proto"
pb "storj.io/common/pb"
drpc "storj.io/drpc"
)
// Reference imports to suppress errors if they are not otherwise used.
@ -381,76 +379,3 @@ var fileDescriptor_04d00d18c724d5a7 = []byte{
0xfd, 0x18, 0x4c, 0x0f, 0x18, 0xd8, 0x1c, 0x73, 0x12, 0xa7, 0x41, 0x50, 0xb5, 0xc9, 0x79, 0xfc,
0x37, 0x00, 0x00, 0xff, 0xff, 0xf7, 0x7f, 0xbc, 0x37, 0x84, 0x05, 0x00, 0x00,
}
// --- DRPC BEGIN ---
type DRPCRepairCoordinatorClient interface {
DRPCConn() drpc.Conn
RepairJob(ctx context.Context, in *RepairJobRequest) (*RepairJobResponse, error)
}
type drpcRepairCoordinatorClient struct {
cc drpc.Conn
}
func NewDRPCRepairCoordinatorClient(cc drpc.Conn) DRPCRepairCoordinatorClient {
return &drpcRepairCoordinatorClient{cc}
}
func (c *drpcRepairCoordinatorClient) DRPCConn() drpc.Conn { return c.cc }
func (c *drpcRepairCoordinatorClient) RepairJob(ctx context.Context, in *RepairJobRequest) (*RepairJobResponse, error) {
out := new(RepairJobResponse)
err := c.cc.Invoke(ctx, "/satellite.delegated_repair.RepairCoordinator/RepairJob", in, out)
if err != nil {
return nil, err
}
return out, nil
}
type DRPCRepairCoordinatorServer interface {
RepairJob(context.Context, *RepairJobRequest) (*RepairJobResponse, error)
}
type DRPCRepairCoordinatorDescription struct{}
func (DRPCRepairCoordinatorDescription) NumMethods() int { return 1 }
func (DRPCRepairCoordinatorDescription) Method(n int) (string, drpc.Receiver, interface{}, bool) {
switch n {
case 0:
return "/satellite.delegated_repair.RepairCoordinator/RepairJob",
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCRepairCoordinatorServer).
RepairJob(
ctx,
in1.(*RepairJobRequest),
)
}, DRPCRepairCoordinatorServer.RepairJob, true
default:
return "", nil, nil, false
}
}
func DRPCRegisterRepairCoordinator(mux drpc.Mux, impl DRPCRepairCoordinatorServer) error {
return mux.Register(impl, DRPCRepairCoordinatorDescription{})
}
type DRPCRepairCoordinator_RepairJobStream interface {
drpc.Stream
SendAndClose(*RepairJobResponse) error
}
type drpcRepairCoordinatorRepairJobStream struct {
drpc.Stream
}
func (x *drpcRepairCoordinatorRepairJobStream) SendAndClose(m *RepairJobResponse) error {
if err := x.MsgSend(m); err != nil {
return err
}
return x.CloseSend()
}
// --- DRPC END ---

View File

@ -0,0 +1,115 @@
// Code generated by protoc-gen-go-drpc. DO NOT EDIT.
// protoc-gen-go-drpc version: v0.0.19
// source: delegated_repair.proto
package internalpb
import (
bytes "bytes"
context "context"
errors "errors"
jsonpb "github.com/gogo/protobuf/jsonpb"
proto "github.com/gogo/protobuf/proto"
drpc "storj.io/drpc"
drpcerr "storj.io/drpc/drpcerr"
)
type drpcEncoding_File_delegated_repair_proto struct{}
func (drpcEncoding_File_delegated_repair_proto) Marshal(msg drpc.Message) ([]byte, error) {
return proto.Marshal(msg.(proto.Message))
}
func (drpcEncoding_File_delegated_repair_proto) Unmarshal(buf []byte, msg drpc.Message) error {
return proto.Unmarshal(buf, msg.(proto.Message))
}
func (drpcEncoding_File_delegated_repair_proto) JSONMarshal(msg drpc.Message) ([]byte, error) {
var buf bytes.Buffer
err := new(jsonpb.Marshaler).Marshal(&buf, msg.(proto.Message))
if err != nil {
return nil, err
}
return buf.Bytes(), nil
}
func (drpcEncoding_File_delegated_repair_proto) JSONUnmarshal(buf []byte, msg drpc.Message) error {
return jsonpb.Unmarshal(bytes.NewReader(buf), msg.(proto.Message))
}
type DRPCRepairCoordinatorClient interface {
DRPCConn() drpc.Conn
RepairJob(ctx context.Context, in *RepairJobRequest) (*RepairJobResponse, error)
}
type drpcRepairCoordinatorClient struct {
cc drpc.Conn
}
func NewDRPCRepairCoordinatorClient(cc drpc.Conn) DRPCRepairCoordinatorClient {
return &drpcRepairCoordinatorClient{cc}
}
func (c *drpcRepairCoordinatorClient) DRPCConn() drpc.Conn { return c.cc }
func (c *drpcRepairCoordinatorClient) RepairJob(ctx context.Context, in *RepairJobRequest) (*RepairJobResponse, error) {
out := new(RepairJobResponse)
err := c.cc.Invoke(ctx, "/satellite.delegated_repair.RepairCoordinator/RepairJob", drpcEncoding_File_delegated_repair_proto{}, in, out)
if err != nil {
return nil, err
}
return out, nil
}
type DRPCRepairCoordinatorServer interface {
RepairJob(context.Context, *RepairJobRequest) (*RepairJobResponse, error)
}
type DRPCRepairCoordinatorUnimplementedServer struct{}
func (s *DRPCRepairCoordinatorUnimplementedServer) RepairJob(context.Context, *RepairJobRequest) (*RepairJobResponse, error) {
return nil, drpcerr.WithCode(errors.New("Unimplemented"), 12)
}
type DRPCRepairCoordinatorDescription struct{}
func (DRPCRepairCoordinatorDescription) NumMethods() int { return 1 }
func (DRPCRepairCoordinatorDescription) Method(n int) (string, drpc.Encoding, drpc.Receiver, interface{}, bool) {
switch n {
case 0:
return "/satellite.delegated_repair.RepairCoordinator/RepairJob", drpcEncoding_File_delegated_repair_proto{},
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCRepairCoordinatorServer).
RepairJob(
ctx,
in1.(*RepairJobRequest),
)
}, DRPCRepairCoordinatorServer.RepairJob, true
default:
return "", nil, nil, nil, false
}
}
func DRPCRegisterRepairCoordinator(mux drpc.Mux, impl DRPCRepairCoordinatorServer) error {
return mux.Register(impl, DRPCRepairCoordinatorDescription{})
}
type DRPCRepairCoordinator_RepairJobStream interface {
drpc.Stream
SendAndClose(*RepairJobResponse) error
}
type drpcRepairCoordinator_RepairJobStream struct {
drpc.Stream
}
func (x *drpcRepairCoordinator_RepairJobStream) SendAndClose(m *RepairJobResponse) error {
if err := x.MsgSend(m, drpcEncoding_File_delegated_repair_proto{}); err != nil {
return err
}
return x.CloseSend()
}

View File

@ -71,7 +71,8 @@ func main() {
overrideImports := ",Mgoogle/protobuf/timestamp.proto=storj.io/storj/satellite/internalpb"
args := []string{
"--lint_out=.",
"--drpc_out=plugins=drpc,paths=source_relative" + overrideImports + ":.",
"--gogo_out=paths=source_relative" + overrideImports + ":.",
"--go-drpc_out=protolib=github.com/gogo/protobuf,paths=source_relative:.",
"-I=.",
"-I=" + commonPb,
}

View File

@ -4,14 +4,12 @@
package internalpb
import (
context "context"
fmt "fmt"
math "math"
proto "github.com/gogo/protobuf/proto"
pb "storj.io/common/pb"
drpc "storj.io/drpc"
)
// Reference imports to suppress errors if they are not otherwise used.
@ -661,296 +659,3 @@ var fileDescriptor_a07d9034b2dd9d26 = []byte{
0x7f, 0x19, 0xce, 0xff, 0x0d, 0x00, 0x00, 0xff, 0xff, 0xfd, 0xe6, 0x11, 0x41, 0x83, 0x08, 0x00,
0x00,
}
// --- DRPC BEGIN ---
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, "/satellite.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, "/satellite.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
CountNodes(context.Context, *CountNodesRequest) (*CountNodesResponse, error)
// DumpNodes returns all the nodes in the cache
DumpNodes(context.Context, *DumpNodesRequest) (*DumpNodesResponse, error)
}
type DRPCOverlayInspectorDescription struct{}
func (DRPCOverlayInspectorDescription) NumMethods() int { return 2 }
func (DRPCOverlayInspectorDescription) Method(n int) (string, drpc.Receiver, interface{}, bool) {
switch n {
case 0:
return "/satellite.inspector.OverlayInspector/CountNodes",
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCOverlayInspectorServer).
CountNodes(
ctx,
in1.(*CountNodesRequest),
)
}, DRPCOverlayInspectorServer.CountNodes, true
case 1:
return "/satellite.inspector.OverlayInspector/DumpNodes",
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCOverlayInspectorServer).
DumpNodes(
ctx,
in1.(*DumpNodesRequest),
)
}, DRPCOverlayInspectorServer.DumpNodes, true
default:
return "", nil, nil, false
}
}
func DRPCRegisterOverlayInspector(mux drpc.Mux, impl DRPCOverlayInspectorServer) error {
return mux.Register(impl, DRPCOverlayInspectorDescription{})
}
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 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, "/satellite.inspector.IrreparableInspector/ListIrreparableSegments", in, out)
if err != nil {
return nil, err
}
return out, nil
}
type DRPCIrreparableInspectorServer interface {
// ListIrreparableSegments returns damaged segments
ListIrreparableSegments(context.Context, *ListIrreparableSegmentsRequest) (*ListIrreparableSegmentsResponse, error)
}
type DRPCIrreparableInspectorDescription struct{}
func (DRPCIrreparableInspectorDescription) NumMethods() int { return 1 }
func (DRPCIrreparableInspectorDescription) Method(n int) (string, drpc.Receiver, interface{}, bool) {
switch n {
case 0:
return "/satellite.inspector.IrreparableInspector/ListIrreparableSegments",
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCIrreparableInspectorServer).
ListIrreparableSegments(
ctx,
in1.(*ListIrreparableSegmentsRequest),
)
}, DRPCIrreparableInspectorServer.ListIrreparableSegments, true
default:
return "", nil, nil, false
}
}
func DRPCRegisterIrreparableInspector(mux drpc.Mux, impl DRPCIrreparableInspectorServer) error {
return mux.Register(impl, DRPCIrreparableInspectorDescription{})
}
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, "/satellite.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, "/satellite.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
ObjectHealth(context.Context, *ObjectHealthRequest) (*ObjectHealthResponse, error)
// SegmentHealth will return stats about the health of a segment
SegmentHealth(context.Context, *SegmentHealthRequest) (*SegmentHealthResponse, error)
}
type DRPCHealthInspectorDescription struct{}
func (DRPCHealthInspectorDescription) NumMethods() int { return 2 }
func (DRPCHealthInspectorDescription) Method(n int) (string, drpc.Receiver, interface{}, bool) {
switch n {
case 0:
return "/satellite.inspector.HealthInspector/ObjectHealth",
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCHealthInspectorServer).
ObjectHealth(
ctx,
in1.(*ObjectHealthRequest),
)
}, DRPCHealthInspectorServer.ObjectHealth, true
case 1:
return "/satellite.inspector.HealthInspector/SegmentHealth",
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCHealthInspectorServer).
SegmentHealth(
ctx,
in1.(*SegmentHealthRequest),
)
}, DRPCHealthInspectorServer.SegmentHealth, true
default:
return "", nil, nil, false
}
}
func DRPCRegisterHealthInspector(mux drpc.Mux, impl DRPCHealthInspectorServer) error {
return mux.Register(impl, DRPCHealthInspectorDescription{})
}
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()
}
// --- DRPC END ---

View File

@ -0,0 +1,345 @@
// Code generated by protoc-gen-go-drpc. DO NOT EDIT.
// protoc-gen-go-drpc version: v0.0.19
// source: inspector.proto
package internalpb
import (
bytes "bytes"
context "context"
errors "errors"
jsonpb "github.com/gogo/protobuf/jsonpb"
proto "github.com/gogo/protobuf/proto"
drpc "storj.io/drpc"
drpcerr "storj.io/drpc/drpcerr"
)
type drpcEncoding_File_inspector_proto struct{}
func (drpcEncoding_File_inspector_proto) Marshal(msg drpc.Message) ([]byte, error) {
return proto.Marshal(msg.(proto.Message))
}
func (drpcEncoding_File_inspector_proto) Unmarshal(buf []byte, msg drpc.Message) error {
return proto.Unmarshal(buf, msg.(proto.Message))
}
func (drpcEncoding_File_inspector_proto) JSONMarshal(msg drpc.Message) ([]byte, error) {
var buf bytes.Buffer
err := new(jsonpb.Marshaler).Marshal(&buf, msg.(proto.Message))
if err != nil {
return nil, err
}
return buf.Bytes(), nil
}
func (drpcEncoding_File_inspector_proto) JSONUnmarshal(buf []byte, msg drpc.Message) error {
return jsonpb.Unmarshal(bytes.NewReader(buf), msg.(proto.Message))
}
type DRPCOverlayInspectorClient interface {
DRPCConn() drpc.Conn
CountNodes(ctx context.Context, in *CountNodesRequest) (*CountNodesResponse, error)
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, "/satellite.inspector.OverlayInspector/CountNodes", drpcEncoding_File_inspector_proto{}, 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, "/satellite.inspector.OverlayInspector/DumpNodes", drpcEncoding_File_inspector_proto{}, in, out)
if err != nil {
return nil, err
}
return out, nil
}
type DRPCOverlayInspectorServer interface {
CountNodes(context.Context, *CountNodesRequest) (*CountNodesResponse, error)
DumpNodes(context.Context, *DumpNodesRequest) (*DumpNodesResponse, error)
}
type DRPCOverlayInspectorUnimplementedServer struct{}
func (s *DRPCOverlayInspectorUnimplementedServer) CountNodes(context.Context, *CountNodesRequest) (*CountNodesResponse, error) {
return nil, drpcerr.WithCode(errors.New("Unimplemented"), 12)
}
func (s *DRPCOverlayInspectorUnimplementedServer) DumpNodes(context.Context, *DumpNodesRequest) (*DumpNodesResponse, error) {
return nil, drpcerr.WithCode(errors.New("Unimplemented"), 12)
}
type DRPCOverlayInspectorDescription struct{}
func (DRPCOverlayInspectorDescription) NumMethods() int { return 2 }
func (DRPCOverlayInspectorDescription) Method(n int) (string, drpc.Encoding, drpc.Receiver, interface{}, bool) {
switch n {
case 0:
return "/satellite.inspector.OverlayInspector/CountNodes", drpcEncoding_File_inspector_proto{},
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCOverlayInspectorServer).
CountNodes(
ctx,
in1.(*CountNodesRequest),
)
}, DRPCOverlayInspectorServer.CountNodes, true
case 1:
return "/satellite.inspector.OverlayInspector/DumpNodes", drpcEncoding_File_inspector_proto{},
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCOverlayInspectorServer).
DumpNodes(
ctx,
in1.(*DumpNodesRequest),
)
}, DRPCOverlayInspectorServer.DumpNodes, true
default:
return "", nil, nil, nil, false
}
}
func DRPCRegisterOverlayInspector(mux drpc.Mux, impl DRPCOverlayInspectorServer) error {
return mux.Register(impl, DRPCOverlayInspectorDescription{})
}
type DRPCOverlayInspector_CountNodesStream interface {
drpc.Stream
SendAndClose(*CountNodesResponse) error
}
type drpcOverlayInspector_CountNodesStream struct {
drpc.Stream
}
func (x *drpcOverlayInspector_CountNodesStream) SendAndClose(m *CountNodesResponse) error {
if err := x.MsgSend(m, drpcEncoding_File_inspector_proto{}); err != nil {
return err
}
return x.CloseSend()
}
type DRPCOverlayInspector_DumpNodesStream interface {
drpc.Stream
SendAndClose(*DumpNodesResponse) error
}
type drpcOverlayInspector_DumpNodesStream struct {
drpc.Stream
}
func (x *drpcOverlayInspector_DumpNodesStream) SendAndClose(m *DumpNodesResponse) error {
if err := x.MsgSend(m, drpcEncoding_File_inspector_proto{}); err != nil {
return err
}
return x.CloseSend()
}
type DRPCIrreparableInspectorClient interface {
DRPCConn() drpc.Conn
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, "/satellite.inspector.IrreparableInspector/ListIrreparableSegments", drpcEncoding_File_inspector_proto{}, in, out)
if err != nil {
return nil, err
}
return out, nil
}
type DRPCIrreparableInspectorServer interface {
ListIrreparableSegments(context.Context, *ListIrreparableSegmentsRequest) (*ListIrreparableSegmentsResponse, error)
}
type DRPCIrreparableInspectorUnimplementedServer struct{}
func (s *DRPCIrreparableInspectorUnimplementedServer) ListIrreparableSegments(context.Context, *ListIrreparableSegmentsRequest) (*ListIrreparableSegmentsResponse, error) {
return nil, drpcerr.WithCode(errors.New("Unimplemented"), 12)
}
type DRPCIrreparableInspectorDescription struct{}
func (DRPCIrreparableInspectorDescription) NumMethods() int { return 1 }
func (DRPCIrreparableInspectorDescription) Method(n int) (string, drpc.Encoding, drpc.Receiver, interface{}, bool) {
switch n {
case 0:
return "/satellite.inspector.IrreparableInspector/ListIrreparableSegments", drpcEncoding_File_inspector_proto{},
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCIrreparableInspectorServer).
ListIrreparableSegments(
ctx,
in1.(*ListIrreparableSegmentsRequest),
)
}, DRPCIrreparableInspectorServer.ListIrreparableSegments, true
default:
return "", nil, nil, nil, false
}
}
func DRPCRegisterIrreparableInspector(mux drpc.Mux, impl DRPCIrreparableInspectorServer) error {
return mux.Register(impl, DRPCIrreparableInspectorDescription{})
}
type DRPCIrreparableInspector_ListIrreparableSegmentsStream interface {
drpc.Stream
SendAndClose(*ListIrreparableSegmentsResponse) error
}
type drpcIrreparableInspector_ListIrreparableSegmentsStream struct {
drpc.Stream
}
func (x *drpcIrreparableInspector_ListIrreparableSegmentsStream) SendAndClose(m *ListIrreparableSegmentsResponse) error {
if err := x.MsgSend(m, drpcEncoding_File_inspector_proto{}); err != nil {
return err
}
return x.CloseSend()
}
type DRPCHealthInspectorClient interface {
DRPCConn() drpc.Conn
ObjectHealth(ctx context.Context, in *ObjectHealthRequest) (*ObjectHealthResponse, error)
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, "/satellite.inspector.HealthInspector/ObjectHealth", drpcEncoding_File_inspector_proto{}, 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, "/satellite.inspector.HealthInspector/SegmentHealth", drpcEncoding_File_inspector_proto{}, in, out)
if err != nil {
return nil, err
}
return out, nil
}
type DRPCHealthInspectorServer interface {
ObjectHealth(context.Context, *ObjectHealthRequest) (*ObjectHealthResponse, error)
SegmentHealth(context.Context, *SegmentHealthRequest) (*SegmentHealthResponse, error)
}
type DRPCHealthInspectorUnimplementedServer struct{}
func (s *DRPCHealthInspectorUnimplementedServer) ObjectHealth(context.Context, *ObjectHealthRequest) (*ObjectHealthResponse, error) {
return nil, drpcerr.WithCode(errors.New("Unimplemented"), 12)
}
func (s *DRPCHealthInspectorUnimplementedServer) SegmentHealth(context.Context, *SegmentHealthRequest) (*SegmentHealthResponse, error) {
return nil, drpcerr.WithCode(errors.New("Unimplemented"), 12)
}
type DRPCHealthInspectorDescription struct{}
func (DRPCHealthInspectorDescription) NumMethods() int { return 2 }
func (DRPCHealthInspectorDescription) Method(n int) (string, drpc.Encoding, drpc.Receiver, interface{}, bool) {
switch n {
case 0:
return "/satellite.inspector.HealthInspector/ObjectHealth", drpcEncoding_File_inspector_proto{},
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCHealthInspectorServer).
ObjectHealth(
ctx,
in1.(*ObjectHealthRequest),
)
}, DRPCHealthInspectorServer.ObjectHealth, true
case 1:
return "/satellite.inspector.HealthInspector/SegmentHealth", drpcEncoding_File_inspector_proto{},
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCHealthInspectorServer).
SegmentHealth(
ctx,
in1.(*SegmentHealthRequest),
)
}, DRPCHealthInspectorServer.SegmentHealth, true
default:
return "", nil, nil, nil, false
}
}
func DRPCRegisterHealthInspector(mux drpc.Mux, impl DRPCHealthInspectorServer) error {
return mux.Register(impl, DRPCHealthInspectorDescription{})
}
type DRPCHealthInspector_ObjectHealthStream interface {
drpc.Stream
SendAndClose(*ObjectHealthResponse) error
}
type drpcHealthInspector_ObjectHealthStream struct {
drpc.Stream
}
func (x *drpcHealthInspector_ObjectHealthStream) SendAndClose(m *ObjectHealthResponse) error {
if err := x.MsgSend(m, drpcEncoding_File_inspector_proto{}); err != nil {
return err
}
return x.CloseSend()
}
type DRPCHealthInspector_SegmentHealthStream interface {
drpc.Stream
SendAndClose(*SegmentHealthResponse) error
}
type drpcHealthInspector_SegmentHealthStream struct {
drpc.Stream
}
func (x *drpcHealthInspector_SegmentHealthStream) SendAndClose(m *SegmentHealthResponse) error {
if err := x.MsgSend(m, drpcEncoding_File_inspector_proto{}); err != nil {
return err
}
return x.CloseSend()
}

View File

@ -71,7 +71,8 @@ func main() {
overrideImports := ",Mgoogle/protobuf/timestamp.proto=storj.io/storj/storagenode/internalpb"
args := []string{
"--lint_out=.",
"--drpc_out=plugins=drpc,paths=source_relative" + overrideImports + ":.",
"--gogo_out=paths=source_relative" + overrideImports + ":.",
"--go-drpc_out=protolib=github.com/gogo/protobuf,paths=source_relative:.",
"-I=.",
"-I=" + commonPb,
}

View File

@ -4,14 +4,11 @@
package internalpb
import (
context "context"
fmt "fmt"
math "math"
time "time"
proto "github.com/gogo/protobuf/proto"
drpc "storj.io/drpc"
)
// Reference imports to suppress errors if they are not otherwise used.
@ -445,192 +442,3 @@ var fileDescriptor_8f0acbf2ce5fa631 = []byte{
0xc9, 0x64, 0xa9, 0xb4, 0xef, 0x83, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x0e, 0x75, 0x55, 0x23,
0x56, 0x06, 0x00, 0x00,
}
// --- DRPC BEGIN ---
type DRPCNodeGracefulExitClient interface {
DRPCConn() drpc.Conn
// GetSatellitesList returns a list of satellites that the storagenode has not exited.
GetNonExitingSatellites(ctx context.Context, in *GetNonExitingSatellitesRequest) (*GetNonExitingSatellitesResponse, error)
// InitiateGracefulExit updates one or more satellites in the storagenode's database to be gracefully exiting.
InitiateGracefulExit(ctx context.Context, in *InitiateGracefulExitRequest) (*ExitProgress, error)
// GetExitProgress returns graceful exit status on each satellite for a given storagenode.
GetExitProgress(ctx context.Context, in *GetExitProgressRequest) (*GetExitProgressResponse, error)
// GracefulExitFeasibility returns node's join date and satellites config's amount of months required for graceful exit to be allowed.
GracefulExitFeasibility(ctx context.Context, in *GracefulExitFeasibilityRequest) (*GracefulExitFeasibilityResponse, error)
}
type drpcNodeGracefulExitClient struct {
cc drpc.Conn
}
func NewDRPCNodeGracefulExitClient(cc drpc.Conn) DRPCNodeGracefulExitClient {
return &drpcNodeGracefulExitClient{cc}
}
func (c *drpcNodeGracefulExitClient) DRPCConn() drpc.Conn { return c.cc }
func (c *drpcNodeGracefulExitClient) GetNonExitingSatellites(ctx context.Context, in *GetNonExitingSatellitesRequest) (*GetNonExitingSatellitesResponse, error) {
out := new(GetNonExitingSatellitesResponse)
err := c.cc.Invoke(ctx, "/storagenode.gracefulexit.NodeGracefulExit/GetNonExitingSatellites", in, out)
if err != nil {
return nil, err
}
return out, nil
}
func (c *drpcNodeGracefulExitClient) InitiateGracefulExit(ctx context.Context, in *InitiateGracefulExitRequest) (*ExitProgress, error) {
out := new(ExitProgress)
err := c.cc.Invoke(ctx, "/storagenode.gracefulexit.NodeGracefulExit/InitiateGracefulExit", in, out)
if err != nil {
return nil, err
}
return out, nil
}
func (c *drpcNodeGracefulExitClient) GetExitProgress(ctx context.Context, in *GetExitProgressRequest) (*GetExitProgressResponse, error) {
out := new(GetExitProgressResponse)
err := c.cc.Invoke(ctx, "/storagenode.gracefulexit.NodeGracefulExit/GetExitProgress", in, out)
if err != nil {
return nil, err
}
return out, nil
}
func (c *drpcNodeGracefulExitClient) GracefulExitFeasibility(ctx context.Context, in *GracefulExitFeasibilityRequest) (*GracefulExitFeasibilityResponse, error) {
out := new(GracefulExitFeasibilityResponse)
err := c.cc.Invoke(ctx, "/storagenode.gracefulexit.NodeGracefulExit/GracefulExitFeasibility", in, out)
if err != nil {
return nil, err
}
return out, nil
}
type DRPCNodeGracefulExitServer interface {
// GetSatellitesList returns a list of satellites that the storagenode has not exited.
GetNonExitingSatellites(context.Context, *GetNonExitingSatellitesRequest) (*GetNonExitingSatellitesResponse, error)
// InitiateGracefulExit updates one or more satellites in the storagenode's database to be gracefully exiting.
InitiateGracefulExit(context.Context, *InitiateGracefulExitRequest) (*ExitProgress, error)
// GetExitProgress returns graceful exit status on each satellite for a given storagenode.
GetExitProgress(context.Context, *GetExitProgressRequest) (*GetExitProgressResponse, error)
// GracefulExitFeasibility returns node's join date and satellites config's amount of months required for graceful exit to be allowed.
GracefulExitFeasibility(context.Context, *GracefulExitFeasibilityRequest) (*GracefulExitFeasibilityResponse, error)
}
type DRPCNodeGracefulExitDescription struct{}
func (DRPCNodeGracefulExitDescription) NumMethods() int { return 4 }
func (DRPCNodeGracefulExitDescription) Method(n int) (string, drpc.Receiver, interface{}, bool) {
switch n {
case 0:
return "/storagenode.gracefulexit.NodeGracefulExit/GetNonExitingSatellites",
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCNodeGracefulExitServer).
GetNonExitingSatellites(
ctx,
in1.(*GetNonExitingSatellitesRequest),
)
}, DRPCNodeGracefulExitServer.GetNonExitingSatellites, true
case 1:
return "/storagenode.gracefulexit.NodeGracefulExit/InitiateGracefulExit",
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCNodeGracefulExitServer).
InitiateGracefulExit(
ctx,
in1.(*InitiateGracefulExitRequest),
)
}, DRPCNodeGracefulExitServer.InitiateGracefulExit, true
case 2:
return "/storagenode.gracefulexit.NodeGracefulExit/GetExitProgress",
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCNodeGracefulExitServer).
GetExitProgress(
ctx,
in1.(*GetExitProgressRequest),
)
}, DRPCNodeGracefulExitServer.GetExitProgress, true
case 3:
return "/storagenode.gracefulexit.NodeGracefulExit/GracefulExitFeasibility",
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCNodeGracefulExitServer).
GracefulExitFeasibility(
ctx,
in1.(*GracefulExitFeasibilityRequest),
)
}, DRPCNodeGracefulExitServer.GracefulExitFeasibility, true
default:
return "", nil, nil, false
}
}
func DRPCRegisterNodeGracefulExit(mux drpc.Mux, impl DRPCNodeGracefulExitServer) error {
return mux.Register(impl, DRPCNodeGracefulExitDescription{})
}
type DRPCNodeGracefulExit_GetNonExitingSatellitesStream interface {
drpc.Stream
SendAndClose(*GetNonExitingSatellitesResponse) error
}
type drpcNodeGracefulExitGetNonExitingSatellitesStream struct {
drpc.Stream
}
func (x *drpcNodeGracefulExitGetNonExitingSatellitesStream) SendAndClose(m *GetNonExitingSatellitesResponse) error {
if err := x.MsgSend(m); err != nil {
return err
}
return x.CloseSend()
}
type DRPCNodeGracefulExit_InitiateGracefulExitStream interface {
drpc.Stream
SendAndClose(*ExitProgress) error
}
type drpcNodeGracefulExitInitiateGracefulExitStream struct {
drpc.Stream
}
func (x *drpcNodeGracefulExitInitiateGracefulExitStream) SendAndClose(m *ExitProgress) error {
if err := x.MsgSend(m); err != nil {
return err
}
return x.CloseSend()
}
type DRPCNodeGracefulExit_GetExitProgressStream interface {
drpc.Stream
SendAndClose(*GetExitProgressResponse) error
}
type drpcNodeGracefulExitGetExitProgressStream struct {
drpc.Stream
}
func (x *drpcNodeGracefulExitGetExitProgressStream) SendAndClose(m *GetExitProgressResponse) error {
if err := x.MsgSend(m); err != nil {
return err
}
return x.CloseSend()
}
type DRPCNodeGracefulExit_GracefulExitFeasibilityStream interface {
drpc.Stream
SendAndClose(*GracefulExitFeasibilityResponse) error
}
type drpcNodeGracefulExitGracefulExitFeasibilityStream struct {
drpc.Stream
}
func (x *drpcNodeGracefulExitGracefulExitFeasibilityStream) SendAndClose(m *GracefulExitFeasibilityResponse) error {
if err := x.MsgSend(m); err != nil {
return err
}
return x.CloseSend()
}
// --- DRPC END ---

View File

@ -0,0 +1,235 @@
// Code generated by protoc-gen-go-drpc. DO NOT EDIT.
// protoc-gen-go-drpc version: v0.0.19
// source: gracefulexit.proto
package internalpb
import (
bytes "bytes"
context "context"
errors "errors"
jsonpb "github.com/gogo/protobuf/jsonpb"
proto "github.com/gogo/protobuf/proto"
drpc "storj.io/drpc"
drpcerr "storj.io/drpc/drpcerr"
)
type drpcEncoding_File_gracefulexit_proto struct{}
func (drpcEncoding_File_gracefulexit_proto) Marshal(msg drpc.Message) ([]byte, error) {
return proto.Marshal(msg.(proto.Message))
}
func (drpcEncoding_File_gracefulexit_proto) Unmarshal(buf []byte, msg drpc.Message) error {
return proto.Unmarshal(buf, msg.(proto.Message))
}
func (drpcEncoding_File_gracefulexit_proto) JSONMarshal(msg drpc.Message) ([]byte, error) {
var buf bytes.Buffer
err := new(jsonpb.Marshaler).Marshal(&buf, msg.(proto.Message))
if err != nil {
return nil, err
}
return buf.Bytes(), nil
}
func (drpcEncoding_File_gracefulexit_proto) JSONUnmarshal(buf []byte, msg drpc.Message) error {
return jsonpb.Unmarshal(bytes.NewReader(buf), msg.(proto.Message))
}
type DRPCNodeGracefulExitClient interface {
DRPCConn() drpc.Conn
GetNonExitingSatellites(ctx context.Context, in *GetNonExitingSatellitesRequest) (*GetNonExitingSatellitesResponse, error)
InitiateGracefulExit(ctx context.Context, in *InitiateGracefulExitRequest) (*ExitProgress, error)
GetExitProgress(ctx context.Context, in *GetExitProgressRequest) (*GetExitProgressResponse, error)
GracefulExitFeasibility(ctx context.Context, in *GracefulExitFeasibilityRequest) (*GracefulExitFeasibilityResponse, error)
}
type drpcNodeGracefulExitClient struct {
cc drpc.Conn
}
func NewDRPCNodeGracefulExitClient(cc drpc.Conn) DRPCNodeGracefulExitClient {
return &drpcNodeGracefulExitClient{cc}
}
func (c *drpcNodeGracefulExitClient) DRPCConn() drpc.Conn { return c.cc }
func (c *drpcNodeGracefulExitClient) GetNonExitingSatellites(ctx context.Context, in *GetNonExitingSatellitesRequest) (*GetNonExitingSatellitesResponse, error) {
out := new(GetNonExitingSatellitesResponse)
err := c.cc.Invoke(ctx, "/storagenode.gracefulexit.NodeGracefulExit/GetNonExitingSatellites", drpcEncoding_File_gracefulexit_proto{}, in, out)
if err != nil {
return nil, err
}
return out, nil
}
func (c *drpcNodeGracefulExitClient) InitiateGracefulExit(ctx context.Context, in *InitiateGracefulExitRequest) (*ExitProgress, error) {
out := new(ExitProgress)
err := c.cc.Invoke(ctx, "/storagenode.gracefulexit.NodeGracefulExit/InitiateGracefulExit", drpcEncoding_File_gracefulexit_proto{}, in, out)
if err != nil {
return nil, err
}
return out, nil
}
func (c *drpcNodeGracefulExitClient) GetExitProgress(ctx context.Context, in *GetExitProgressRequest) (*GetExitProgressResponse, error) {
out := new(GetExitProgressResponse)
err := c.cc.Invoke(ctx, "/storagenode.gracefulexit.NodeGracefulExit/GetExitProgress", drpcEncoding_File_gracefulexit_proto{}, in, out)
if err != nil {
return nil, err
}
return out, nil
}
func (c *drpcNodeGracefulExitClient) GracefulExitFeasibility(ctx context.Context, in *GracefulExitFeasibilityRequest) (*GracefulExitFeasibilityResponse, error) {
out := new(GracefulExitFeasibilityResponse)
err := c.cc.Invoke(ctx, "/storagenode.gracefulexit.NodeGracefulExit/GracefulExitFeasibility", drpcEncoding_File_gracefulexit_proto{}, in, out)
if err != nil {
return nil, err
}
return out, nil
}
type DRPCNodeGracefulExitServer interface {
GetNonExitingSatellites(context.Context, *GetNonExitingSatellitesRequest) (*GetNonExitingSatellitesResponse, error)
InitiateGracefulExit(context.Context, *InitiateGracefulExitRequest) (*ExitProgress, error)
GetExitProgress(context.Context, *GetExitProgressRequest) (*GetExitProgressResponse, error)
GracefulExitFeasibility(context.Context, *GracefulExitFeasibilityRequest) (*GracefulExitFeasibilityResponse, error)
}
type DRPCNodeGracefulExitUnimplementedServer struct{}
func (s *DRPCNodeGracefulExitUnimplementedServer) GetNonExitingSatellites(context.Context, *GetNonExitingSatellitesRequest) (*GetNonExitingSatellitesResponse, error) {
return nil, drpcerr.WithCode(errors.New("Unimplemented"), 12)
}
func (s *DRPCNodeGracefulExitUnimplementedServer) InitiateGracefulExit(context.Context, *InitiateGracefulExitRequest) (*ExitProgress, error) {
return nil, drpcerr.WithCode(errors.New("Unimplemented"), 12)
}
func (s *DRPCNodeGracefulExitUnimplementedServer) GetExitProgress(context.Context, *GetExitProgressRequest) (*GetExitProgressResponse, error) {
return nil, drpcerr.WithCode(errors.New("Unimplemented"), 12)
}
func (s *DRPCNodeGracefulExitUnimplementedServer) GracefulExitFeasibility(context.Context, *GracefulExitFeasibilityRequest) (*GracefulExitFeasibilityResponse, error) {
return nil, drpcerr.WithCode(errors.New("Unimplemented"), 12)
}
type DRPCNodeGracefulExitDescription struct{}
func (DRPCNodeGracefulExitDescription) NumMethods() int { return 4 }
func (DRPCNodeGracefulExitDescription) Method(n int) (string, drpc.Encoding, drpc.Receiver, interface{}, bool) {
switch n {
case 0:
return "/storagenode.gracefulexit.NodeGracefulExit/GetNonExitingSatellites", drpcEncoding_File_gracefulexit_proto{},
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCNodeGracefulExitServer).
GetNonExitingSatellites(
ctx,
in1.(*GetNonExitingSatellitesRequest),
)
}, DRPCNodeGracefulExitServer.GetNonExitingSatellites, true
case 1:
return "/storagenode.gracefulexit.NodeGracefulExit/InitiateGracefulExit", drpcEncoding_File_gracefulexit_proto{},
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCNodeGracefulExitServer).
InitiateGracefulExit(
ctx,
in1.(*InitiateGracefulExitRequest),
)
}, DRPCNodeGracefulExitServer.InitiateGracefulExit, true
case 2:
return "/storagenode.gracefulexit.NodeGracefulExit/GetExitProgress", drpcEncoding_File_gracefulexit_proto{},
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCNodeGracefulExitServer).
GetExitProgress(
ctx,
in1.(*GetExitProgressRequest),
)
}, DRPCNodeGracefulExitServer.GetExitProgress, true
case 3:
return "/storagenode.gracefulexit.NodeGracefulExit/GracefulExitFeasibility", drpcEncoding_File_gracefulexit_proto{},
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCNodeGracefulExitServer).
GracefulExitFeasibility(
ctx,
in1.(*GracefulExitFeasibilityRequest),
)
}, DRPCNodeGracefulExitServer.GracefulExitFeasibility, true
default:
return "", nil, nil, nil, false
}
}
func DRPCRegisterNodeGracefulExit(mux drpc.Mux, impl DRPCNodeGracefulExitServer) error {
return mux.Register(impl, DRPCNodeGracefulExitDescription{})
}
type DRPCNodeGracefulExit_GetNonExitingSatellitesStream interface {
drpc.Stream
SendAndClose(*GetNonExitingSatellitesResponse) error
}
type drpcNodeGracefulExit_GetNonExitingSatellitesStream struct {
drpc.Stream
}
func (x *drpcNodeGracefulExit_GetNonExitingSatellitesStream) SendAndClose(m *GetNonExitingSatellitesResponse) error {
if err := x.MsgSend(m, drpcEncoding_File_gracefulexit_proto{}); err != nil {
return err
}
return x.CloseSend()
}
type DRPCNodeGracefulExit_InitiateGracefulExitStream interface {
drpc.Stream
SendAndClose(*ExitProgress) error
}
type drpcNodeGracefulExit_InitiateGracefulExitStream struct {
drpc.Stream
}
func (x *drpcNodeGracefulExit_InitiateGracefulExitStream) SendAndClose(m *ExitProgress) error {
if err := x.MsgSend(m, drpcEncoding_File_gracefulexit_proto{}); err != nil {
return err
}
return x.CloseSend()
}
type DRPCNodeGracefulExit_GetExitProgressStream interface {
drpc.Stream
SendAndClose(*GetExitProgressResponse) error
}
type drpcNodeGracefulExit_GetExitProgressStream struct {
drpc.Stream
}
func (x *drpcNodeGracefulExit_GetExitProgressStream) SendAndClose(m *GetExitProgressResponse) error {
if err := x.MsgSend(m, drpcEncoding_File_gracefulexit_proto{}); err != nil {
return err
}
return x.CloseSend()
}
type DRPCNodeGracefulExit_GracefulExitFeasibilityStream interface {
drpc.Stream
SendAndClose(*GracefulExitFeasibilityResponse) error
}
type drpcNodeGracefulExit_GracefulExitFeasibilityStream struct {
drpc.Stream
}
func (x *drpcNodeGracefulExit_GracefulExitFeasibilityStream) SendAndClose(m *GracefulExitFeasibilityResponse) error {
if err := x.MsgSend(m, drpcEncoding_File_gracefulexit_proto{}); err != nil {
return err
}
return x.CloseSend()
}

View File

@ -4,14 +4,11 @@
package internalpb
import (
context "context"
fmt "fmt"
math "math"
time "time"
proto "github.com/gogo/protobuf/proto"
drpc "storj.io/drpc"
)
// Reference imports to suppress errors if they are not otherwise used.
@ -327,116 +324,3 @@ var fileDescriptor_a07d9034b2dd9d26 = []byte{
0x74, 0x89, 0xcd, 0xe2, 0xb8, 0x6a, 0xa7, 0x72, 0xfc, 0x27, 0x00, 0x00, 0xff, 0xff, 0x8e, 0x0f,
0xce, 0xb4, 0xf0, 0x04, 0x00, 0x00,
}
// --- DRPC BEGIN ---
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, "/storagenode.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, "/storagenode.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
Stats(context.Context, *StatsRequest) (*StatSummaryResponse, error)
// Dashboard returns stats for a specific storagenode
Dashboard(context.Context, *DashboardRequest) (*DashboardResponse, error)
}
type DRPCPieceStoreInspectorDescription struct{}
func (DRPCPieceStoreInspectorDescription) NumMethods() int { return 2 }
func (DRPCPieceStoreInspectorDescription) Method(n int) (string, drpc.Receiver, interface{}, bool) {
switch n {
case 0:
return "/storagenode.inspector.PieceStoreInspector/Stats",
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCPieceStoreInspectorServer).
Stats(
ctx,
in1.(*StatsRequest),
)
}, DRPCPieceStoreInspectorServer.Stats, true
case 1:
return "/storagenode.inspector.PieceStoreInspector/Dashboard",
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCPieceStoreInspectorServer).
Dashboard(
ctx,
in1.(*DashboardRequest),
)
}, DRPCPieceStoreInspectorServer.Dashboard, true
default:
return "", nil, nil, false
}
}
func DRPCRegisterPieceStoreInspector(mux drpc.Mux, impl DRPCPieceStoreInspectorServer) error {
return mux.Register(impl, DRPCPieceStoreInspectorDescription{})
}
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()
}
// --- DRPC END ---

View File

@ -0,0 +1,155 @@
// Code generated by protoc-gen-go-drpc. DO NOT EDIT.
// protoc-gen-go-drpc version: v0.0.19
// source: inspector.proto
package internalpb
import (
bytes "bytes"
context "context"
errors "errors"
jsonpb "github.com/gogo/protobuf/jsonpb"
proto "github.com/gogo/protobuf/proto"
drpc "storj.io/drpc"
drpcerr "storj.io/drpc/drpcerr"
)
type drpcEncoding_File_inspector_proto struct{}
func (drpcEncoding_File_inspector_proto) Marshal(msg drpc.Message) ([]byte, error) {
return proto.Marshal(msg.(proto.Message))
}
func (drpcEncoding_File_inspector_proto) Unmarshal(buf []byte, msg drpc.Message) error {
return proto.Unmarshal(buf, msg.(proto.Message))
}
func (drpcEncoding_File_inspector_proto) JSONMarshal(msg drpc.Message) ([]byte, error) {
var buf bytes.Buffer
err := new(jsonpb.Marshaler).Marshal(&buf, msg.(proto.Message))
if err != nil {
return nil, err
}
return buf.Bytes(), nil
}
func (drpcEncoding_File_inspector_proto) JSONUnmarshal(buf []byte, msg drpc.Message) error {
return jsonpb.Unmarshal(bytes.NewReader(buf), msg.(proto.Message))
}
type DRPCPieceStoreInspectorClient interface {
DRPCConn() drpc.Conn
Stats(ctx context.Context, in *StatsRequest) (*StatSummaryResponse, error)
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, "/storagenode.inspector.PieceStoreInspector/Stats", drpcEncoding_File_inspector_proto{}, 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, "/storagenode.inspector.PieceStoreInspector/Dashboard", drpcEncoding_File_inspector_proto{}, in, out)
if err != nil {
return nil, err
}
return out, nil
}
type DRPCPieceStoreInspectorServer interface {
Stats(context.Context, *StatsRequest) (*StatSummaryResponse, error)
Dashboard(context.Context, *DashboardRequest) (*DashboardResponse, error)
}
type DRPCPieceStoreInspectorUnimplementedServer struct{}
func (s *DRPCPieceStoreInspectorUnimplementedServer) Stats(context.Context, *StatsRequest) (*StatSummaryResponse, error) {
return nil, drpcerr.WithCode(errors.New("Unimplemented"), 12)
}
func (s *DRPCPieceStoreInspectorUnimplementedServer) Dashboard(context.Context, *DashboardRequest) (*DashboardResponse, error) {
return nil, drpcerr.WithCode(errors.New("Unimplemented"), 12)
}
type DRPCPieceStoreInspectorDescription struct{}
func (DRPCPieceStoreInspectorDescription) NumMethods() int { return 2 }
func (DRPCPieceStoreInspectorDescription) Method(n int) (string, drpc.Encoding, drpc.Receiver, interface{}, bool) {
switch n {
case 0:
return "/storagenode.inspector.PieceStoreInspector/Stats", drpcEncoding_File_inspector_proto{},
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCPieceStoreInspectorServer).
Stats(
ctx,
in1.(*StatsRequest),
)
}, DRPCPieceStoreInspectorServer.Stats, true
case 1:
return "/storagenode.inspector.PieceStoreInspector/Dashboard", drpcEncoding_File_inspector_proto{},
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCPieceStoreInspectorServer).
Dashboard(
ctx,
in1.(*DashboardRequest),
)
}, DRPCPieceStoreInspectorServer.Dashboard, true
default:
return "", nil, nil, nil, false
}
}
func DRPCRegisterPieceStoreInspector(mux drpc.Mux, impl DRPCPieceStoreInspectorServer) error {
return mux.Register(impl, DRPCPieceStoreInspectorDescription{})
}
type DRPCPieceStoreInspector_StatsStream interface {
drpc.Stream
SendAndClose(*StatSummaryResponse) error
}
type drpcPieceStoreInspector_StatsStream struct {
drpc.Stream
}
func (x *drpcPieceStoreInspector_StatsStream) SendAndClose(m *StatSummaryResponse) error {
if err := x.MsgSend(m, drpcEncoding_File_inspector_proto{}); err != nil {
return err
}
return x.CloseSend()
}
type DRPCPieceStoreInspector_DashboardStream interface {
drpc.Stream
SendAndClose(*DashboardResponse) error
}
type drpcPieceStoreInspector_DashboardStream struct {
drpc.Stream
}
func (x *drpcPieceStoreInspector_DashboardStream) SendAndClose(m *DashboardResponse) error {
if err := x.MsgSend(m, drpcEncoding_File_inspector_proto{}); err != nil {
return err
}
return x.CloseSend()
}