-
Notifications
You must be signed in to change notification settings - Fork 402
/
gracefulexit_drpc.pb.go
235 lines (195 loc) · 8.44 KB
/
gracefulexit_drpc.pb.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
// Code generated by protoc-gen-go-drpc. DO NOT EDIT.
// protoc-gen-go-drpc version: v0.0.20
// 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()
}