/
delegated_repair_drpc.pb.go
115 lines (90 loc) · 3.4 KB
/
delegated_repair_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
// Code generated by protoc-gen-go-drpc. DO NOT EDIT.
// protoc-gen-go-drpc version: v0.0.33
// 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"), drpcerr.Unimplemented)
}
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()
}