-
Notifications
You must be signed in to change notification settings - Fork 1
/
giraffe_service.giraffe.pb.go
306 lines (275 loc) · 9.44 KB
/
giraffe_service.giraffe.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
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: giraffe_service.proto
package apikey
import (
context "context"
fmt "fmt"
giraffe_micro "github.com/easyops-cn/giraffe-micro"
go_proto_giraffe "github.com/easyops-cn/go-proto-giraffe"
proto "github.com/gogo/protobuf/proto"
types "github.com/gogo/protobuf/types"
io "io"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// Reference imports to suppress errors if they are not otherwise used.
var _ = io.EOF
var _ context.Context
var _ giraffe_micro.Client
var _ go_proto_giraffe.Contract
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = giraffe_micro.SupportPackageIsVersion4 // please upgrade the giraffe_micro package
// Client is the client API for apikey service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type Client interface {
CreateApiKey(ctx context.Context, in *CreateApiKeyRequest) (*CreateApiKeyResponse, error)
DeleteApiKey(ctx context.Context, in *DeleteApiKeyRequest) (*types.Empty, error)
DisableApiKey(ctx context.Context, in *DisableApiKeyRequest) (*types.Empty, error)
EnableApiKey(ctx context.Context, in *EnableApiKeyRequest) (*types.Empty, error)
GetApiKey(ctx context.Context, in *types.Empty) (*GetApiKeyResponse, error)
ListApiKey(ctx context.Context, in *ListApiKeyRequest) (*ListApiKeyResponse, error)
ResetApiKey(ctx context.Context, in *ResetApiKeyRequest) (*ResetApiKeyResponse, error)
}
type client struct {
c giraffe_micro.Client
}
func NewClient(c giraffe_micro.Client) Client {
return &client{
c: c,
}
}
func (c *client) CreateApiKey(ctx context.Context, in *CreateApiKeyRequest) (*CreateApiKeyResponse, error) {
out := new(CreateApiKeyResponse)
err := c.c.Invoke(ctx, _CreateApiKeyMethodDesc, in, out)
if err != nil {
return nil, err
}
return out, nil
}
func (c *client) DeleteApiKey(ctx context.Context, in *DeleteApiKeyRequest) (*types.Empty, error) {
out := new(types.Empty)
err := c.c.Invoke(ctx, _DeleteApiKeyMethodDesc, in, out)
if err != nil {
return nil, err
}
return out, nil
}
func (c *client) DisableApiKey(ctx context.Context, in *DisableApiKeyRequest) (*types.Empty, error) {
out := new(types.Empty)
err := c.c.Invoke(ctx, _DisableApiKeyMethodDesc, in, out)
if err != nil {
return nil, err
}
return out, nil
}
func (c *client) EnableApiKey(ctx context.Context, in *EnableApiKeyRequest) (*types.Empty, error) {
out := new(types.Empty)
err := c.c.Invoke(ctx, _EnableApiKeyMethodDesc, in, out)
if err != nil {
return nil, err
}
return out, nil
}
func (c *client) GetApiKey(ctx context.Context, in *types.Empty) (*GetApiKeyResponse, error) {
out := new(GetApiKeyResponse)
err := c.c.Invoke(ctx, _GetApiKeyMethodDesc, in, out)
if err != nil {
return nil, err
}
return out, nil
}
func (c *client) ListApiKey(ctx context.Context, in *ListApiKeyRequest) (*ListApiKeyResponse, error) {
out := new(ListApiKeyResponse)
err := c.c.Invoke(ctx, _ListApiKeyMethodDesc, in, out)
if err != nil {
return nil, err
}
return out, nil
}
func (c *client) ResetApiKey(ctx context.Context, in *ResetApiKeyRequest) (*ResetApiKeyResponse, error) {
out := new(ResetApiKeyResponse)
err := c.c.Invoke(ctx, _ResetApiKeyMethodDesc, in, out)
if err != nil {
return nil, err
}
return out, nil
}
// Service is the server API for apikey service.
type Service interface {
CreateApiKey(context.Context, *CreateApiKeyRequest) (*CreateApiKeyResponse, error)
DeleteApiKey(context.Context, *DeleteApiKeyRequest) (*types.Empty, error)
DisableApiKey(context.Context, *DisableApiKeyRequest) (*types.Empty, error)
EnableApiKey(context.Context, *EnableApiKeyRequest) (*types.Empty, error)
GetApiKey(context.Context, *types.Empty) (*GetApiKeyResponse, error)
ListApiKey(context.Context, *ListApiKeyRequest) (*ListApiKeyResponse, error)
ResetApiKey(context.Context, *ResetApiKeyRequest) (*ResetApiKeyResponse, error)
}
func _CreateApiKeyEndpoint(s Service) giraffe_micro.UnaryEndpoint {
return func(ctx context.Context, req interface{}) (interface{}, error) {
return s.CreateApiKey(ctx, req.(*CreateApiKeyRequest))
}
}
func _DeleteApiKeyEndpoint(s Service) giraffe_micro.UnaryEndpoint {
return func(ctx context.Context, req interface{}) (interface{}, error) {
return s.DeleteApiKey(ctx, req.(*DeleteApiKeyRequest))
}
}
func _DisableApiKeyEndpoint(s Service) giraffe_micro.UnaryEndpoint {
return func(ctx context.Context, req interface{}) (interface{}, error) {
return s.DisableApiKey(ctx, req.(*DisableApiKeyRequest))
}
}
func _EnableApiKeyEndpoint(s Service) giraffe_micro.UnaryEndpoint {
return func(ctx context.Context, req interface{}) (interface{}, error) {
return s.EnableApiKey(ctx, req.(*EnableApiKeyRequest))
}
}
func _GetApiKeyEndpoint(s Service) giraffe_micro.UnaryEndpoint {
return func(ctx context.Context, req interface{}) (interface{}, error) {
return s.GetApiKey(ctx, req.(*types.Empty))
}
}
func _ListApiKeyEndpoint(s Service) giraffe_micro.UnaryEndpoint {
return func(ctx context.Context, req interface{}) (interface{}, error) {
return s.ListApiKey(ctx, req.(*ListApiKeyRequest))
}
}
func _ResetApiKeyEndpoint(s Service) giraffe_micro.UnaryEndpoint {
return func(ctx context.Context, req interface{}) (interface{}, error) {
return s.ResetApiKey(ctx, req.(*ResetApiKeyRequest))
}
}
func RegisterService(s giraffe_micro.Server, srv Service) {
s.RegisterUnaryEndpoint(_CreateApiKeyMethodDesc, _CreateApiKeyEndpoint(srv))
s.RegisterUnaryEndpoint(_DeleteApiKeyMethodDesc, _DeleteApiKeyEndpoint(srv))
s.RegisterUnaryEndpoint(_DisableApiKeyMethodDesc, _DisableApiKeyEndpoint(srv))
s.RegisterUnaryEndpoint(_EnableApiKeyMethodDesc, _EnableApiKeyEndpoint(srv))
s.RegisterUnaryEndpoint(_GetApiKeyMethodDesc, _GetApiKeyEndpoint(srv))
s.RegisterUnaryEndpoint(_ListApiKeyMethodDesc, _ListApiKeyEndpoint(srv))
s.RegisterUnaryEndpoint(_ResetApiKeyMethodDesc, _ResetApiKeyEndpoint(srv))
}
// Method Description
var _CreateApiKeyMethodDesc = &giraffe_micro.MethodDesc{
Contract: &go_proto_giraffe.Contract{
Name: "easyops.api.user_service.apikey.CreateApiKey",
Version: "1.0",
},
ServiceName: "apikey.rpc",
MethodName: "CreateApiKey",
RequestType: (*CreateApiKeyRequest)(nil),
ResponseType: (*CreateApiKeyResponse)(nil),
HttpRule: &go_proto_giraffe.HttpRule{
Pattern: &go_proto_giraffe.HttpRule_Post{
Post: "/api/v1/apikey/:user",
},
Body: "",
ResponseBody: "data",
},
}
var _DeleteApiKeyMethodDesc = &giraffe_micro.MethodDesc{
Contract: &go_proto_giraffe.Contract{
Name: "easyops.api.user_service.apikey.DeleteApiKey",
Version: "1.0",
},
ServiceName: "apikey.rpc",
MethodName: "DeleteApiKey",
RequestType: (*DeleteApiKeyRequest)(nil),
ResponseType: (*types.Empty)(nil),
HttpRule: &go_proto_giraffe.HttpRule{
Pattern: &go_proto_giraffe.HttpRule_Delete{
Delete: "/api/v1/apikey/delete/:access_key",
},
Body: "",
ResponseBody: "data",
},
}
var _DisableApiKeyMethodDesc = &giraffe_micro.MethodDesc{
Contract: &go_proto_giraffe.Contract{
Name: "easyops.api.user_service.apikey.DisableApiKey",
Version: "1.0",
},
ServiceName: "apikey.rpc",
MethodName: "DisableApiKey",
RequestType: (*DisableApiKeyRequest)(nil),
ResponseType: (*types.Empty)(nil),
HttpRule: &go_proto_giraffe.HttpRule{
Pattern: &go_proto_giraffe.HttpRule_Put{
Put: "/api/v1/apikey/disable/:access_key",
},
Body: "",
ResponseBody: "data",
},
}
var _EnableApiKeyMethodDesc = &giraffe_micro.MethodDesc{
Contract: &go_proto_giraffe.Contract{
Name: "easyops.api.user_service.apikey.EnableApiKey",
Version: "1.0",
},
ServiceName: "apikey.rpc",
MethodName: "EnableApiKey",
RequestType: (*EnableApiKeyRequest)(nil),
ResponseType: (*types.Empty)(nil),
HttpRule: &go_proto_giraffe.HttpRule{
Pattern: &go_proto_giraffe.HttpRule_Put{
Put: "/api/v1/apikey/enable/:access_key",
},
Body: "",
ResponseBody: "data",
},
}
var _GetApiKeyMethodDesc = &giraffe_micro.MethodDesc{
Contract: &go_proto_giraffe.Contract{
Name: "easyops.api.user_service.apikey.GetApiKey",
Version: "1.0",
},
ServiceName: "apikey.rpc",
MethodName: "GetApiKey",
RequestType: (*types.Empty)(nil),
ResponseType: (*GetApiKeyResponse)(nil),
HttpRule: &go_proto_giraffe.HttpRule{
Pattern: &go_proto_giraffe.HttpRule_Get{
Get: "/profile/apikey",
},
Body: "",
ResponseBody: "data",
},
}
var _ListApiKeyMethodDesc = &giraffe_micro.MethodDesc{
Contract: &go_proto_giraffe.Contract{
Name: "easyops.api.user_service.apikey.ListApiKey",
Version: "1.0",
},
ServiceName: "apikey.rpc",
MethodName: "ListApiKey",
RequestType: (*ListApiKeyRequest)(nil),
ResponseType: (*ListApiKeyResponse)(nil),
HttpRule: &go_proto_giraffe.HttpRule{
Pattern: &go_proto_giraffe.HttpRule_Get{
Get: "/api/v1/apikey",
},
Body: "",
ResponseBody: "data",
},
}
var _ResetApiKeyMethodDesc = &giraffe_micro.MethodDesc{
Contract: &go_proto_giraffe.Contract{
Name: "easyops.api.user_service.apikey.ResetApiKey",
Version: "1.0",
},
ServiceName: "apikey.rpc",
MethodName: "ResetApiKey",
RequestType: (*ResetApiKeyRequest)(nil),
ResponseType: (*ResetApiKeyResponse)(nil),
HttpRule: &go_proto_giraffe.HttpRule{
Pattern: &go_proto_giraffe.HttpRule_Put{
Put: "/api/v1/apikey/_reset/:user",
},
Body: "",
ResponseBody: "data",
},
}