-
Notifications
You must be signed in to change notification settings - Fork 8
/
api_drpc.pb.go
163 lines (132 loc) · 5.22 KB
/
api_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
// Code generated by protoc-gen-go-drpc. DO NOT EDIT.
// protoc-gen-go-drpc version: v0.0.32
// source: github.com/aperturerobotics/bifrost/peer/api/api.proto
package peer_api
import (
context "context"
errors "errors"
drpc1 "github.com/planetscale/vtprotobuf/codec/drpc"
drpc "storj.io/drpc"
drpcerr "storj.io/drpc/drpcerr"
)
type drpcEncoding_File_github_com_aperturerobotics_bifrost_peer_api_api_proto struct{}
func (drpcEncoding_File_github_com_aperturerobotics_bifrost_peer_api_api_proto) Marshal(msg drpc.Message) ([]byte, error) {
return drpc1.Marshal(msg)
}
func (drpcEncoding_File_github_com_aperturerobotics_bifrost_peer_api_api_proto) Unmarshal(buf []byte, msg drpc.Message) error {
return drpc1.Unmarshal(buf, msg)
}
type DRPCPeerServiceClient interface {
DRPCConn() drpc.Conn
Identify(ctx context.Context, in *IdentifyRequest) (DRPCPeerService_IdentifyClient, error)
GetPeerInfo(ctx context.Context, in *GetPeerInfoRequest) (*GetPeerInfoResponse, error)
}
type drpcPeerServiceClient struct {
cc drpc.Conn
}
func NewDRPCPeerServiceClient(cc drpc.Conn) DRPCPeerServiceClient {
return &drpcPeerServiceClient{cc}
}
func (c *drpcPeerServiceClient) DRPCConn() drpc.Conn { return c.cc }
func (c *drpcPeerServiceClient) Identify(ctx context.Context, in *IdentifyRequest) (DRPCPeerService_IdentifyClient, error) {
stream, err := c.cc.NewStream(ctx, "/peer.api.PeerService/Identify", drpcEncoding_File_github_com_aperturerobotics_bifrost_peer_api_api_proto{})
if err != nil {
return nil, err
}
x := &drpcPeerService_IdentifyClient{stream}
if err := x.MsgSend(in, drpcEncoding_File_github_com_aperturerobotics_bifrost_peer_api_api_proto{}); err != nil {
return nil, err
}
if err := x.CloseSend(); err != nil {
return nil, err
}
return x, nil
}
type DRPCPeerService_IdentifyClient interface {
drpc.Stream
Recv() (*IdentifyResponse, error)
}
type drpcPeerService_IdentifyClient struct {
drpc.Stream
}
func (x *drpcPeerService_IdentifyClient) Recv() (*IdentifyResponse, error) {
m := new(IdentifyResponse)
if err := x.MsgRecv(m, drpcEncoding_File_github_com_aperturerobotics_bifrost_peer_api_api_proto{}); err != nil {
return nil, err
}
return m, nil
}
func (x *drpcPeerService_IdentifyClient) RecvMsg(m *IdentifyResponse) error {
return x.MsgRecv(m, drpcEncoding_File_github_com_aperturerobotics_bifrost_peer_api_api_proto{})
}
func (c *drpcPeerServiceClient) GetPeerInfo(ctx context.Context, in *GetPeerInfoRequest) (*GetPeerInfoResponse, error) {
out := new(GetPeerInfoResponse)
err := c.cc.Invoke(ctx, "/peer.api.PeerService/GetPeerInfo", drpcEncoding_File_github_com_aperturerobotics_bifrost_peer_api_api_proto{}, in, out)
if err != nil {
return nil, err
}
return out, nil
}
type DRPCPeerServiceServer interface {
Identify(*IdentifyRequest, DRPCPeerService_IdentifyStream) error
GetPeerInfo(context.Context, *GetPeerInfoRequest) (*GetPeerInfoResponse, error)
}
type DRPCPeerServiceUnimplementedServer struct{}
func (s *DRPCPeerServiceUnimplementedServer) Identify(*IdentifyRequest, DRPCPeerService_IdentifyStream) error {
return drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented)
}
func (s *DRPCPeerServiceUnimplementedServer) GetPeerInfo(context.Context, *GetPeerInfoRequest) (*GetPeerInfoResponse, error) {
return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented)
}
type DRPCPeerServiceDescription struct{}
func (DRPCPeerServiceDescription) NumMethods() int { return 2 }
func (DRPCPeerServiceDescription) Method(n int) (string, drpc.Encoding, drpc.Receiver, interface{}, bool) {
switch n {
case 0:
return "/peer.api.PeerService/Identify", drpcEncoding_File_github_com_aperturerobotics_bifrost_peer_api_api_proto{},
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return nil, srv.(DRPCPeerServiceServer).
Identify(
in1.(*IdentifyRequest),
&drpcPeerService_IdentifyStream{in2.(drpc.Stream)},
)
}, DRPCPeerServiceServer.Identify, true
case 1:
return "/peer.api.PeerService/GetPeerInfo", drpcEncoding_File_github_com_aperturerobotics_bifrost_peer_api_api_proto{},
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCPeerServiceServer).
GetPeerInfo(
ctx,
in1.(*GetPeerInfoRequest),
)
}, DRPCPeerServiceServer.GetPeerInfo, true
default:
return "", nil, nil, nil, false
}
}
func DRPCRegisterPeerService(mux drpc.Mux, impl DRPCPeerServiceServer) error {
return mux.Register(impl, DRPCPeerServiceDescription{})
}
type DRPCPeerService_IdentifyStream interface {
drpc.Stream
Send(*IdentifyResponse) error
}
type drpcPeerService_IdentifyStream struct {
drpc.Stream
}
func (x *drpcPeerService_IdentifyStream) Send(m *IdentifyResponse) error {
return x.MsgSend(m, drpcEncoding_File_github_com_aperturerobotics_bifrost_peer_api_api_proto{})
}
type DRPCPeerService_GetPeerInfoStream interface {
drpc.Stream
SendAndClose(*GetPeerInfoResponse) error
}
type drpcPeerService_GetPeerInfoStream struct {
drpc.Stream
}
func (x *drpcPeerService_GetPeerInfoStream) SendAndClose(m *GetPeerInfoResponse) error {
if err := x.MsgSend(m, drpcEncoding_File_github_com_aperturerobotics_bifrost_peer_api_api_proto{}); err != nil {
return err
}
return x.CloseSend()
}