1
|
|
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT. |
2
|
|
|
// versions: |
3
|
|
|
// - protoc-gen-go-grpc v1.4.0 |
4
|
|
|
// - protoc (unknown) |
5
|
|
|
// source: base/v1/service.proto |
6
|
|
|
|
7
|
|
|
package basev1 |
8
|
|
|
|
9
|
|
|
import ( |
10
|
|
|
context "context" |
11
|
|
|
grpc "google.golang.org/grpc" |
12
|
|
|
codes "google.golang.org/grpc/codes" |
13
|
|
|
status "google.golang.org/grpc/status" |
14
|
|
|
) |
15
|
|
|
|
16
|
|
|
// This is a compile-time assertion to ensure that this generated file |
17
|
|
|
// is compatible with the grpc package it is being compiled against. |
18
|
|
|
// Requires gRPC-Go v1.62.0 or later. |
19
|
|
|
const _ = grpc.SupportPackageIsVersion8 |
20
|
|
|
|
21
|
|
|
const ( |
22
|
|
|
Permission_Check_FullMethodName = "/base.v1.Permission/Check" |
23
|
|
|
Permission_Expand_FullMethodName = "/base.v1.Permission/Expand" |
24
|
|
|
Permission_LookupEntity_FullMethodName = "/base.v1.Permission/LookupEntity" |
25
|
|
|
Permission_LookupEntityStream_FullMethodName = "/base.v1.Permission/LookupEntityStream" |
26
|
|
|
Permission_LookupSubject_FullMethodName = "/base.v1.Permission/LookupSubject" |
27
|
|
|
Permission_SubjectPermission_FullMethodName = "/base.v1.Permission/SubjectPermission" |
28
|
|
|
) |
29
|
|
|
|
30
|
|
|
// PermissionClient is the client API for Permission service. |
31
|
|
|
// |
32
|
|
|
// 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. |
33
|
|
|
// |
34
|
|
|
// Permission service contains methods to interact with permissions. |
35
|
|
|
type PermissionClient interface { |
36
|
|
|
// Check method receives a PermissionCheckRequest and returns a PermissionCheckResponse. |
37
|
|
|
// It is used to determine whether a specific user has permission to perform an action on a resource. |
38
|
|
|
// For example, "Can the user 1 push to repository 1?" |
39
|
|
|
Check(ctx context.Context, in *PermissionCheckRequest, opts ...grpc.CallOption) (*PermissionCheckResponse, error) |
40
|
|
|
// Expand method receives a PermissionExpandRequest and returns a PermissionExpandResponse. |
41
|
|
|
// It expands relationships according to the schema provided. |
42
|
|
|
Expand(ctx context.Context, in *PermissionExpandRequest, opts ...grpc.CallOption) (*PermissionExpandResponse, error) |
43
|
|
|
// LookupEntity method receives a PermissionLookupEntityRequest and returns a PermissionLookupEntityResponse. |
44
|
|
|
// It is used to retrieve an entity by its identifier. |
45
|
|
|
LookupEntity(ctx context.Context, in *PermissionLookupEntityRequest, opts ...grpc.CallOption) (*PermissionLookupEntityResponse, error) |
46
|
|
|
// LookupEntityStream method receives a PermissionLookupEntityRequest and streams a series of PermissionLookupEntityStreamResponse messages. |
47
|
|
|
// It is used to retrieve entities by their identifiers in a streaming fashion. |
48
|
|
|
LookupEntityStream(ctx context.Context, in *PermissionLookupEntityRequest, opts ...grpc.CallOption) (Permission_LookupEntityStreamClient, error) |
49
|
|
|
// LookupSubject method receives a PermissionLookupSubjectRequest and returns a PermissionLookupSubjectResponse. |
50
|
|
|
// It is used to retrieve a subject by its identifier. |
51
|
|
|
LookupSubject(ctx context.Context, in *PermissionLookupSubjectRequest, opts ...grpc.CallOption) (*PermissionLookupSubjectResponse, error) |
52
|
|
|
// SubjectPermission method receives a PermissionSubjectPermissionRequest and returns a PermissionSubjectPermissionResponse. |
53
|
|
|
// It is used to retrieve permissions related to a specific subject. |
54
|
|
|
SubjectPermission(ctx context.Context, in *PermissionSubjectPermissionRequest, opts ...grpc.CallOption) (*PermissionSubjectPermissionResponse, error) |
55
|
|
|
} |
56
|
|
|
|
57
|
|
|
type permissionClient struct { |
58
|
|
|
cc grpc.ClientConnInterface |
59
|
|
|
} |
60
|
|
|
|
61
|
|
|
func NewPermissionClient(cc grpc.ClientConnInterface) PermissionClient { |
62
|
|
|
return &permissionClient{cc} |
63
|
|
|
} |
64
|
|
|
|
65
|
|
|
func (c *permissionClient) Check(ctx context.Context, in *PermissionCheckRequest, opts ...grpc.CallOption) (*PermissionCheckResponse, error) { |
66
|
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
67
|
|
|
out := new(PermissionCheckResponse) |
68
|
|
|
err := c.cc.Invoke(ctx, Permission_Check_FullMethodName, in, out, cOpts...) |
69
|
|
|
if err != nil { |
70
|
|
|
return nil, err |
71
|
|
|
} |
72
|
|
|
return out, nil |
73
|
|
|
} |
74
|
|
|
|
75
|
|
|
func (c *permissionClient) Expand(ctx context.Context, in *PermissionExpandRequest, opts ...grpc.CallOption) (*PermissionExpandResponse, error) { |
76
|
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
77
|
|
|
out := new(PermissionExpandResponse) |
78
|
|
|
err := c.cc.Invoke(ctx, Permission_Expand_FullMethodName, in, out, cOpts...) |
79
|
|
|
if err != nil { |
80
|
|
|
return nil, err |
81
|
|
|
} |
82
|
|
|
return out, nil |
83
|
|
|
} |
84
|
|
|
|
85
|
|
|
func (c *permissionClient) LookupEntity(ctx context.Context, in *PermissionLookupEntityRequest, opts ...grpc.CallOption) (*PermissionLookupEntityResponse, error) { |
86
|
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
87
|
|
|
out := new(PermissionLookupEntityResponse) |
88
|
|
|
err := c.cc.Invoke(ctx, Permission_LookupEntity_FullMethodName, in, out, cOpts...) |
89
|
|
|
if err != nil { |
90
|
|
|
return nil, err |
91
|
|
|
} |
92
|
|
|
return out, nil |
93
|
|
|
} |
94
|
|
|
|
95
|
|
|
func (c *permissionClient) LookupEntityStream(ctx context.Context, in *PermissionLookupEntityRequest, opts ...grpc.CallOption) (Permission_LookupEntityStreamClient, error) { |
96
|
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
97
|
|
|
stream, err := c.cc.NewStream(ctx, &Permission_ServiceDesc.Streams[0], Permission_LookupEntityStream_FullMethodName, cOpts...) |
98
|
|
|
if err != nil { |
99
|
|
|
return nil, err |
100
|
|
|
} |
101
|
|
|
x := &permissionLookupEntityStreamClient{ClientStream: stream} |
102
|
|
|
if err := x.ClientStream.SendMsg(in); err != nil { |
103
|
|
|
return nil, err |
104
|
|
|
} |
105
|
|
|
if err := x.ClientStream.CloseSend(); err != nil { |
106
|
|
|
return nil, err |
107
|
|
|
} |
108
|
|
|
return x, nil |
109
|
|
|
} |
110
|
|
|
|
111
|
|
|
type Permission_LookupEntityStreamClient interface { |
112
|
|
|
Recv() (*PermissionLookupEntityStreamResponse, error) |
113
|
|
|
grpc.ClientStream |
114
|
|
|
} |
115
|
|
|
|
116
|
|
|
type permissionLookupEntityStreamClient struct { |
117
|
|
|
grpc.ClientStream |
118
|
|
|
} |
119
|
|
|
|
120
|
|
|
func (x *permissionLookupEntityStreamClient) Recv() (*PermissionLookupEntityStreamResponse, error) { |
121
|
|
|
m := new(PermissionLookupEntityStreamResponse) |
122
|
|
|
if err := x.ClientStream.RecvMsg(m); err != nil { |
123
|
|
|
return nil, err |
124
|
|
|
} |
125
|
|
|
return m, nil |
126
|
|
|
} |
127
|
|
|
|
128
|
|
|
func (c *permissionClient) LookupSubject(ctx context.Context, in *PermissionLookupSubjectRequest, opts ...grpc.CallOption) (*PermissionLookupSubjectResponse, error) { |
129
|
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
130
|
|
|
out := new(PermissionLookupSubjectResponse) |
131
|
|
|
err := c.cc.Invoke(ctx, Permission_LookupSubject_FullMethodName, in, out, cOpts...) |
132
|
|
|
if err != nil { |
133
|
|
|
return nil, err |
134
|
|
|
} |
135
|
|
|
return out, nil |
136
|
|
|
} |
137
|
|
|
|
138
|
|
|
func (c *permissionClient) SubjectPermission(ctx context.Context, in *PermissionSubjectPermissionRequest, opts ...grpc.CallOption) (*PermissionSubjectPermissionResponse, error) { |
139
|
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
140
|
|
|
out := new(PermissionSubjectPermissionResponse) |
141
|
|
|
err := c.cc.Invoke(ctx, Permission_SubjectPermission_FullMethodName, in, out, cOpts...) |
142
|
|
|
if err != nil { |
143
|
|
|
return nil, err |
144
|
|
|
} |
145
|
|
|
return out, nil |
146
|
|
|
} |
147
|
|
|
|
148
|
|
|
// PermissionServer is the server API for Permission service. |
149
|
|
|
// All implementations must embed UnimplementedPermissionServer |
150
|
|
|
// for forward compatibility |
151
|
|
|
// |
152
|
|
|
// Permission service contains methods to interact with permissions. |
153
|
|
|
type PermissionServer interface { |
154
|
|
|
// Check method receives a PermissionCheckRequest and returns a PermissionCheckResponse. |
155
|
|
|
// It is used to determine whether a specific user has permission to perform an action on a resource. |
156
|
|
|
// For example, "Can the user 1 push to repository 1?" |
157
|
|
|
Check(context.Context, *PermissionCheckRequest) (*PermissionCheckResponse, error) |
158
|
|
|
// Expand method receives a PermissionExpandRequest and returns a PermissionExpandResponse. |
159
|
|
|
// It expands relationships according to the schema provided. |
160
|
|
|
Expand(context.Context, *PermissionExpandRequest) (*PermissionExpandResponse, error) |
161
|
|
|
// LookupEntity method receives a PermissionLookupEntityRequest and returns a PermissionLookupEntityResponse. |
162
|
|
|
// It is used to retrieve an entity by its identifier. |
163
|
|
|
LookupEntity(context.Context, *PermissionLookupEntityRequest) (*PermissionLookupEntityResponse, error) |
164
|
|
|
// LookupEntityStream method receives a PermissionLookupEntityRequest and streams a series of PermissionLookupEntityStreamResponse messages. |
165
|
|
|
// It is used to retrieve entities by their identifiers in a streaming fashion. |
166
|
|
|
LookupEntityStream(*PermissionLookupEntityRequest, Permission_LookupEntityStreamServer) error |
167
|
|
|
// LookupSubject method receives a PermissionLookupSubjectRequest and returns a PermissionLookupSubjectResponse. |
168
|
|
|
// It is used to retrieve a subject by its identifier. |
169
|
|
|
LookupSubject(context.Context, *PermissionLookupSubjectRequest) (*PermissionLookupSubjectResponse, error) |
170
|
|
|
// SubjectPermission method receives a PermissionSubjectPermissionRequest and returns a PermissionSubjectPermissionResponse. |
171
|
|
|
// It is used to retrieve permissions related to a specific subject. |
172
|
|
|
SubjectPermission(context.Context, *PermissionSubjectPermissionRequest) (*PermissionSubjectPermissionResponse, error) |
173
|
|
|
mustEmbedUnimplementedPermissionServer() |
174
|
|
|
} |
175
|
|
|
|
176
|
|
|
// UnimplementedPermissionServer must be embedded to have forward compatible implementations. |
177
|
|
|
type UnimplementedPermissionServer struct { |
178
|
|
|
} |
179
|
|
|
|
180
|
|
|
func (UnimplementedPermissionServer) Check(context.Context, *PermissionCheckRequest) (*PermissionCheckResponse, error) { |
181
|
|
|
return nil, status.Errorf(codes.Unimplemented, "method Check not implemented") |
182
|
|
|
} |
183
|
|
|
func (UnimplementedPermissionServer) Expand(context.Context, *PermissionExpandRequest) (*PermissionExpandResponse, error) { |
184
|
|
|
return nil, status.Errorf(codes.Unimplemented, "method Expand not implemented") |
185
|
|
|
} |
186
|
|
|
func (UnimplementedPermissionServer) LookupEntity(context.Context, *PermissionLookupEntityRequest) (*PermissionLookupEntityResponse, error) { |
187
|
|
|
return nil, status.Errorf(codes.Unimplemented, "method LookupEntity not implemented") |
188
|
|
|
} |
189
|
|
|
func (UnimplementedPermissionServer) LookupEntityStream(*PermissionLookupEntityRequest, Permission_LookupEntityStreamServer) error { |
190
|
|
|
return status.Errorf(codes.Unimplemented, "method LookupEntityStream not implemented") |
191
|
|
|
} |
192
|
|
|
func (UnimplementedPermissionServer) LookupSubject(context.Context, *PermissionLookupSubjectRequest) (*PermissionLookupSubjectResponse, error) { |
193
|
|
|
return nil, status.Errorf(codes.Unimplemented, "method LookupSubject not implemented") |
194
|
|
|
} |
195
|
|
|
func (UnimplementedPermissionServer) SubjectPermission(context.Context, *PermissionSubjectPermissionRequest) (*PermissionSubjectPermissionResponse, error) { |
196
|
|
|
return nil, status.Errorf(codes.Unimplemented, "method SubjectPermission not implemented") |
197
|
|
|
} |
198
|
|
|
func (UnimplementedPermissionServer) mustEmbedUnimplementedPermissionServer() {} |
199
|
|
|
|
200
|
|
|
// UnsafePermissionServer may be embedded to opt out of forward compatibility for this service. |
201
|
|
|
// Use of this interface is not recommended, as added methods to PermissionServer will |
202
|
|
|
// result in compilation errors. |
203
|
|
|
type UnsafePermissionServer interface { |
204
|
|
|
mustEmbedUnimplementedPermissionServer() |
205
|
|
|
} |
206
|
|
|
|
207
|
|
|
func RegisterPermissionServer(s grpc.ServiceRegistrar, srv PermissionServer) { |
208
|
|
|
s.RegisterService(&Permission_ServiceDesc, srv) |
209
|
|
|
} |
210
|
|
|
|
211
|
|
|
func _Permission_Check_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
212
|
|
|
in := new(PermissionCheckRequest) |
213
|
|
|
if err := dec(in); err != nil { |
214
|
|
|
return nil, err |
215
|
|
|
} |
216
|
|
|
if interceptor == nil { |
217
|
|
|
return srv.(PermissionServer).Check(ctx, in) |
218
|
|
|
} |
219
|
|
|
info := &grpc.UnaryServerInfo{ |
220
|
|
|
Server: srv, |
221
|
|
|
FullMethod: Permission_Check_FullMethodName, |
222
|
|
|
} |
223
|
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
224
|
|
|
return srv.(PermissionServer).Check(ctx, req.(*PermissionCheckRequest)) |
225
|
|
|
} |
226
|
|
|
return interceptor(ctx, in, info, handler) |
227
|
|
|
} |
228
|
|
|
|
229
|
|
|
func _Permission_Expand_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
230
|
|
|
in := new(PermissionExpandRequest) |
231
|
|
|
if err := dec(in); err != nil { |
232
|
|
|
return nil, err |
233
|
|
|
} |
234
|
|
|
if interceptor == nil { |
235
|
|
|
return srv.(PermissionServer).Expand(ctx, in) |
236
|
|
|
} |
237
|
|
|
info := &grpc.UnaryServerInfo{ |
238
|
|
|
Server: srv, |
239
|
|
|
FullMethod: Permission_Expand_FullMethodName, |
240
|
|
|
} |
241
|
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
242
|
|
|
return srv.(PermissionServer).Expand(ctx, req.(*PermissionExpandRequest)) |
243
|
|
|
} |
244
|
|
|
return interceptor(ctx, in, info, handler) |
245
|
|
|
} |
246
|
|
|
|
247
|
|
|
func _Permission_LookupEntity_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
248
|
|
|
in := new(PermissionLookupEntityRequest) |
249
|
|
|
if err := dec(in); err != nil { |
250
|
|
|
return nil, err |
251
|
|
|
} |
252
|
|
|
if interceptor == nil { |
253
|
|
|
return srv.(PermissionServer).LookupEntity(ctx, in) |
254
|
|
|
} |
255
|
|
|
info := &grpc.UnaryServerInfo{ |
256
|
|
|
Server: srv, |
257
|
|
|
FullMethod: Permission_LookupEntity_FullMethodName, |
258
|
|
|
} |
259
|
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
260
|
|
|
return srv.(PermissionServer).LookupEntity(ctx, req.(*PermissionLookupEntityRequest)) |
261
|
|
|
} |
262
|
|
|
return interceptor(ctx, in, info, handler) |
263
|
|
|
} |
264
|
|
|
|
265
|
|
|
func _Permission_LookupEntityStream_Handler(srv interface{}, stream grpc.ServerStream) error { |
266
|
|
|
m := new(PermissionLookupEntityRequest) |
267
|
|
|
if err := stream.RecvMsg(m); err != nil { |
268
|
|
|
return err |
269
|
|
|
} |
270
|
|
|
return srv.(PermissionServer).LookupEntityStream(m, &permissionLookupEntityStreamServer{ServerStream: stream}) |
271
|
|
|
} |
272
|
|
|
|
273
|
|
|
type Permission_LookupEntityStreamServer interface { |
274
|
|
|
Send(*PermissionLookupEntityStreamResponse) error |
275
|
|
|
grpc.ServerStream |
276
|
|
|
} |
277
|
|
|
|
278
|
|
|
type permissionLookupEntityStreamServer struct { |
279
|
|
|
grpc.ServerStream |
280
|
|
|
} |
281
|
|
|
|
282
|
|
|
func (x *permissionLookupEntityStreamServer) Send(m *PermissionLookupEntityStreamResponse) error { |
283
|
|
|
return x.ServerStream.SendMsg(m) |
284
|
|
|
} |
285
|
|
|
|
286
|
|
|
func _Permission_LookupSubject_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
287
|
|
|
in := new(PermissionLookupSubjectRequest) |
288
|
|
|
if err := dec(in); err != nil { |
289
|
|
|
return nil, err |
290
|
|
|
} |
291
|
|
|
if interceptor == nil { |
292
|
|
|
return srv.(PermissionServer).LookupSubject(ctx, in) |
293
|
|
|
} |
294
|
|
|
info := &grpc.UnaryServerInfo{ |
295
|
|
|
Server: srv, |
296
|
|
|
FullMethod: Permission_LookupSubject_FullMethodName, |
297
|
|
|
} |
298
|
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
299
|
|
|
return srv.(PermissionServer).LookupSubject(ctx, req.(*PermissionLookupSubjectRequest)) |
300
|
|
|
} |
301
|
|
|
return interceptor(ctx, in, info, handler) |
302
|
|
|
} |
303
|
|
|
|
304
|
|
|
func _Permission_SubjectPermission_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
305
|
|
|
in := new(PermissionSubjectPermissionRequest) |
306
|
|
|
if err := dec(in); err != nil { |
307
|
|
|
return nil, err |
308
|
|
|
} |
309
|
|
|
if interceptor == nil { |
310
|
|
|
return srv.(PermissionServer).SubjectPermission(ctx, in) |
311
|
|
|
} |
312
|
|
|
info := &grpc.UnaryServerInfo{ |
313
|
|
|
Server: srv, |
314
|
|
|
FullMethod: Permission_SubjectPermission_FullMethodName, |
315
|
|
|
} |
316
|
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
317
|
|
|
return srv.(PermissionServer).SubjectPermission(ctx, req.(*PermissionSubjectPermissionRequest)) |
318
|
|
|
} |
319
|
|
|
return interceptor(ctx, in, info, handler) |
320
|
|
|
} |
321
|
|
|
|
322
|
|
|
// Permission_ServiceDesc is the grpc.ServiceDesc for Permission service. |
323
|
|
|
// It's only intended for direct use with grpc.RegisterService, |
324
|
|
|
// and not to be introspected or modified (even as a copy) |
325
|
|
|
var Permission_ServiceDesc = grpc.ServiceDesc{ |
326
|
|
|
ServiceName: "base.v1.Permission", |
327
|
|
|
HandlerType: (*PermissionServer)(nil), |
328
|
|
|
Methods: []grpc.MethodDesc{ |
329
|
|
|
{ |
330
|
|
|
MethodName: "Check", |
331
|
|
|
Handler: _Permission_Check_Handler, |
332
|
|
|
}, |
333
|
|
|
{ |
334
|
|
|
MethodName: "Expand", |
335
|
|
|
Handler: _Permission_Expand_Handler, |
336
|
|
|
}, |
337
|
|
|
{ |
338
|
|
|
MethodName: "LookupEntity", |
339
|
|
|
Handler: _Permission_LookupEntity_Handler, |
340
|
|
|
}, |
341
|
|
|
{ |
342
|
|
|
MethodName: "LookupSubject", |
343
|
|
|
Handler: _Permission_LookupSubject_Handler, |
344
|
|
|
}, |
345
|
|
|
{ |
346
|
|
|
MethodName: "SubjectPermission", |
347
|
|
|
Handler: _Permission_SubjectPermission_Handler, |
348
|
|
|
}, |
349
|
|
|
}, |
350
|
|
|
Streams: []grpc.StreamDesc{ |
351
|
|
|
{ |
352
|
|
|
StreamName: "LookupEntityStream", |
353
|
|
|
Handler: _Permission_LookupEntityStream_Handler, |
354
|
|
|
ServerStreams: true, |
355
|
|
|
}, |
356
|
|
|
}, |
357
|
|
|
Metadata: "base/v1/service.proto", |
358
|
|
|
} |
359
|
|
|
|
360
|
|
|
const ( |
361
|
|
|
Watch_Watch_FullMethodName = "/base.v1.Watch/Watch" |
362
|
|
|
) |
363
|
|
|
|
364
|
|
|
// WatchClient is the client API for Watch service. |
365
|
|
|
// |
366
|
|
|
// 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. |
367
|
|
|
// |
368
|
|
|
// Watch is the main RPC in the Watch service. It establishes a stream between |
369
|
|
|
// the client and the server. The server pushes data changes into this stream |
370
|
|
|
// and the client can read those in real time. |
371
|
|
|
type WatchClient interface { |
372
|
|
|
Watch(ctx context.Context, in *WatchRequest, opts ...grpc.CallOption) (Watch_WatchClient, error) |
373
|
|
|
} |
374
|
|
|
|
375
|
|
|
type watchClient struct { |
376
|
|
|
cc grpc.ClientConnInterface |
377
|
|
|
} |
378
|
|
|
|
379
|
|
|
func NewWatchClient(cc grpc.ClientConnInterface) WatchClient { |
380
|
|
|
return &watchClient{cc} |
381
|
|
|
} |
382
|
|
|
|
383
|
|
|
func (c *watchClient) Watch(ctx context.Context, in *WatchRequest, opts ...grpc.CallOption) (Watch_WatchClient, error) { |
384
|
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
385
|
|
|
stream, err := c.cc.NewStream(ctx, &Watch_ServiceDesc.Streams[0], Watch_Watch_FullMethodName, cOpts...) |
386
|
|
|
if err != nil { |
387
|
|
|
return nil, err |
388
|
|
|
} |
389
|
|
|
x := &watchWatchClient{ClientStream: stream} |
390
|
|
|
if err := x.ClientStream.SendMsg(in); err != nil { |
391
|
|
|
return nil, err |
392
|
|
|
} |
393
|
|
|
if err := x.ClientStream.CloseSend(); err != nil { |
394
|
|
|
return nil, err |
395
|
|
|
} |
396
|
|
|
return x, nil |
397
|
|
|
} |
398
|
|
|
|
399
|
|
|
type Watch_WatchClient interface { |
400
|
|
|
Recv() (*WatchResponse, error) |
401
|
|
|
grpc.ClientStream |
402
|
|
|
} |
403
|
|
|
|
404
|
|
|
type watchWatchClient struct { |
405
|
|
|
grpc.ClientStream |
406
|
|
|
} |
407
|
|
|
|
408
|
|
|
func (x *watchWatchClient) Recv() (*WatchResponse, error) { |
409
|
|
|
m := new(WatchResponse) |
410
|
|
|
if err := x.ClientStream.RecvMsg(m); err != nil { |
411
|
|
|
return nil, err |
412
|
|
|
} |
413
|
|
|
return m, nil |
414
|
|
|
} |
415
|
|
|
|
416
|
|
|
// WatchServer is the server API for Watch service. |
417
|
|
|
// All implementations must embed UnimplementedWatchServer |
418
|
|
|
// for forward compatibility |
419
|
|
|
// |
420
|
|
|
// Watch is the main RPC in the Watch service. It establishes a stream between |
421
|
|
|
// the client and the server. The server pushes data changes into this stream |
422
|
|
|
// and the client can read those in real time. |
423
|
|
|
type WatchServer interface { |
424
|
|
|
Watch(*WatchRequest, Watch_WatchServer) error |
425
|
|
|
mustEmbedUnimplementedWatchServer() |
426
|
|
|
} |
427
|
|
|
|
428
|
|
|
// UnimplementedWatchServer must be embedded to have forward compatible implementations. |
429
|
|
|
type UnimplementedWatchServer struct { |
430
|
|
|
} |
431
|
|
|
|
432
|
|
|
func (UnimplementedWatchServer) Watch(*WatchRequest, Watch_WatchServer) error { |
433
|
|
|
return status.Errorf(codes.Unimplemented, "method Watch not implemented") |
434
|
|
|
} |
435
|
|
|
func (UnimplementedWatchServer) mustEmbedUnimplementedWatchServer() {} |
436
|
|
|
|
437
|
|
|
// UnsafeWatchServer may be embedded to opt out of forward compatibility for this service. |
438
|
|
|
// Use of this interface is not recommended, as added methods to WatchServer will |
439
|
|
|
// result in compilation errors. |
440
|
|
|
type UnsafeWatchServer interface { |
441
|
|
|
mustEmbedUnimplementedWatchServer() |
442
|
|
|
} |
443
|
|
|
|
444
|
|
|
func RegisterWatchServer(s grpc.ServiceRegistrar, srv WatchServer) { |
445
|
|
|
s.RegisterService(&Watch_ServiceDesc, srv) |
446
|
|
|
} |
447
|
|
|
|
448
|
|
|
func _Watch_Watch_Handler(srv interface{}, stream grpc.ServerStream) error { |
449
|
|
|
m := new(WatchRequest) |
450
|
|
|
if err := stream.RecvMsg(m); err != nil { |
451
|
|
|
return err |
452
|
|
|
} |
453
|
|
|
return srv.(WatchServer).Watch(m, &watchWatchServer{ServerStream: stream}) |
454
|
|
|
} |
455
|
|
|
|
456
|
|
|
type Watch_WatchServer interface { |
457
|
|
|
Send(*WatchResponse) error |
458
|
|
|
grpc.ServerStream |
459
|
|
|
} |
460
|
|
|
|
461
|
|
|
type watchWatchServer struct { |
462
|
|
|
grpc.ServerStream |
463
|
|
|
} |
464
|
|
|
|
465
|
|
|
func (x *watchWatchServer) Send(m *WatchResponse) error { |
466
|
|
|
return x.ServerStream.SendMsg(m) |
467
|
|
|
} |
468
|
|
|
|
469
|
|
|
// Watch_ServiceDesc is the grpc.ServiceDesc for Watch service. |
470
|
|
|
// It's only intended for direct use with grpc.RegisterService, |
471
|
|
|
// and not to be introspected or modified (even as a copy) |
472
|
|
|
var Watch_ServiceDesc = grpc.ServiceDesc{ |
473
|
|
|
ServiceName: "base.v1.Watch", |
474
|
|
|
HandlerType: (*WatchServer)(nil), |
475
|
|
|
Methods: []grpc.MethodDesc{}, |
476
|
|
|
Streams: []grpc.StreamDesc{ |
477
|
|
|
{ |
478
|
|
|
StreamName: "Watch", |
479
|
|
|
Handler: _Watch_Watch_Handler, |
480
|
|
|
ServerStreams: true, |
481
|
|
|
}, |
482
|
|
|
}, |
483
|
|
|
Metadata: "base/v1/service.proto", |
484
|
|
|
} |
485
|
|
|
|
486
|
|
|
const ( |
487
|
|
|
Schema_Write_FullMethodName = "/base.v1.Schema/Write" |
488
|
|
|
Schema_PartialWrite_FullMethodName = "/base.v1.Schema/PartialWrite" |
489
|
|
|
Schema_Read_FullMethodName = "/base.v1.Schema/Read" |
490
|
|
|
Schema_List_FullMethodName = "/base.v1.Schema/List" |
491
|
|
|
) |
492
|
|
|
|
493
|
|
|
// SchemaClient is the client API for Schema service. |
494
|
|
|
// |
495
|
|
|
// 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. |
496
|
|
|
// |
497
|
|
|
// The Schema service definition. |
498
|
|
|
type SchemaClient interface { |
499
|
|
|
// Write is an RPC that allows you to write your authorization model. |
500
|
|
|
Write(ctx context.Context, in *SchemaWriteRequest, opts ...grpc.CallOption) (*SchemaWriteResponse, error) |
501
|
|
|
// PartialWrite is an RPC that allows you to partially update an existing authorization model. |
502
|
|
|
PartialWrite(ctx context.Context, in *SchemaPartialWriteRequest, opts ...grpc.CallOption) (*SchemaPartialWriteResponse, error) |
503
|
|
|
// Read is an RPC that allows you to read your authorization model. |
504
|
|
|
Read(ctx context.Context, in *SchemaReadRequest, opts ...grpc.CallOption) (*SchemaReadResponse, error) |
505
|
|
|
// List is an RPC that allows you to list all authorization models. |
506
|
|
|
List(ctx context.Context, in *SchemaListRequest, opts ...grpc.CallOption) (*SchemaListResponse, error) |
507
|
|
|
} |
508
|
|
|
|
509
|
|
|
type schemaClient struct { |
510
|
|
|
cc grpc.ClientConnInterface |
511
|
|
|
} |
512
|
|
|
|
513
|
|
|
func NewSchemaClient(cc grpc.ClientConnInterface) SchemaClient { |
514
|
|
|
return &schemaClient{cc} |
515
|
|
|
} |
516
|
|
|
|
517
|
|
|
func (c *schemaClient) Write(ctx context.Context, in *SchemaWriteRequest, opts ...grpc.CallOption) (*SchemaWriteResponse, error) { |
518
|
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
519
|
|
|
out := new(SchemaWriteResponse) |
520
|
|
|
err := c.cc.Invoke(ctx, Schema_Write_FullMethodName, in, out, cOpts...) |
521
|
|
|
if err != nil { |
522
|
|
|
return nil, err |
523
|
|
|
} |
524
|
|
|
return out, nil |
525
|
|
|
} |
526
|
|
|
|
527
|
|
|
func (c *schemaClient) PartialWrite(ctx context.Context, in *SchemaPartialWriteRequest, opts ...grpc.CallOption) (*SchemaPartialWriteResponse, error) { |
528
|
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
529
|
|
|
out := new(SchemaPartialWriteResponse) |
530
|
|
|
err := c.cc.Invoke(ctx, Schema_PartialWrite_FullMethodName, in, out, cOpts...) |
531
|
|
|
if err != nil { |
532
|
|
|
return nil, err |
533
|
|
|
} |
534
|
|
|
return out, nil |
535
|
|
|
} |
536
|
|
|
|
537
|
|
|
func (c *schemaClient) Read(ctx context.Context, in *SchemaReadRequest, opts ...grpc.CallOption) (*SchemaReadResponse, error) { |
538
|
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
539
|
|
|
out := new(SchemaReadResponse) |
540
|
|
|
err := c.cc.Invoke(ctx, Schema_Read_FullMethodName, in, out, cOpts...) |
541
|
|
|
if err != nil { |
542
|
|
|
return nil, err |
543
|
|
|
} |
544
|
|
|
return out, nil |
545
|
|
|
} |
546
|
|
|
|
547
|
|
|
func (c *schemaClient) List(ctx context.Context, in *SchemaListRequest, opts ...grpc.CallOption) (*SchemaListResponse, error) { |
548
|
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
549
|
|
|
out := new(SchemaListResponse) |
550
|
|
|
err := c.cc.Invoke(ctx, Schema_List_FullMethodName, in, out, cOpts...) |
551
|
|
|
if err != nil { |
552
|
|
|
return nil, err |
553
|
|
|
} |
554
|
|
|
return out, nil |
555
|
|
|
} |
556
|
|
|
|
557
|
|
|
// SchemaServer is the server API for Schema service. |
558
|
|
|
// All implementations must embed UnimplementedSchemaServer |
559
|
|
|
// for forward compatibility |
560
|
|
|
// |
561
|
|
|
// The Schema service definition. |
562
|
|
|
type SchemaServer interface { |
563
|
|
|
// Write is an RPC that allows you to write your authorization model. |
564
|
|
|
Write(context.Context, *SchemaWriteRequest) (*SchemaWriteResponse, error) |
565
|
|
|
// PartialWrite is an RPC that allows you to partially update an existing authorization model. |
566
|
|
|
PartialWrite(context.Context, *SchemaPartialWriteRequest) (*SchemaPartialWriteResponse, error) |
567
|
|
|
// Read is an RPC that allows you to read your authorization model. |
568
|
|
|
Read(context.Context, *SchemaReadRequest) (*SchemaReadResponse, error) |
569
|
|
|
// List is an RPC that allows you to list all authorization models. |
570
|
|
|
List(context.Context, *SchemaListRequest) (*SchemaListResponse, error) |
571
|
|
|
mustEmbedUnimplementedSchemaServer() |
572
|
|
|
} |
573
|
|
|
|
574
|
|
|
// UnimplementedSchemaServer must be embedded to have forward compatible implementations. |
575
|
|
|
type UnimplementedSchemaServer struct { |
576
|
|
|
} |
577
|
|
|
|
578
|
|
|
func (UnimplementedSchemaServer) Write(context.Context, *SchemaWriteRequest) (*SchemaWriteResponse, error) { |
579
|
|
|
return nil, status.Errorf(codes.Unimplemented, "method Write not implemented") |
580
|
|
|
} |
581
|
|
|
func (UnimplementedSchemaServer) PartialWrite(context.Context, *SchemaPartialWriteRequest) (*SchemaPartialWriteResponse, error) { |
582
|
|
|
return nil, status.Errorf(codes.Unimplemented, "method PartialWrite not implemented") |
583
|
|
|
} |
584
|
|
|
func (UnimplementedSchemaServer) Read(context.Context, *SchemaReadRequest) (*SchemaReadResponse, error) { |
585
|
|
|
return nil, status.Errorf(codes.Unimplemented, "method Read not implemented") |
586
|
|
|
} |
587
|
|
|
func (UnimplementedSchemaServer) List(context.Context, *SchemaListRequest) (*SchemaListResponse, error) { |
588
|
|
|
return nil, status.Errorf(codes.Unimplemented, "method List not implemented") |
589
|
|
|
} |
590
|
|
|
func (UnimplementedSchemaServer) mustEmbedUnimplementedSchemaServer() {} |
591
|
|
|
|
592
|
|
|
// UnsafeSchemaServer may be embedded to opt out of forward compatibility for this service. |
593
|
|
|
// Use of this interface is not recommended, as added methods to SchemaServer will |
594
|
|
|
// result in compilation errors. |
595
|
|
|
type UnsafeSchemaServer interface { |
596
|
|
|
mustEmbedUnimplementedSchemaServer() |
597
|
|
|
} |
598
|
|
|
|
599
|
|
|
func RegisterSchemaServer(s grpc.ServiceRegistrar, srv SchemaServer) { |
600
|
|
|
s.RegisterService(&Schema_ServiceDesc, srv) |
601
|
|
|
} |
602
|
|
|
|
603
|
|
|
func _Schema_Write_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
604
|
|
|
in := new(SchemaWriteRequest) |
605
|
|
|
if err := dec(in); err != nil { |
606
|
|
|
return nil, err |
607
|
|
|
} |
608
|
|
|
if interceptor == nil { |
609
|
|
|
return srv.(SchemaServer).Write(ctx, in) |
610
|
|
|
} |
611
|
|
|
info := &grpc.UnaryServerInfo{ |
612
|
|
|
Server: srv, |
613
|
|
|
FullMethod: Schema_Write_FullMethodName, |
614
|
|
|
} |
615
|
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
616
|
|
|
return srv.(SchemaServer).Write(ctx, req.(*SchemaWriteRequest)) |
617
|
|
|
} |
618
|
|
|
return interceptor(ctx, in, info, handler) |
619
|
|
|
} |
620
|
|
|
|
621
|
|
|
func _Schema_PartialWrite_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
622
|
|
|
in := new(SchemaPartialWriteRequest) |
623
|
|
|
if err := dec(in); err != nil { |
624
|
|
|
return nil, err |
625
|
|
|
} |
626
|
|
|
if interceptor == nil { |
627
|
|
|
return srv.(SchemaServer).PartialWrite(ctx, in) |
628
|
|
|
} |
629
|
|
|
info := &grpc.UnaryServerInfo{ |
630
|
|
|
Server: srv, |
631
|
|
|
FullMethod: Schema_PartialWrite_FullMethodName, |
632
|
|
|
} |
633
|
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
634
|
|
|
return srv.(SchemaServer).PartialWrite(ctx, req.(*SchemaPartialWriteRequest)) |
635
|
|
|
} |
636
|
|
|
return interceptor(ctx, in, info, handler) |
637
|
|
|
} |
638
|
|
|
|
639
|
|
|
func _Schema_Read_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
640
|
|
|
in := new(SchemaReadRequest) |
641
|
|
|
if err := dec(in); err != nil { |
642
|
|
|
return nil, err |
643
|
|
|
} |
644
|
|
|
if interceptor == nil { |
645
|
|
|
return srv.(SchemaServer).Read(ctx, in) |
646
|
|
|
} |
647
|
|
|
info := &grpc.UnaryServerInfo{ |
648
|
|
|
Server: srv, |
649
|
|
|
FullMethod: Schema_Read_FullMethodName, |
650
|
|
|
} |
651
|
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
652
|
|
|
return srv.(SchemaServer).Read(ctx, req.(*SchemaReadRequest)) |
653
|
|
|
} |
654
|
|
|
return interceptor(ctx, in, info, handler) |
655
|
|
|
} |
656
|
|
|
|
657
|
|
|
func _Schema_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
658
|
|
|
in := new(SchemaListRequest) |
659
|
|
|
if err := dec(in); err != nil { |
660
|
|
|
return nil, err |
661
|
|
|
} |
662
|
|
|
if interceptor == nil { |
663
|
|
|
return srv.(SchemaServer).List(ctx, in) |
664
|
|
|
} |
665
|
|
|
info := &grpc.UnaryServerInfo{ |
666
|
|
|
Server: srv, |
667
|
|
|
FullMethod: Schema_List_FullMethodName, |
668
|
|
|
} |
669
|
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
670
|
|
|
return srv.(SchemaServer).List(ctx, req.(*SchemaListRequest)) |
671
|
|
|
} |
672
|
|
|
return interceptor(ctx, in, info, handler) |
673
|
|
|
} |
674
|
|
|
|
675
|
|
|
// Schema_ServiceDesc is the grpc.ServiceDesc for Schema service. |
676
|
|
|
// It's only intended for direct use with grpc.RegisterService, |
677
|
|
|
// and not to be introspected or modified (even as a copy) |
678
|
|
|
var Schema_ServiceDesc = grpc.ServiceDesc{ |
679
|
|
|
ServiceName: "base.v1.Schema", |
680
|
|
|
HandlerType: (*SchemaServer)(nil), |
681
|
|
|
Methods: []grpc.MethodDesc{ |
682
|
|
|
{ |
683
|
|
|
MethodName: "Write", |
684
|
|
|
Handler: _Schema_Write_Handler, |
685
|
|
|
}, |
686
|
|
|
{ |
687
|
|
|
MethodName: "PartialWrite", |
688
|
|
|
Handler: _Schema_PartialWrite_Handler, |
689
|
|
|
}, |
690
|
|
|
{ |
691
|
|
|
MethodName: "Read", |
692
|
|
|
Handler: _Schema_Read_Handler, |
693
|
|
|
}, |
694
|
|
|
{ |
695
|
|
|
MethodName: "List", |
696
|
|
|
Handler: _Schema_List_Handler, |
697
|
|
|
}, |
698
|
|
|
}, |
699
|
|
|
Streams: []grpc.StreamDesc{}, |
700
|
|
|
Metadata: "base/v1/service.proto", |
701
|
|
|
} |
702
|
|
|
|
703
|
|
|
const ( |
704
|
|
|
Data_Write_FullMethodName = "/base.v1.Data/Write" |
705
|
|
|
Data_WriteRelationships_FullMethodName = "/base.v1.Data/WriteRelationships" |
706
|
|
|
Data_ReadRelationships_FullMethodName = "/base.v1.Data/ReadRelationships" |
707
|
|
|
Data_ReadAttributes_FullMethodName = "/base.v1.Data/ReadAttributes" |
708
|
|
|
Data_Delete_FullMethodName = "/base.v1.Data/Delete" |
709
|
|
|
Data_DeleteRelationships_FullMethodName = "/base.v1.Data/DeleteRelationships" |
710
|
|
|
Data_RunBundle_FullMethodName = "/base.v1.Data/RunBundle" |
711
|
|
|
) |
712
|
|
|
|
713
|
|
|
// DataClient is the client API for Data service. |
714
|
|
|
// |
715
|
|
|
// 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. |
716
|
|
|
// |
717
|
|
|
// The Data service provides RPC methods for managing data in the context of relationships and attributes. |
718
|
|
|
type DataClient interface { |
719
|
|
|
// The Write RPC method creates a new relation tuple. |
720
|
|
|
Write(ctx context.Context, in *DataWriteRequest, opts ...grpc.CallOption) (*DataWriteResponse, error) |
721
|
|
|
// RPC method to write relationships for a tenant. This can be accessed via a POST request to the given HTTP path. It's tagged under "Data" in OpenAPI documentation. |
722
|
|
|
WriteRelationships(ctx context.Context, in *RelationshipWriteRequest, opts ...grpc.CallOption) (*RelationshipWriteResponse, error) |
723
|
|
|
// The ReadRelationships RPC method reads relation tuple(s). |
724
|
|
|
ReadRelationships(ctx context.Context, in *RelationshipReadRequest, opts ...grpc.CallOption) (*RelationshipReadResponse, error) |
725
|
|
|
// The ReadAttributes RPC method reads attribute(s) of a relation. |
726
|
|
|
ReadAttributes(ctx context.Context, in *AttributeReadRequest, opts ...grpc.CallOption) (*AttributeReadResponse, error) |
727
|
|
|
// The Delete RPC method deletes a relation tuple. |
728
|
|
|
Delete(ctx context.Context, in *DataDeleteRequest, opts ...grpc.CallOption) (*DataDeleteResponse, error) |
729
|
|
|
// RPC method to delete relationships for a tenant, accessed via a POST request to the specified path, tagged as "Data" in OpenAPI documentation. |
730
|
|
|
DeleteRelationships(ctx context.Context, in *RelationshipDeleteRequest, opts ...grpc.CallOption) (*RelationshipDeleteResponse, error) |
731
|
|
|
// Executes or runs a specific bundle. This method is useful for processing or triggering actions based on the bundle's data. |
732
|
|
|
RunBundle(ctx context.Context, in *BundleRunRequest, opts ...grpc.CallOption) (*BundleRunResponse, error) |
733
|
|
|
} |
734
|
|
|
|
735
|
|
|
type dataClient struct { |
736
|
|
|
cc grpc.ClientConnInterface |
737
|
|
|
} |
738
|
|
|
|
739
|
|
|
func NewDataClient(cc grpc.ClientConnInterface) DataClient { |
740
|
|
|
return &dataClient{cc} |
741
|
|
|
} |
742
|
|
|
|
743
|
|
|
func (c *dataClient) Write(ctx context.Context, in *DataWriteRequest, opts ...grpc.CallOption) (*DataWriteResponse, error) { |
744
|
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
745
|
|
|
out := new(DataWriteResponse) |
746
|
|
|
err := c.cc.Invoke(ctx, Data_Write_FullMethodName, in, out, cOpts...) |
747
|
|
|
if err != nil { |
748
|
|
|
return nil, err |
749
|
|
|
} |
750
|
|
|
return out, nil |
751
|
|
|
} |
752
|
|
|
|
753
|
|
|
func (c *dataClient) WriteRelationships(ctx context.Context, in *RelationshipWriteRequest, opts ...grpc.CallOption) (*RelationshipWriteResponse, error) { |
754
|
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
755
|
|
|
out := new(RelationshipWriteResponse) |
756
|
|
|
err := c.cc.Invoke(ctx, Data_WriteRelationships_FullMethodName, in, out, cOpts...) |
757
|
|
|
if err != nil { |
758
|
|
|
return nil, err |
759
|
|
|
} |
760
|
|
|
return out, nil |
761
|
|
|
} |
762
|
|
|
|
763
|
|
|
func (c *dataClient) ReadRelationships(ctx context.Context, in *RelationshipReadRequest, opts ...grpc.CallOption) (*RelationshipReadResponse, error) { |
764
|
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
765
|
|
|
out := new(RelationshipReadResponse) |
766
|
|
|
err := c.cc.Invoke(ctx, Data_ReadRelationships_FullMethodName, in, out, cOpts...) |
767
|
|
|
if err != nil { |
768
|
|
|
return nil, err |
769
|
|
|
} |
770
|
|
|
return out, nil |
771
|
|
|
} |
772
|
|
|
|
773
|
|
|
func (c *dataClient) ReadAttributes(ctx context.Context, in *AttributeReadRequest, opts ...grpc.CallOption) (*AttributeReadResponse, error) { |
774
|
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
775
|
|
|
out := new(AttributeReadResponse) |
776
|
|
|
err := c.cc.Invoke(ctx, Data_ReadAttributes_FullMethodName, in, out, cOpts...) |
777
|
|
|
if err != nil { |
778
|
|
|
return nil, err |
779
|
|
|
} |
780
|
|
|
return out, nil |
781
|
|
|
} |
782
|
|
|
|
783
|
|
|
func (c *dataClient) Delete(ctx context.Context, in *DataDeleteRequest, opts ...grpc.CallOption) (*DataDeleteResponse, error) { |
784
|
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
785
|
|
|
out := new(DataDeleteResponse) |
786
|
|
|
err := c.cc.Invoke(ctx, Data_Delete_FullMethodName, in, out, cOpts...) |
787
|
|
|
if err != nil { |
788
|
|
|
return nil, err |
789
|
|
|
} |
790
|
|
|
return out, nil |
791
|
|
|
} |
792
|
|
|
|
793
|
|
|
func (c *dataClient) DeleteRelationships(ctx context.Context, in *RelationshipDeleteRequest, opts ...grpc.CallOption) (*RelationshipDeleteResponse, error) { |
794
|
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
795
|
|
|
out := new(RelationshipDeleteResponse) |
796
|
|
|
err := c.cc.Invoke(ctx, Data_DeleteRelationships_FullMethodName, in, out, cOpts...) |
797
|
|
|
if err != nil { |
798
|
|
|
return nil, err |
799
|
|
|
} |
800
|
|
|
return out, nil |
801
|
|
|
} |
802
|
|
|
|
803
|
|
|
func (c *dataClient) RunBundle(ctx context.Context, in *BundleRunRequest, opts ...grpc.CallOption) (*BundleRunResponse, error) { |
804
|
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
805
|
|
|
out := new(BundleRunResponse) |
806
|
|
|
err := c.cc.Invoke(ctx, Data_RunBundle_FullMethodName, in, out, cOpts...) |
807
|
|
|
if err != nil { |
808
|
|
|
return nil, err |
809
|
|
|
} |
810
|
|
|
return out, nil |
811
|
|
|
} |
812
|
|
|
|
813
|
|
|
// DataServer is the server API for Data service. |
814
|
|
|
// All implementations must embed UnimplementedDataServer |
815
|
|
|
// for forward compatibility |
816
|
|
|
// |
817
|
|
|
// The Data service provides RPC methods for managing data in the context of relationships and attributes. |
818
|
|
|
type DataServer interface { |
819
|
|
|
// The Write RPC method creates a new relation tuple. |
820
|
|
|
Write(context.Context, *DataWriteRequest) (*DataWriteResponse, error) |
821
|
|
|
// RPC method to write relationships for a tenant. This can be accessed via a POST request to the given HTTP path. It's tagged under "Data" in OpenAPI documentation. |
822
|
|
|
WriteRelationships(context.Context, *RelationshipWriteRequest) (*RelationshipWriteResponse, error) |
823
|
|
|
// The ReadRelationships RPC method reads relation tuple(s). |
824
|
|
|
ReadRelationships(context.Context, *RelationshipReadRequest) (*RelationshipReadResponse, error) |
825
|
|
|
// The ReadAttributes RPC method reads attribute(s) of a relation. |
826
|
|
|
ReadAttributes(context.Context, *AttributeReadRequest) (*AttributeReadResponse, error) |
827
|
|
|
// The Delete RPC method deletes a relation tuple. |
828
|
|
|
Delete(context.Context, *DataDeleteRequest) (*DataDeleteResponse, error) |
829
|
|
|
// RPC method to delete relationships for a tenant, accessed via a POST request to the specified path, tagged as "Data" in OpenAPI documentation. |
830
|
|
|
DeleteRelationships(context.Context, *RelationshipDeleteRequest) (*RelationshipDeleteResponse, error) |
831
|
|
|
// Executes or runs a specific bundle. This method is useful for processing or triggering actions based on the bundle's data. |
832
|
|
|
RunBundle(context.Context, *BundleRunRequest) (*BundleRunResponse, error) |
833
|
|
|
mustEmbedUnimplementedDataServer() |
834
|
|
|
} |
835
|
|
|
|
836
|
|
|
// UnimplementedDataServer must be embedded to have forward compatible implementations. |
837
|
|
|
type UnimplementedDataServer struct { |
838
|
|
|
} |
839
|
|
|
|
840
|
|
|
func (UnimplementedDataServer) Write(context.Context, *DataWriteRequest) (*DataWriteResponse, error) { |
841
|
|
|
return nil, status.Errorf(codes.Unimplemented, "method Write not implemented") |
842
|
|
|
} |
843
|
|
|
func (UnimplementedDataServer) WriteRelationships(context.Context, *RelationshipWriteRequest) (*RelationshipWriteResponse, error) { |
844
|
|
|
return nil, status.Errorf(codes.Unimplemented, "method WriteRelationships not implemented") |
845
|
|
|
} |
846
|
|
|
func (UnimplementedDataServer) ReadRelationships(context.Context, *RelationshipReadRequest) (*RelationshipReadResponse, error) { |
847
|
|
|
return nil, status.Errorf(codes.Unimplemented, "method ReadRelationships not implemented") |
848
|
|
|
} |
849
|
|
|
func (UnimplementedDataServer) ReadAttributes(context.Context, *AttributeReadRequest) (*AttributeReadResponse, error) { |
850
|
|
|
return nil, status.Errorf(codes.Unimplemented, "method ReadAttributes not implemented") |
851
|
|
|
} |
852
|
|
|
func (UnimplementedDataServer) Delete(context.Context, *DataDeleteRequest) (*DataDeleteResponse, error) { |
853
|
|
|
return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented") |
854
|
|
|
} |
855
|
|
|
func (UnimplementedDataServer) DeleteRelationships(context.Context, *RelationshipDeleteRequest) (*RelationshipDeleteResponse, error) { |
856
|
|
|
return nil, status.Errorf(codes.Unimplemented, "method DeleteRelationships not implemented") |
857
|
|
|
} |
858
|
|
|
func (UnimplementedDataServer) RunBundle(context.Context, *BundleRunRequest) (*BundleRunResponse, error) { |
859
|
|
|
return nil, status.Errorf(codes.Unimplemented, "method RunBundle not implemented") |
860
|
|
|
} |
861
|
|
|
func (UnimplementedDataServer) mustEmbedUnimplementedDataServer() {} |
862
|
|
|
|
863
|
|
|
// UnsafeDataServer may be embedded to opt out of forward compatibility for this service. |
864
|
|
|
// Use of this interface is not recommended, as added methods to DataServer will |
865
|
|
|
// result in compilation errors. |
866
|
|
|
type UnsafeDataServer interface { |
867
|
|
|
mustEmbedUnimplementedDataServer() |
868
|
|
|
} |
869
|
|
|
|
870
|
|
|
func RegisterDataServer(s grpc.ServiceRegistrar, srv DataServer) { |
871
|
|
|
s.RegisterService(&Data_ServiceDesc, srv) |
872
|
|
|
} |
873
|
|
|
|
874
|
|
|
func _Data_Write_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
875
|
|
|
in := new(DataWriteRequest) |
876
|
|
|
if err := dec(in); err != nil { |
877
|
|
|
return nil, err |
878
|
|
|
} |
879
|
|
|
if interceptor == nil { |
880
|
|
|
return srv.(DataServer).Write(ctx, in) |
881
|
|
|
} |
882
|
|
|
info := &grpc.UnaryServerInfo{ |
883
|
|
|
Server: srv, |
884
|
|
|
FullMethod: Data_Write_FullMethodName, |
885
|
|
|
} |
886
|
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
887
|
|
|
return srv.(DataServer).Write(ctx, req.(*DataWriteRequest)) |
888
|
|
|
} |
889
|
|
|
return interceptor(ctx, in, info, handler) |
890
|
|
|
} |
891
|
|
|
|
892
|
|
|
func _Data_WriteRelationships_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
893
|
|
|
in := new(RelationshipWriteRequest) |
894
|
|
|
if err := dec(in); err != nil { |
895
|
|
|
return nil, err |
896
|
|
|
} |
897
|
|
|
if interceptor == nil { |
898
|
|
|
return srv.(DataServer).WriteRelationships(ctx, in) |
899
|
|
|
} |
900
|
|
|
info := &grpc.UnaryServerInfo{ |
901
|
|
|
Server: srv, |
902
|
|
|
FullMethod: Data_WriteRelationships_FullMethodName, |
903
|
|
|
} |
904
|
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
905
|
|
|
return srv.(DataServer).WriteRelationships(ctx, req.(*RelationshipWriteRequest)) |
906
|
|
|
} |
907
|
|
|
return interceptor(ctx, in, info, handler) |
908
|
|
|
} |
909
|
|
|
|
910
|
|
|
func _Data_ReadRelationships_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
911
|
|
|
in := new(RelationshipReadRequest) |
912
|
|
|
if err := dec(in); err != nil { |
913
|
|
|
return nil, err |
914
|
|
|
} |
915
|
|
|
if interceptor == nil { |
916
|
|
|
return srv.(DataServer).ReadRelationships(ctx, in) |
917
|
|
|
} |
918
|
|
|
info := &grpc.UnaryServerInfo{ |
919
|
|
|
Server: srv, |
920
|
|
|
FullMethod: Data_ReadRelationships_FullMethodName, |
921
|
|
|
} |
922
|
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
923
|
|
|
return srv.(DataServer).ReadRelationships(ctx, req.(*RelationshipReadRequest)) |
924
|
|
|
} |
925
|
|
|
return interceptor(ctx, in, info, handler) |
926
|
|
|
} |
927
|
|
|
|
928
|
|
|
func _Data_ReadAttributes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
929
|
|
|
in := new(AttributeReadRequest) |
930
|
|
|
if err := dec(in); err != nil { |
931
|
|
|
return nil, err |
932
|
|
|
} |
933
|
|
|
if interceptor == nil { |
934
|
|
|
return srv.(DataServer).ReadAttributes(ctx, in) |
935
|
|
|
} |
936
|
|
|
info := &grpc.UnaryServerInfo{ |
937
|
|
|
Server: srv, |
938
|
|
|
FullMethod: Data_ReadAttributes_FullMethodName, |
939
|
|
|
} |
940
|
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
941
|
|
|
return srv.(DataServer).ReadAttributes(ctx, req.(*AttributeReadRequest)) |
942
|
|
|
} |
943
|
|
|
return interceptor(ctx, in, info, handler) |
944
|
|
|
} |
945
|
|
|
|
946
|
|
|
func _Data_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
947
|
|
|
in := new(DataDeleteRequest) |
948
|
|
|
if err := dec(in); err != nil { |
949
|
|
|
return nil, err |
950
|
|
|
} |
951
|
|
|
if interceptor == nil { |
952
|
|
|
return srv.(DataServer).Delete(ctx, in) |
953
|
|
|
} |
954
|
|
|
info := &grpc.UnaryServerInfo{ |
955
|
|
|
Server: srv, |
956
|
|
|
FullMethod: Data_Delete_FullMethodName, |
957
|
|
|
} |
958
|
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
959
|
|
|
return srv.(DataServer).Delete(ctx, req.(*DataDeleteRequest)) |
960
|
|
|
} |
961
|
|
|
return interceptor(ctx, in, info, handler) |
962
|
|
|
} |
963
|
|
|
|
964
|
|
|
func _Data_DeleteRelationships_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
965
|
|
|
in := new(RelationshipDeleteRequest) |
966
|
|
|
if err := dec(in); err != nil { |
967
|
|
|
return nil, err |
968
|
|
|
} |
969
|
|
|
if interceptor == nil { |
970
|
|
|
return srv.(DataServer).DeleteRelationships(ctx, in) |
971
|
|
|
} |
972
|
|
|
info := &grpc.UnaryServerInfo{ |
973
|
|
|
Server: srv, |
974
|
|
|
FullMethod: Data_DeleteRelationships_FullMethodName, |
975
|
|
|
} |
976
|
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
977
|
|
|
return srv.(DataServer).DeleteRelationships(ctx, req.(*RelationshipDeleteRequest)) |
978
|
|
|
} |
979
|
|
|
return interceptor(ctx, in, info, handler) |
980
|
|
|
} |
981
|
|
|
|
982
|
|
|
func _Data_RunBundle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
983
|
|
|
in := new(BundleRunRequest) |
984
|
|
|
if err := dec(in); err != nil { |
985
|
|
|
return nil, err |
986
|
|
|
} |
987
|
|
|
if interceptor == nil { |
988
|
|
|
return srv.(DataServer).RunBundle(ctx, in) |
989
|
|
|
} |
990
|
|
|
info := &grpc.UnaryServerInfo{ |
991
|
|
|
Server: srv, |
992
|
|
|
FullMethod: Data_RunBundle_FullMethodName, |
993
|
|
|
} |
994
|
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
995
|
|
|
return srv.(DataServer).RunBundle(ctx, req.(*BundleRunRequest)) |
996
|
|
|
} |
997
|
|
|
return interceptor(ctx, in, info, handler) |
998
|
|
|
} |
999
|
|
|
|
1000
|
|
|
// Data_ServiceDesc is the grpc.ServiceDesc for Data service. |
1001
|
|
|
// It's only intended for direct use with grpc.RegisterService, |
1002
|
|
|
// and not to be introspected or modified (even as a copy) |
1003
|
|
|
var Data_ServiceDesc = grpc.ServiceDesc{ |
1004
|
|
|
ServiceName: "base.v1.Data", |
1005
|
|
|
HandlerType: (*DataServer)(nil), |
1006
|
|
|
Methods: []grpc.MethodDesc{ |
1007
|
|
|
{ |
1008
|
|
|
MethodName: "Write", |
1009
|
|
|
Handler: _Data_Write_Handler, |
1010
|
|
|
}, |
1011
|
|
|
{ |
1012
|
|
|
MethodName: "WriteRelationships", |
1013
|
|
|
Handler: _Data_WriteRelationships_Handler, |
1014
|
|
|
}, |
1015
|
|
|
{ |
1016
|
|
|
MethodName: "ReadRelationships", |
1017
|
|
|
Handler: _Data_ReadRelationships_Handler, |
1018
|
|
|
}, |
1019
|
|
|
{ |
1020
|
|
|
MethodName: "ReadAttributes", |
1021
|
|
|
Handler: _Data_ReadAttributes_Handler, |
1022
|
|
|
}, |
1023
|
|
|
{ |
1024
|
|
|
MethodName: "Delete", |
1025
|
|
|
Handler: _Data_Delete_Handler, |
1026
|
|
|
}, |
1027
|
|
|
{ |
1028
|
|
|
MethodName: "DeleteRelationships", |
1029
|
|
|
Handler: _Data_DeleteRelationships_Handler, |
1030
|
|
|
}, |
1031
|
|
|
{ |
1032
|
|
|
MethodName: "RunBundle", |
1033
|
|
|
Handler: _Data_RunBundle_Handler, |
1034
|
|
|
}, |
1035
|
|
|
}, |
1036
|
|
|
Streams: []grpc.StreamDesc{}, |
1037
|
|
|
Metadata: "base/v1/service.proto", |
1038
|
|
|
} |
1039
|
|
|
|
1040
|
|
|
const ( |
1041
|
|
|
Bundle_Write_FullMethodName = "/base.v1.Bundle/Write" |
1042
|
|
|
Bundle_Read_FullMethodName = "/base.v1.Bundle/Read" |
1043
|
|
|
Bundle_Delete_FullMethodName = "/base.v1.Bundle/Delete" |
1044
|
|
|
) |
1045
|
|
|
|
1046
|
|
|
// BundleClient is the client API for Bundle service. |
1047
|
|
|
// |
1048
|
|
|
// 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. |
1049
|
|
|
type BundleClient interface { |
1050
|
|
|
// Writes a bundle of data for a specific operation. This is a general purpose method to handle writing data bundles. |
1051
|
|
|
Write(ctx context.Context, in *BundleWriteRequest, opts ...grpc.CallOption) (*BundleWriteResponse, error) |
1052
|
|
|
// Reads a data bundle based on a specified request. This method is tailored for retrieving data bundles. |
1053
|
|
|
Read(ctx context.Context, in *BundleReadRequest, opts ...grpc.CallOption) (*BundleReadResponse, error) |
1054
|
|
|
// Deletes a specific data bundle. This method is used to remove existing bundles from the system. |
1055
|
|
|
Delete(ctx context.Context, in *BundleDeleteRequest, opts ...grpc.CallOption) (*BundleDeleteResponse, error) |
1056
|
|
|
} |
1057
|
|
|
|
1058
|
|
|
type bundleClient struct { |
1059
|
|
|
cc grpc.ClientConnInterface |
1060
|
|
|
} |
1061
|
|
|
|
1062
|
|
|
func NewBundleClient(cc grpc.ClientConnInterface) BundleClient { |
1063
|
|
|
return &bundleClient{cc} |
1064
|
|
|
} |
1065
|
|
|
|
1066
|
|
|
func (c *bundleClient) Write(ctx context.Context, in *BundleWriteRequest, opts ...grpc.CallOption) (*BundleWriteResponse, error) { |
1067
|
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
1068
|
|
|
out := new(BundleWriteResponse) |
1069
|
|
|
err := c.cc.Invoke(ctx, Bundle_Write_FullMethodName, in, out, cOpts...) |
1070
|
|
|
if err != nil { |
1071
|
|
|
return nil, err |
1072
|
|
|
} |
1073
|
|
|
return out, nil |
1074
|
|
|
} |
1075
|
|
|
|
1076
|
|
|
func (c *bundleClient) Read(ctx context.Context, in *BundleReadRequest, opts ...grpc.CallOption) (*BundleReadResponse, error) { |
1077
|
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
1078
|
|
|
out := new(BundleReadResponse) |
1079
|
|
|
err := c.cc.Invoke(ctx, Bundle_Read_FullMethodName, in, out, cOpts...) |
1080
|
|
|
if err != nil { |
1081
|
|
|
return nil, err |
1082
|
|
|
} |
1083
|
|
|
return out, nil |
1084
|
|
|
} |
1085
|
|
|
|
1086
|
|
|
func (c *bundleClient) Delete(ctx context.Context, in *BundleDeleteRequest, opts ...grpc.CallOption) (*BundleDeleteResponse, error) { |
1087
|
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
1088
|
|
|
out := new(BundleDeleteResponse) |
1089
|
|
|
err := c.cc.Invoke(ctx, Bundle_Delete_FullMethodName, in, out, cOpts...) |
1090
|
|
|
if err != nil { |
1091
|
|
|
return nil, err |
1092
|
|
|
} |
1093
|
|
|
return out, nil |
1094
|
|
|
} |
1095
|
|
|
|
1096
|
|
|
// BundleServer is the server API for Bundle service. |
1097
|
|
|
// All implementations must embed UnimplementedBundleServer |
1098
|
|
|
// for forward compatibility |
1099
|
|
|
type BundleServer interface { |
1100
|
|
|
// Writes a bundle of data for a specific operation. This is a general purpose method to handle writing data bundles. |
1101
|
|
|
Write(context.Context, *BundleWriteRequest) (*BundleWriteResponse, error) |
1102
|
|
|
// Reads a data bundle based on a specified request. This method is tailored for retrieving data bundles. |
1103
|
|
|
Read(context.Context, *BundleReadRequest) (*BundleReadResponse, error) |
1104
|
|
|
// Deletes a specific data bundle. This method is used to remove existing bundles from the system. |
1105
|
|
|
Delete(context.Context, *BundleDeleteRequest) (*BundleDeleteResponse, error) |
1106
|
|
|
mustEmbedUnimplementedBundleServer() |
1107
|
|
|
} |
1108
|
|
|
|
1109
|
|
|
// UnimplementedBundleServer must be embedded to have forward compatible implementations. |
1110
|
|
|
type UnimplementedBundleServer struct { |
1111
|
|
|
} |
1112
|
|
|
|
1113
|
|
|
func (UnimplementedBundleServer) Write(context.Context, *BundleWriteRequest) (*BundleWriteResponse, error) { |
1114
|
|
|
return nil, status.Errorf(codes.Unimplemented, "method Write not implemented") |
1115
|
|
|
} |
1116
|
|
|
func (UnimplementedBundleServer) Read(context.Context, *BundleReadRequest) (*BundleReadResponse, error) { |
1117
|
|
|
return nil, status.Errorf(codes.Unimplemented, "method Read not implemented") |
1118
|
|
|
} |
1119
|
|
|
func (UnimplementedBundleServer) Delete(context.Context, *BundleDeleteRequest) (*BundleDeleteResponse, error) { |
1120
|
|
|
return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented") |
1121
|
|
|
} |
1122
|
|
|
func (UnimplementedBundleServer) mustEmbedUnimplementedBundleServer() {} |
1123
|
|
|
|
1124
|
|
|
// UnsafeBundleServer may be embedded to opt out of forward compatibility for this service. |
1125
|
|
|
// Use of this interface is not recommended, as added methods to BundleServer will |
1126
|
|
|
// result in compilation errors. |
1127
|
|
|
type UnsafeBundleServer interface { |
1128
|
|
|
mustEmbedUnimplementedBundleServer() |
1129
|
|
|
} |
1130
|
|
|
|
1131
|
|
|
func RegisterBundleServer(s grpc.ServiceRegistrar, srv BundleServer) { |
1132
|
|
|
s.RegisterService(&Bundle_ServiceDesc, srv) |
1133
|
|
|
} |
1134
|
|
|
|
1135
|
|
|
func _Bundle_Write_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
1136
|
|
|
in := new(BundleWriteRequest) |
1137
|
|
|
if err := dec(in); err != nil { |
1138
|
|
|
return nil, err |
1139
|
|
|
} |
1140
|
|
|
if interceptor == nil { |
1141
|
|
|
return srv.(BundleServer).Write(ctx, in) |
1142
|
|
|
} |
1143
|
|
|
info := &grpc.UnaryServerInfo{ |
1144
|
|
|
Server: srv, |
1145
|
|
|
FullMethod: Bundle_Write_FullMethodName, |
1146
|
|
|
} |
1147
|
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
1148
|
|
|
return srv.(BundleServer).Write(ctx, req.(*BundleWriteRequest)) |
1149
|
|
|
} |
1150
|
|
|
return interceptor(ctx, in, info, handler) |
1151
|
|
|
} |
1152
|
|
|
|
1153
|
|
|
func _Bundle_Read_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
1154
|
|
|
in := new(BundleReadRequest) |
1155
|
|
|
if err := dec(in); err != nil { |
1156
|
|
|
return nil, err |
1157
|
|
|
} |
1158
|
|
|
if interceptor == nil { |
1159
|
|
|
return srv.(BundleServer).Read(ctx, in) |
1160
|
|
|
} |
1161
|
|
|
info := &grpc.UnaryServerInfo{ |
1162
|
|
|
Server: srv, |
1163
|
|
|
FullMethod: Bundle_Read_FullMethodName, |
1164
|
|
|
} |
1165
|
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
1166
|
|
|
return srv.(BundleServer).Read(ctx, req.(*BundleReadRequest)) |
1167
|
|
|
} |
1168
|
|
|
return interceptor(ctx, in, info, handler) |
1169
|
|
|
} |
1170
|
|
|
|
1171
|
|
|
func _Bundle_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
1172
|
|
|
in := new(BundleDeleteRequest) |
1173
|
|
|
if err := dec(in); err != nil { |
1174
|
|
|
return nil, err |
1175
|
|
|
} |
1176
|
|
|
if interceptor == nil { |
1177
|
|
|
return srv.(BundleServer).Delete(ctx, in) |
1178
|
|
|
} |
1179
|
|
|
info := &grpc.UnaryServerInfo{ |
1180
|
|
|
Server: srv, |
1181
|
|
|
FullMethod: Bundle_Delete_FullMethodName, |
1182
|
|
|
} |
1183
|
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
1184
|
|
|
return srv.(BundleServer).Delete(ctx, req.(*BundleDeleteRequest)) |
1185
|
|
|
} |
1186
|
|
|
return interceptor(ctx, in, info, handler) |
1187
|
|
|
} |
1188
|
|
|
|
1189
|
|
|
// Bundle_ServiceDesc is the grpc.ServiceDesc for Bundle service. |
1190
|
|
|
// It's only intended for direct use with grpc.RegisterService, |
1191
|
|
|
// and not to be introspected or modified (even as a copy) |
1192
|
|
|
var Bundle_ServiceDesc = grpc.ServiceDesc{ |
1193
|
|
|
ServiceName: "base.v1.Bundle", |
1194
|
|
|
HandlerType: (*BundleServer)(nil), |
1195
|
|
|
Methods: []grpc.MethodDesc{ |
1196
|
|
|
{ |
1197
|
|
|
MethodName: "Write", |
1198
|
|
|
Handler: _Bundle_Write_Handler, |
1199
|
|
|
}, |
1200
|
|
|
{ |
1201
|
|
|
MethodName: "Read", |
1202
|
|
|
Handler: _Bundle_Read_Handler, |
1203
|
|
|
}, |
1204
|
|
|
{ |
1205
|
|
|
MethodName: "Delete", |
1206
|
|
|
Handler: _Bundle_Delete_Handler, |
1207
|
|
|
}, |
1208
|
|
|
}, |
1209
|
|
|
Streams: []grpc.StreamDesc{}, |
1210
|
|
|
Metadata: "base/v1/service.proto", |
1211
|
|
|
} |
1212
|
|
|
|
1213
|
|
|
const ( |
1214
|
|
|
Tenancy_Create_FullMethodName = "/base.v1.Tenancy/Create" |
1215
|
|
|
Tenancy_Delete_FullMethodName = "/base.v1.Tenancy/Delete" |
1216
|
|
|
Tenancy_List_FullMethodName = "/base.v1.Tenancy/List" |
1217
|
|
|
) |
1218
|
|
|
|
1219
|
|
|
// TenancyClient is the client API for Tenancy service. |
1220
|
|
|
// |
1221
|
|
|
// 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. |
1222
|
|
|
type TenancyClient interface { |
1223
|
|
|
// Create is a unary RPC to create a new tenant. |
1224
|
|
|
// It requires a TenantCreateRequest and returns a TenantCreateResponse. |
1225
|
|
|
Create(ctx context.Context, in *TenantCreateRequest, opts ...grpc.CallOption) (*TenantCreateResponse, error) |
1226
|
|
|
// Delete is a unary RPC to delete an existing tenant. |
1227
|
|
|
// It requires a TenantDeleteRequest and returns a TenantDeleteResponse. |
1228
|
|
|
Delete(ctx context.Context, in *TenantDeleteRequest, opts ...grpc.CallOption) (*TenantDeleteResponse, error) |
1229
|
|
|
// List is a unary RPC to get a list of all tenants. |
1230
|
|
|
// It requires a TenantListRequest and returns a TenantListResponse. |
1231
|
|
|
List(ctx context.Context, in *TenantListRequest, opts ...grpc.CallOption) (*TenantListResponse, error) |
1232
|
|
|
} |
1233
|
|
|
|
1234
|
|
|
type tenancyClient struct { |
1235
|
|
|
cc grpc.ClientConnInterface |
1236
|
|
|
} |
1237
|
|
|
|
1238
|
|
|
func NewTenancyClient(cc grpc.ClientConnInterface) TenancyClient { |
1239
|
|
|
return &tenancyClient{cc} |
1240
|
|
|
} |
1241
|
|
|
|
1242
|
|
|
func (c *tenancyClient) Create(ctx context.Context, in *TenantCreateRequest, opts ...grpc.CallOption) (*TenantCreateResponse, error) { |
1243
|
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
1244
|
|
|
out := new(TenantCreateResponse) |
1245
|
|
|
err := c.cc.Invoke(ctx, Tenancy_Create_FullMethodName, in, out, cOpts...) |
1246
|
|
|
if err != nil { |
1247
|
|
|
return nil, err |
1248
|
|
|
} |
1249
|
|
|
return out, nil |
1250
|
|
|
} |
1251
|
|
|
|
1252
|
|
|
func (c *tenancyClient) Delete(ctx context.Context, in *TenantDeleteRequest, opts ...grpc.CallOption) (*TenantDeleteResponse, error) { |
1253
|
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
1254
|
|
|
out := new(TenantDeleteResponse) |
1255
|
|
|
err := c.cc.Invoke(ctx, Tenancy_Delete_FullMethodName, in, out, cOpts...) |
1256
|
|
|
if err != nil { |
1257
|
|
|
return nil, err |
1258
|
|
|
} |
1259
|
|
|
return out, nil |
1260
|
|
|
} |
1261
|
|
|
|
1262
|
|
|
func (c *tenancyClient) List(ctx context.Context, in *TenantListRequest, opts ...grpc.CallOption) (*TenantListResponse, error) { |
1263
|
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
1264
|
|
|
out := new(TenantListResponse) |
1265
|
|
|
err := c.cc.Invoke(ctx, Tenancy_List_FullMethodName, in, out, cOpts...) |
1266
|
|
|
if err != nil { |
1267
|
|
|
return nil, err |
1268
|
|
|
} |
1269
|
|
|
return out, nil |
1270
|
|
|
} |
1271
|
|
|
|
1272
|
|
|
// TenancyServer is the server API for Tenancy service. |
1273
|
|
|
// All implementations must embed UnimplementedTenancyServer |
1274
|
|
|
// for forward compatibility |
1275
|
|
|
type TenancyServer interface { |
1276
|
|
|
// Create is a unary RPC to create a new tenant. |
1277
|
|
|
// It requires a TenantCreateRequest and returns a TenantCreateResponse. |
1278
|
|
|
Create(context.Context, *TenantCreateRequest) (*TenantCreateResponse, error) |
1279
|
|
|
// Delete is a unary RPC to delete an existing tenant. |
1280
|
|
|
// It requires a TenantDeleteRequest and returns a TenantDeleteResponse. |
1281
|
|
|
Delete(context.Context, *TenantDeleteRequest) (*TenantDeleteResponse, error) |
1282
|
|
|
// List is a unary RPC to get a list of all tenants. |
1283
|
|
|
// It requires a TenantListRequest and returns a TenantListResponse. |
1284
|
|
|
List(context.Context, *TenantListRequest) (*TenantListResponse, error) |
1285
|
|
|
mustEmbedUnimplementedTenancyServer() |
1286
|
|
|
} |
1287
|
|
|
|
1288
|
|
|
// UnimplementedTenancyServer must be embedded to have forward compatible implementations. |
1289
|
|
|
type UnimplementedTenancyServer struct { |
1290
|
|
|
} |
1291
|
|
|
|
1292
|
|
|
func (UnimplementedTenancyServer) Create(context.Context, *TenantCreateRequest) (*TenantCreateResponse, error) { |
1293
|
|
|
return nil, status.Errorf(codes.Unimplemented, "method Create not implemented") |
1294
|
|
|
} |
1295
|
|
|
func (UnimplementedTenancyServer) Delete(context.Context, *TenantDeleteRequest) (*TenantDeleteResponse, error) { |
1296
|
|
|
return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented") |
1297
|
|
|
} |
1298
|
|
|
func (UnimplementedTenancyServer) List(context.Context, *TenantListRequest) (*TenantListResponse, error) { |
1299
|
|
|
return nil, status.Errorf(codes.Unimplemented, "method List not implemented") |
1300
|
|
|
} |
1301
|
|
|
func (UnimplementedTenancyServer) mustEmbedUnimplementedTenancyServer() {} |
1302
|
|
|
|
1303
|
|
|
// UnsafeTenancyServer may be embedded to opt out of forward compatibility for this service. |
1304
|
|
|
// Use of this interface is not recommended, as added methods to TenancyServer will |
1305
|
|
|
// result in compilation errors. |
1306
|
|
|
type UnsafeTenancyServer interface { |
1307
|
|
|
mustEmbedUnimplementedTenancyServer() |
1308
|
|
|
} |
1309
|
|
|
|
1310
|
|
|
func RegisterTenancyServer(s grpc.ServiceRegistrar, srv TenancyServer) { |
1311
|
|
|
s.RegisterService(&Tenancy_ServiceDesc, srv) |
1312
|
|
|
} |
1313
|
|
|
|
1314
|
|
|
func _Tenancy_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
1315
|
|
|
in := new(TenantCreateRequest) |
1316
|
|
|
if err := dec(in); err != nil { |
1317
|
|
|
return nil, err |
1318
|
|
|
} |
1319
|
|
|
if interceptor == nil { |
1320
|
|
|
return srv.(TenancyServer).Create(ctx, in) |
1321
|
|
|
} |
1322
|
|
|
info := &grpc.UnaryServerInfo{ |
1323
|
|
|
Server: srv, |
1324
|
|
|
FullMethod: Tenancy_Create_FullMethodName, |
1325
|
|
|
} |
1326
|
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
1327
|
|
|
return srv.(TenancyServer).Create(ctx, req.(*TenantCreateRequest)) |
1328
|
|
|
} |
1329
|
|
|
return interceptor(ctx, in, info, handler) |
1330
|
|
|
} |
1331
|
|
|
|
1332
|
|
|
func _Tenancy_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
1333
|
|
|
in := new(TenantDeleteRequest) |
1334
|
|
|
if err := dec(in); err != nil { |
1335
|
|
|
return nil, err |
1336
|
|
|
} |
1337
|
|
|
if interceptor == nil { |
1338
|
|
|
return srv.(TenancyServer).Delete(ctx, in) |
1339
|
|
|
} |
1340
|
|
|
info := &grpc.UnaryServerInfo{ |
1341
|
|
|
Server: srv, |
1342
|
|
|
FullMethod: Tenancy_Delete_FullMethodName, |
1343
|
|
|
} |
1344
|
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
1345
|
|
|
return srv.(TenancyServer).Delete(ctx, req.(*TenantDeleteRequest)) |
1346
|
|
|
} |
1347
|
|
|
return interceptor(ctx, in, info, handler) |
1348
|
|
|
} |
1349
|
|
|
|
1350
|
|
|
func _Tenancy_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
1351
|
|
|
in := new(TenantListRequest) |
1352
|
|
|
if err := dec(in); err != nil { |
1353
|
|
|
return nil, err |
1354
|
|
|
} |
1355
|
|
|
if interceptor == nil { |
1356
|
|
|
return srv.(TenancyServer).List(ctx, in) |
1357
|
|
|
} |
1358
|
|
|
info := &grpc.UnaryServerInfo{ |
1359
|
|
|
Server: srv, |
1360
|
|
|
FullMethod: Tenancy_List_FullMethodName, |
1361
|
|
|
} |
1362
|
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
1363
|
|
|
return srv.(TenancyServer).List(ctx, req.(*TenantListRequest)) |
1364
|
|
|
} |
1365
|
|
|
return interceptor(ctx, in, info, handler) |
1366
|
|
|
} |
1367
|
|
|
|
1368
|
|
|
// Tenancy_ServiceDesc is the grpc.ServiceDesc for Tenancy service. |
1369
|
|
|
// It's only intended for direct use with grpc.RegisterService, |
1370
|
|
|
// and not to be introspected or modified (even as a copy) |
1371
|
|
|
var Tenancy_ServiceDesc = grpc.ServiceDesc{ |
1372
|
|
|
ServiceName: "base.v1.Tenancy", |
1373
|
|
|
HandlerType: (*TenancyServer)(nil), |
1374
|
|
|
Methods: []grpc.MethodDesc{ |
1375
|
|
|
{ |
1376
|
|
|
MethodName: "Create", |
1377
|
|
|
Handler: _Tenancy_Create_Handler, |
1378
|
|
|
}, |
1379
|
|
|
{ |
1380
|
|
|
MethodName: "Delete", |
1381
|
|
|
Handler: _Tenancy_Delete_Handler, |
1382
|
|
|
}, |
1383
|
|
|
{ |
1384
|
|
|
MethodName: "List", |
1385
|
|
|
Handler: _Tenancy_List_Handler, |
1386
|
|
|
}, |
1387
|
|
|
}, |
1388
|
|
|
Streams: []grpc.StreamDesc{}, |
1389
|
|
|
Metadata: "base/v1/service.proto", |
1390
|
|
|
} |
1391
|
|
|
|