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