-
Notifications
You must be signed in to change notification settings - Fork 1
/
wgrpcd_grpc.pb.go
313 lines (287 loc) · 11.6 KB
/
wgrpcd_grpc.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
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
package wgrpcd
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion7
// WireguardRPCClient is the client API for WireguardRPC service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type WireguardRPCClient interface {
ChangeListenPort(ctx context.Context, in *ChangeListenPortRequest, opts ...grpc.CallOption) (*ChangeListenPortResponse, error)
CreatePeer(ctx context.Context, in *CreatePeerRequest, opts ...grpc.CallOption) (*CreatePeerResponse, error)
RekeyPeer(ctx context.Context, in *RekeyPeerRequest, opts ...grpc.CallOption) (*RekeyPeerResponse, error)
RemovePeer(ctx context.Context, in *RemovePeerRequest, opts ...grpc.CallOption) (*RemovePeerResponse, error)
ListPeers(ctx context.Context, in *ListPeersRequest, opts ...grpc.CallOption) (*ListPeersResponse, error)
Devices(ctx context.Context, in *DevicesRequest, opts ...grpc.CallOption) (*DevicesResponse, error)
Import(ctx context.Context, in *ImportRequest, opts ...grpc.CallOption) (*ImportResponse, error)
}
type wireguardRPCClient struct {
cc grpc.ClientConnInterface
}
func NewWireguardRPCClient(cc grpc.ClientConnInterface) WireguardRPCClient {
return &wireguardRPCClient{cc}
}
func (c *wireguardRPCClient) ChangeListenPort(ctx context.Context, in *ChangeListenPortRequest, opts ...grpc.CallOption) (*ChangeListenPortResponse, error) {
out := new(ChangeListenPortResponse)
err := c.cc.Invoke(ctx, "/wgrpcd.WireguardRPC/ChangeListenPort", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *wireguardRPCClient) CreatePeer(ctx context.Context, in *CreatePeerRequest, opts ...grpc.CallOption) (*CreatePeerResponse, error) {
out := new(CreatePeerResponse)
err := c.cc.Invoke(ctx, "/wgrpcd.WireguardRPC/CreatePeer", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *wireguardRPCClient) RekeyPeer(ctx context.Context, in *RekeyPeerRequest, opts ...grpc.CallOption) (*RekeyPeerResponse, error) {
out := new(RekeyPeerResponse)
err := c.cc.Invoke(ctx, "/wgrpcd.WireguardRPC/RekeyPeer", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *wireguardRPCClient) RemovePeer(ctx context.Context, in *RemovePeerRequest, opts ...grpc.CallOption) (*RemovePeerResponse, error) {
out := new(RemovePeerResponse)
err := c.cc.Invoke(ctx, "/wgrpcd.WireguardRPC/RemovePeer", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *wireguardRPCClient) ListPeers(ctx context.Context, in *ListPeersRequest, opts ...grpc.CallOption) (*ListPeersResponse, error) {
out := new(ListPeersResponse)
err := c.cc.Invoke(ctx, "/wgrpcd.WireguardRPC/ListPeers", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *wireguardRPCClient) Devices(ctx context.Context, in *DevicesRequest, opts ...grpc.CallOption) (*DevicesResponse, error) {
out := new(DevicesResponse)
err := c.cc.Invoke(ctx, "/wgrpcd.WireguardRPC/Devices", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *wireguardRPCClient) Import(ctx context.Context, in *ImportRequest, opts ...grpc.CallOption) (*ImportResponse, error) {
out := new(ImportResponse)
err := c.cc.Invoke(ctx, "/wgrpcd.WireguardRPC/Import", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// WireguardRPCServer is the server API for WireguardRPC service.
// All implementations must embed UnimplementedWireguardRPCServer
// for forward compatibility
type WireguardRPCServer interface {
ChangeListenPort(context.Context, *ChangeListenPortRequest) (*ChangeListenPortResponse, error)
CreatePeer(context.Context, *CreatePeerRequest) (*CreatePeerResponse, error)
RekeyPeer(context.Context, *RekeyPeerRequest) (*RekeyPeerResponse, error)
RemovePeer(context.Context, *RemovePeerRequest) (*RemovePeerResponse, error)
ListPeers(context.Context, *ListPeersRequest) (*ListPeersResponse, error)
Devices(context.Context, *DevicesRequest) (*DevicesResponse, error)
Import(context.Context, *ImportRequest) (*ImportResponse, error)
mustEmbedUnimplementedWireguardRPCServer()
}
// UnimplementedWireguardRPCServer must be embedded to have forward compatible implementations.
type UnimplementedWireguardRPCServer struct {
}
func (UnimplementedWireguardRPCServer) ChangeListenPort(context.Context, *ChangeListenPortRequest) (*ChangeListenPortResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ChangeListenPort not implemented")
}
func (UnimplementedWireguardRPCServer) CreatePeer(context.Context, *CreatePeerRequest) (*CreatePeerResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreatePeer not implemented")
}
func (UnimplementedWireguardRPCServer) RekeyPeer(context.Context, *RekeyPeerRequest) (*RekeyPeerResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method RekeyPeer not implemented")
}
func (UnimplementedWireguardRPCServer) RemovePeer(context.Context, *RemovePeerRequest) (*RemovePeerResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method RemovePeer not implemented")
}
func (UnimplementedWireguardRPCServer) ListPeers(context.Context, *ListPeersRequest) (*ListPeersResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListPeers not implemented")
}
func (UnimplementedWireguardRPCServer) Devices(context.Context, *DevicesRequest) (*DevicesResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Devices not implemented")
}
func (UnimplementedWireguardRPCServer) Import(context.Context, *ImportRequest) (*ImportResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Import not implemented")
}
func (UnimplementedWireguardRPCServer) mustEmbedUnimplementedWireguardRPCServer() {}
// UnsafeWireguardRPCServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to WireguardRPCServer will
// result in compilation errors.
type UnsafeWireguardRPCServer interface {
mustEmbedUnimplementedWireguardRPCServer()
}
func RegisterWireguardRPCServer(s grpc.ServiceRegistrar, srv WireguardRPCServer) {
s.RegisterService(&_WireguardRPC_serviceDesc, srv)
}
func _WireguardRPC_ChangeListenPort_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ChangeListenPortRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WireguardRPCServer).ChangeListenPort(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/wgrpcd.WireguardRPC/ChangeListenPort",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WireguardRPCServer).ChangeListenPort(ctx, req.(*ChangeListenPortRequest))
}
return interceptor(ctx, in, info, handler)
}
func _WireguardRPC_CreatePeer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreatePeerRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WireguardRPCServer).CreatePeer(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/wgrpcd.WireguardRPC/CreatePeer",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WireguardRPCServer).CreatePeer(ctx, req.(*CreatePeerRequest))
}
return interceptor(ctx, in, info, handler)
}
func _WireguardRPC_RekeyPeer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(RekeyPeerRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WireguardRPCServer).RekeyPeer(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/wgrpcd.WireguardRPC/RekeyPeer",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WireguardRPCServer).RekeyPeer(ctx, req.(*RekeyPeerRequest))
}
return interceptor(ctx, in, info, handler)
}
func _WireguardRPC_RemovePeer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(RemovePeerRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WireguardRPCServer).RemovePeer(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/wgrpcd.WireguardRPC/RemovePeer",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WireguardRPCServer).RemovePeer(ctx, req.(*RemovePeerRequest))
}
return interceptor(ctx, in, info, handler)
}
func _WireguardRPC_ListPeers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListPeersRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WireguardRPCServer).ListPeers(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/wgrpcd.WireguardRPC/ListPeers",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WireguardRPCServer).ListPeers(ctx, req.(*ListPeersRequest))
}
return interceptor(ctx, in, info, handler)
}
func _WireguardRPC_Devices_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DevicesRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WireguardRPCServer).Devices(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/wgrpcd.WireguardRPC/Devices",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WireguardRPCServer).Devices(ctx, req.(*DevicesRequest))
}
return interceptor(ctx, in, info, handler)
}
func _WireguardRPC_Import_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ImportRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WireguardRPCServer).Import(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/wgrpcd.WireguardRPC/Import",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WireguardRPCServer).Import(ctx, req.(*ImportRequest))
}
return interceptor(ctx, in, info, handler)
}
var _WireguardRPC_serviceDesc = grpc.ServiceDesc{
ServiceName: "wgrpcd.WireguardRPC",
HandlerType: (*WireguardRPCServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "ChangeListenPort",
Handler: _WireguardRPC_ChangeListenPort_Handler,
},
{
MethodName: "CreatePeer",
Handler: _WireguardRPC_CreatePeer_Handler,
},
{
MethodName: "RekeyPeer",
Handler: _WireguardRPC_RekeyPeer_Handler,
},
{
MethodName: "RemovePeer",
Handler: _WireguardRPC_RemovePeer_Handler,
},
{
MethodName: "ListPeers",
Handler: _WireguardRPC_ListPeers_Handler,
},
{
MethodName: "Devices",
Handler: _WireguardRPC_Devices_Handler,
},
{
MethodName: "Import",
Handler: _WireguardRPC_Import_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "wgrpcd.proto",
}