-
Notifications
You must be signed in to change notification settings - Fork 2
/
namespace_grpc.pb.go
332 lines (305 loc) · 12.4 KB
/
namespace_grpc.pb.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
package namespace
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
// NamespaceClient is the client API for Namespace service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type NamespaceClient interface {
// All 获取所有的名称空间
All(ctx context.Context, in *NamespaceAllRequest, opts ...grpc.CallOption) (*NamespaceAllResponse, error)
// Create 创建名称空间
Create(ctx context.Context, in *NamespaceCreateRequest, opts ...grpc.CallOption) (*NamespaceCreateResponse, error)
// Show 查看名称空间详情
Show(ctx context.Context, in *NamespaceShowRequest, opts ...grpc.CallOption) (*NamespaceShowResponse, error)
// Delete 删除名称空间
Delete(ctx context.Context, in *NamespaceDeleteRequest, opts ...grpc.CallOption) (*NamespaceDeleteResponse, error)
// IsExists 名称空间是否存在
IsExists(ctx context.Context, in *NamespaceIsExistsRequest, opts ...grpc.CallOption) (*NamespaceIsExistsResponse, error)
// CpuMemory 名称空间总共使用的 cpu memory
CpuMemory(ctx context.Context, in *NamespaceCpuMemoryRequest, opts ...grpc.CallOption) (*NamespaceCpuMemoryResponse, error)
// ServiceEndpoints 名称空间下面所有服务的 endpoint
ServiceEndpoints(ctx context.Context, in *NamespaceServiceEndpointsRequest, opts ...grpc.CallOption) (*NamespaceServiceEndpointsResponse, error)
}
type namespaceClient struct {
cc grpc.ClientConnInterface
}
func NewNamespaceClient(cc grpc.ClientConnInterface) NamespaceClient {
return &namespaceClient{cc}
}
func (c *namespaceClient) All(ctx context.Context, in *NamespaceAllRequest, opts ...grpc.CallOption) (*NamespaceAllResponse, error) {
out := new(NamespaceAllResponse)
err := c.cc.Invoke(ctx, "/Namespace/All", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *namespaceClient) Create(ctx context.Context, in *NamespaceCreateRequest, opts ...grpc.CallOption) (*NamespaceCreateResponse, error) {
out := new(NamespaceCreateResponse)
err := c.cc.Invoke(ctx, "/Namespace/Create", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *namespaceClient) Show(ctx context.Context, in *NamespaceShowRequest, opts ...grpc.CallOption) (*NamespaceShowResponse, error) {
out := new(NamespaceShowResponse)
err := c.cc.Invoke(ctx, "/Namespace/Show", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *namespaceClient) Delete(ctx context.Context, in *NamespaceDeleteRequest, opts ...grpc.CallOption) (*NamespaceDeleteResponse, error) {
out := new(NamespaceDeleteResponse)
err := c.cc.Invoke(ctx, "/Namespace/Delete", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *namespaceClient) IsExists(ctx context.Context, in *NamespaceIsExistsRequest, opts ...grpc.CallOption) (*NamespaceIsExistsResponse, error) {
out := new(NamespaceIsExistsResponse)
err := c.cc.Invoke(ctx, "/Namespace/IsExists", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *namespaceClient) CpuMemory(ctx context.Context, in *NamespaceCpuMemoryRequest, opts ...grpc.CallOption) (*NamespaceCpuMemoryResponse, error) {
out := new(NamespaceCpuMemoryResponse)
err := c.cc.Invoke(ctx, "/Namespace/CpuMemory", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *namespaceClient) ServiceEndpoints(ctx context.Context, in *NamespaceServiceEndpointsRequest, opts ...grpc.CallOption) (*NamespaceServiceEndpointsResponse, error) {
out := new(NamespaceServiceEndpointsResponse)
err := c.cc.Invoke(ctx, "/Namespace/ServiceEndpoints", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// NamespaceServer is the server API for Namespace service.
// All implementations must embed UnimplementedNamespaceServer
// for forward compatibility
type NamespaceServer interface {
// All 获取所有的名称空间
All(context.Context, *NamespaceAllRequest) (*NamespaceAllResponse, error)
// Create 创建名称空间
Create(context.Context, *NamespaceCreateRequest) (*NamespaceCreateResponse, error)
// Show 查看名称空间详情
Show(context.Context, *NamespaceShowRequest) (*NamespaceShowResponse, error)
// Delete 删除名称空间
Delete(context.Context, *NamespaceDeleteRequest) (*NamespaceDeleteResponse, error)
// IsExists 名称空间是否存在
IsExists(context.Context, *NamespaceIsExistsRequest) (*NamespaceIsExistsResponse, error)
// CpuMemory 名称空间总共使用的 cpu memory
CpuMemory(context.Context, *NamespaceCpuMemoryRequest) (*NamespaceCpuMemoryResponse, error)
// ServiceEndpoints 名称空间下面所有服务的 endpoint
ServiceEndpoints(context.Context, *NamespaceServiceEndpointsRequest) (*NamespaceServiceEndpointsResponse, error)
mustEmbedUnimplementedNamespaceServer()
}
// UnimplementedNamespaceServer must be embedded to have forward compatible implementations.
type UnimplementedNamespaceServer struct {
}
func (UnimplementedNamespaceServer) All(context.Context, *NamespaceAllRequest) (*NamespaceAllResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method All not implemented")
}
func (UnimplementedNamespaceServer) Create(context.Context, *NamespaceCreateRequest) (*NamespaceCreateResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
}
func (UnimplementedNamespaceServer) Show(context.Context, *NamespaceShowRequest) (*NamespaceShowResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Show not implemented")
}
func (UnimplementedNamespaceServer) Delete(context.Context, *NamespaceDeleteRequest) (*NamespaceDeleteResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
}
func (UnimplementedNamespaceServer) IsExists(context.Context, *NamespaceIsExistsRequest) (*NamespaceIsExistsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method IsExists not implemented")
}
func (UnimplementedNamespaceServer) CpuMemory(context.Context, *NamespaceCpuMemoryRequest) (*NamespaceCpuMemoryResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CpuMemory not implemented")
}
func (UnimplementedNamespaceServer) ServiceEndpoints(context.Context, *NamespaceServiceEndpointsRequest) (*NamespaceServiceEndpointsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ServiceEndpoints not implemented")
}
func (UnimplementedNamespaceServer) mustEmbedUnimplementedNamespaceServer() {}
// UnsafeNamespaceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to NamespaceServer will
// result in compilation errors.
type UnsafeNamespaceServer interface {
mustEmbedUnimplementedNamespaceServer()
}
func RegisterNamespaceServer(s grpc.ServiceRegistrar, srv NamespaceServer) {
s.RegisterService(&Namespace_ServiceDesc, srv)
}
func _Namespace_All_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(NamespaceAllRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(NamespaceServer).All(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/Namespace/All",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(NamespaceServer).All(ctx, req.(*NamespaceAllRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Namespace_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(NamespaceCreateRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(NamespaceServer).Create(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/Namespace/Create",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(NamespaceServer).Create(ctx, req.(*NamespaceCreateRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Namespace_Show_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(NamespaceShowRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(NamespaceServer).Show(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/Namespace/Show",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(NamespaceServer).Show(ctx, req.(*NamespaceShowRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Namespace_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(NamespaceDeleteRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(NamespaceServer).Delete(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/Namespace/Delete",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(NamespaceServer).Delete(ctx, req.(*NamespaceDeleteRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Namespace_IsExists_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(NamespaceIsExistsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(NamespaceServer).IsExists(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/Namespace/IsExists",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(NamespaceServer).IsExists(ctx, req.(*NamespaceIsExistsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Namespace_CpuMemory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(NamespaceCpuMemoryRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(NamespaceServer).CpuMemory(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/Namespace/CpuMemory",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(NamespaceServer).CpuMemory(ctx, req.(*NamespaceCpuMemoryRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Namespace_ServiceEndpoints_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(NamespaceServiceEndpointsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(NamespaceServer).ServiceEndpoints(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/Namespace/ServiceEndpoints",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(NamespaceServer).ServiceEndpoints(ctx, req.(*NamespaceServiceEndpointsRequest))
}
return interceptor(ctx, in, info, handler)
}
// Namespace_ServiceDesc is the grpc.ServiceDesc for Namespace service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Namespace_ServiceDesc = grpc.ServiceDesc{
ServiceName: "Namespace",
HandlerType: (*NamespaceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "All",
Handler: _Namespace_All_Handler,
},
{
MethodName: "Create",
Handler: _Namespace_Create_Handler,
},
{
MethodName: "Show",
Handler: _Namespace_Show_Handler,
},
{
MethodName: "Delete",
Handler: _Namespace_Delete_Handler,
},
{
MethodName: "IsExists",
Handler: _Namespace_IsExists_Handler,
},
{
MethodName: "CpuMemory",
Handler: _Namespace_CpuMemory_Handler,
},
{
MethodName: "ServiceEndpoints",
Handler: _Namespace_ServiceEndpoints_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "namespace/namespace.proto",
}