khenaidoo | ab1f7bd | 2019-11-14 14:00:27 -0500 | [diff] [blame] | 1 | // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. |
| 2 | // source: etcdserver/etcdserverpb/rpc.proto |
| 3 | |
| 4 | /* |
| 5 | Package etcdserverpb is a reverse proxy. |
| 6 | |
| 7 | It translates gRPC into RESTful JSON APIs. |
| 8 | */ |
| 9 | package gw |
| 10 | |
| 11 | import ( |
| 12 | "go.etcd.io/etcd/etcdserver/etcdserverpb" |
| 13 | "io" |
| 14 | "net/http" |
| 15 | |
| 16 | "github.com/golang/protobuf/proto" |
| 17 | "github.com/grpc-ecosystem/grpc-gateway/runtime" |
| 18 | "github.com/grpc-ecosystem/grpc-gateway/utilities" |
| 19 | "golang.org/x/net/context" |
| 20 | "google.golang.org/grpc" |
| 21 | "google.golang.org/grpc/codes" |
| 22 | "google.golang.org/grpc/grpclog" |
| 23 | "google.golang.org/grpc/status" |
| 24 | ) |
| 25 | |
| 26 | var _ codes.Code |
| 27 | var _ io.Reader |
| 28 | var _ status.Status |
| 29 | var _ = runtime.String |
| 30 | var _ = utilities.NewDoubleArray |
| 31 | |
| 32 | func request_KV_Range_0(ctx context.Context, marshaler runtime.Marshaler, client etcdserverpb.KVClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { |
| 33 | var protoReq etcdserverpb.RangeRequest |
| 34 | var metadata runtime.ServerMetadata |
| 35 | |
| 36 | if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { |
| 37 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) |
| 38 | } |
| 39 | |
| 40 | msg, err := client.Range(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) |
| 41 | return msg, metadata, err |
| 42 | |
| 43 | } |
| 44 | |
| 45 | func request_KV_Put_0(ctx context.Context, marshaler runtime.Marshaler, client etcdserverpb.KVClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { |
| 46 | var protoReq etcdserverpb.PutRequest |
| 47 | var metadata runtime.ServerMetadata |
| 48 | |
| 49 | if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { |
| 50 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) |
| 51 | } |
| 52 | |
| 53 | msg, err := client.Put(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) |
| 54 | return msg, metadata, err |
| 55 | |
| 56 | } |
| 57 | |
| 58 | func request_KV_DeleteRange_0(ctx context.Context, marshaler runtime.Marshaler, client etcdserverpb.KVClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { |
| 59 | var protoReq etcdserverpb.DeleteRangeRequest |
| 60 | var metadata runtime.ServerMetadata |
| 61 | |
| 62 | if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { |
| 63 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) |
| 64 | } |
| 65 | |
| 66 | msg, err := client.DeleteRange(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) |
| 67 | return msg, metadata, err |
| 68 | |
| 69 | } |
| 70 | |
| 71 | func request_KV_Txn_0(ctx context.Context, marshaler runtime.Marshaler, client etcdserverpb.KVClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { |
| 72 | var protoReq etcdserverpb.TxnRequest |
| 73 | var metadata runtime.ServerMetadata |
| 74 | |
| 75 | if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { |
| 76 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) |
| 77 | } |
| 78 | |
| 79 | msg, err := client.Txn(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) |
| 80 | return msg, metadata, err |
| 81 | |
| 82 | } |
| 83 | |
| 84 | func request_KV_Compact_0(ctx context.Context, marshaler runtime.Marshaler, client etcdserverpb.KVClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { |
| 85 | var protoReq etcdserverpb.CompactionRequest |
| 86 | var metadata runtime.ServerMetadata |
| 87 | |
| 88 | if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { |
| 89 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) |
| 90 | } |
| 91 | |
| 92 | msg, err := client.Compact(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) |
| 93 | return msg, metadata, err |
| 94 | |
| 95 | } |
| 96 | |
| 97 | func request_Watch_Watch_0(ctx context.Context, marshaler runtime.Marshaler, client etcdserverpb.WatchClient, req *http.Request, pathParams map[string]string) (etcdserverpb.Watch_WatchClient, runtime.ServerMetadata, error) { |
| 98 | var metadata runtime.ServerMetadata |
| 99 | stream, err := client.Watch(ctx) |
| 100 | if err != nil { |
| 101 | grpclog.Printf("Failed to start streaming: %v", err) |
| 102 | return nil, metadata, err |
| 103 | } |
| 104 | dec := marshaler.NewDecoder(req.Body) |
| 105 | handleSend := func() error { |
| 106 | var protoReq etcdserverpb.WatchRequest |
| 107 | err := dec.Decode(&protoReq) |
| 108 | if err == io.EOF { |
| 109 | return err |
| 110 | } |
| 111 | if err != nil { |
| 112 | grpclog.Printf("Failed to decode request: %v", err) |
| 113 | return err |
| 114 | } |
| 115 | if err := stream.Send(&protoReq); err != nil { |
| 116 | grpclog.Printf("Failed to send request: %v", err) |
| 117 | return err |
| 118 | } |
| 119 | return nil |
| 120 | } |
| 121 | if err := handleSend(); err != nil { |
| 122 | if cerr := stream.CloseSend(); cerr != nil { |
| 123 | grpclog.Printf("Failed to terminate client stream: %v", cerr) |
| 124 | } |
| 125 | if err == io.EOF { |
| 126 | return stream, metadata, nil |
| 127 | } |
| 128 | return nil, metadata, err |
| 129 | } |
| 130 | go func() { |
| 131 | for { |
| 132 | if err := handleSend(); err != nil { |
| 133 | break |
| 134 | } |
| 135 | } |
| 136 | if err := stream.CloseSend(); err != nil { |
| 137 | grpclog.Printf("Failed to terminate client stream: %v", err) |
| 138 | } |
| 139 | }() |
| 140 | header, err := stream.Header() |
| 141 | if err != nil { |
| 142 | grpclog.Printf("Failed to get header from client: %v", err) |
| 143 | return nil, metadata, err |
| 144 | } |
| 145 | metadata.HeaderMD = header |
| 146 | return stream, metadata, nil |
| 147 | } |
| 148 | |
| 149 | func request_Lease_LeaseGrant_0(ctx context.Context, marshaler runtime.Marshaler, client etcdserverpb.LeaseClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { |
| 150 | var protoReq etcdserverpb.LeaseGrantRequest |
| 151 | var metadata runtime.ServerMetadata |
| 152 | |
| 153 | if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { |
| 154 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) |
| 155 | } |
| 156 | |
| 157 | msg, err := client.LeaseGrant(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) |
| 158 | return msg, metadata, err |
| 159 | |
| 160 | } |
| 161 | |
| 162 | func request_Lease_LeaseRevoke_0(ctx context.Context, marshaler runtime.Marshaler, client etcdserverpb.LeaseClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { |
| 163 | var protoReq etcdserverpb.LeaseRevokeRequest |
| 164 | var metadata runtime.ServerMetadata |
| 165 | |
| 166 | if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { |
| 167 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) |
| 168 | } |
| 169 | |
| 170 | msg, err := client.LeaseRevoke(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) |
| 171 | return msg, metadata, err |
| 172 | |
| 173 | } |
| 174 | |
| 175 | func request_Lease_LeaseRevoke_1(ctx context.Context, marshaler runtime.Marshaler, client etcdserverpb.LeaseClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { |
| 176 | var protoReq etcdserverpb.LeaseRevokeRequest |
| 177 | var metadata runtime.ServerMetadata |
| 178 | |
| 179 | if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { |
| 180 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) |
| 181 | } |
| 182 | |
| 183 | msg, err := client.LeaseRevoke(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) |
| 184 | return msg, metadata, err |
| 185 | |
| 186 | } |
| 187 | |
| 188 | func request_Lease_LeaseKeepAlive_0(ctx context.Context, marshaler runtime.Marshaler, client etcdserverpb.LeaseClient, req *http.Request, pathParams map[string]string) (etcdserverpb.Lease_LeaseKeepAliveClient, runtime.ServerMetadata, error) { |
| 189 | var metadata runtime.ServerMetadata |
| 190 | stream, err := client.LeaseKeepAlive(ctx) |
| 191 | if err != nil { |
| 192 | grpclog.Printf("Failed to start streaming: %v", err) |
| 193 | return nil, metadata, err |
| 194 | } |
| 195 | dec := marshaler.NewDecoder(req.Body) |
| 196 | handleSend := func() error { |
| 197 | var protoReq etcdserverpb.LeaseKeepAliveRequest |
| 198 | err := dec.Decode(&protoReq) |
| 199 | if err == io.EOF { |
| 200 | return err |
| 201 | } |
| 202 | if err != nil { |
| 203 | grpclog.Printf("Failed to decode request: %v", err) |
| 204 | return err |
| 205 | } |
| 206 | if err := stream.Send(&protoReq); err != nil { |
| 207 | grpclog.Printf("Failed to send request: %v", err) |
| 208 | return err |
| 209 | } |
| 210 | return nil |
| 211 | } |
| 212 | if err := handleSend(); err != nil { |
| 213 | if cerr := stream.CloseSend(); cerr != nil { |
| 214 | grpclog.Printf("Failed to terminate client stream: %v", cerr) |
| 215 | } |
| 216 | if err == io.EOF { |
| 217 | return stream, metadata, nil |
| 218 | } |
| 219 | return nil, metadata, err |
| 220 | } |
| 221 | go func() { |
| 222 | for { |
| 223 | if err := handleSend(); err != nil { |
| 224 | break |
| 225 | } |
| 226 | } |
| 227 | if err := stream.CloseSend(); err != nil { |
| 228 | grpclog.Printf("Failed to terminate client stream: %v", err) |
| 229 | } |
| 230 | }() |
| 231 | header, err := stream.Header() |
| 232 | if err != nil { |
| 233 | grpclog.Printf("Failed to get header from client: %v", err) |
| 234 | return nil, metadata, err |
| 235 | } |
| 236 | metadata.HeaderMD = header |
| 237 | return stream, metadata, nil |
| 238 | } |
| 239 | |
| 240 | func request_Lease_LeaseTimeToLive_0(ctx context.Context, marshaler runtime.Marshaler, client etcdserverpb.LeaseClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { |
| 241 | var protoReq etcdserverpb.LeaseTimeToLiveRequest |
| 242 | var metadata runtime.ServerMetadata |
| 243 | |
| 244 | if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { |
| 245 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) |
| 246 | } |
| 247 | |
| 248 | msg, err := client.LeaseTimeToLive(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) |
| 249 | return msg, metadata, err |
| 250 | |
| 251 | } |
| 252 | |
| 253 | func request_Lease_LeaseTimeToLive_1(ctx context.Context, marshaler runtime.Marshaler, client etcdserverpb.LeaseClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { |
| 254 | var protoReq etcdserverpb.LeaseTimeToLiveRequest |
| 255 | var metadata runtime.ServerMetadata |
| 256 | |
| 257 | if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { |
| 258 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) |
| 259 | } |
| 260 | |
| 261 | msg, err := client.LeaseTimeToLive(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) |
| 262 | return msg, metadata, err |
| 263 | |
| 264 | } |
| 265 | |
| 266 | func request_Lease_LeaseLeases_0(ctx context.Context, marshaler runtime.Marshaler, client etcdserverpb.LeaseClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { |
| 267 | var protoReq etcdserverpb.LeaseLeasesRequest |
| 268 | var metadata runtime.ServerMetadata |
| 269 | |
| 270 | if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { |
| 271 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) |
| 272 | } |
| 273 | |
| 274 | msg, err := client.LeaseLeases(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) |
| 275 | return msg, metadata, err |
| 276 | |
| 277 | } |
| 278 | |
| 279 | func request_Lease_LeaseLeases_1(ctx context.Context, marshaler runtime.Marshaler, client etcdserverpb.LeaseClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { |
| 280 | var protoReq etcdserverpb.LeaseLeasesRequest |
| 281 | var metadata runtime.ServerMetadata |
| 282 | |
| 283 | if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { |
| 284 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) |
| 285 | } |
| 286 | |
| 287 | msg, err := client.LeaseLeases(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) |
| 288 | return msg, metadata, err |
| 289 | |
| 290 | } |
| 291 | |
| 292 | func request_Cluster_MemberAdd_0(ctx context.Context, marshaler runtime.Marshaler, client etcdserverpb.ClusterClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { |
| 293 | var protoReq etcdserverpb.MemberAddRequest |
| 294 | var metadata runtime.ServerMetadata |
| 295 | |
| 296 | if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { |
| 297 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) |
| 298 | } |
| 299 | |
| 300 | msg, err := client.MemberAdd(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) |
| 301 | return msg, metadata, err |
| 302 | |
| 303 | } |
| 304 | |
| 305 | func request_Cluster_MemberRemove_0(ctx context.Context, marshaler runtime.Marshaler, client etcdserverpb.ClusterClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { |
| 306 | var protoReq etcdserverpb.MemberRemoveRequest |
| 307 | var metadata runtime.ServerMetadata |
| 308 | |
| 309 | if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { |
| 310 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) |
| 311 | } |
| 312 | |
| 313 | msg, err := client.MemberRemove(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) |
| 314 | return msg, metadata, err |
| 315 | |
| 316 | } |
| 317 | |
| 318 | func request_Cluster_MemberUpdate_0(ctx context.Context, marshaler runtime.Marshaler, client etcdserverpb.ClusterClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { |
| 319 | var protoReq etcdserverpb.MemberUpdateRequest |
| 320 | var metadata runtime.ServerMetadata |
| 321 | |
| 322 | if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { |
| 323 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) |
| 324 | } |
| 325 | |
| 326 | msg, err := client.MemberUpdate(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) |
| 327 | return msg, metadata, err |
| 328 | |
| 329 | } |
| 330 | |
| 331 | func request_Cluster_MemberList_0(ctx context.Context, marshaler runtime.Marshaler, client etcdserverpb.ClusterClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { |
| 332 | var protoReq etcdserverpb.MemberListRequest |
| 333 | var metadata runtime.ServerMetadata |
| 334 | |
| 335 | if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { |
| 336 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) |
| 337 | } |
| 338 | |
| 339 | msg, err := client.MemberList(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) |
| 340 | return msg, metadata, err |
| 341 | |
| 342 | } |
| 343 | |
| 344 | func request_Cluster_MemberPromote_0(ctx context.Context, marshaler runtime.Marshaler, client etcdserverpb.ClusterClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { |
| 345 | var protoReq etcdserverpb.MemberPromoteRequest |
| 346 | var metadata runtime.ServerMetadata |
| 347 | |
| 348 | if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { |
| 349 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) |
| 350 | } |
| 351 | |
| 352 | msg, err := client.MemberPromote(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) |
| 353 | return msg, metadata, err |
| 354 | |
| 355 | } |
| 356 | |
| 357 | func request_Maintenance_Alarm_0(ctx context.Context, marshaler runtime.Marshaler, client etcdserverpb.MaintenanceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { |
| 358 | var protoReq etcdserverpb.AlarmRequest |
| 359 | var metadata runtime.ServerMetadata |
| 360 | |
| 361 | if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { |
| 362 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) |
| 363 | } |
| 364 | |
| 365 | msg, err := client.Alarm(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) |
| 366 | return msg, metadata, err |
| 367 | |
| 368 | } |
| 369 | |
| 370 | func request_Maintenance_Status_0(ctx context.Context, marshaler runtime.Marshaler, client etcdserverpb.MaintenanceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { |
| 371 | var protoReq etcdserverpb.StatusRequest |
| 372 | var metadata runtime.ServerMetadata |
| 373 | |
| 374 | if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { |
| 375 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) |
| 376 | } |
| 377 | |
| 378 | msg, err := client.Status(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) |
| 379 | return msg, metadata, err |
| 380 | |
| 381 | } |
| 382 | |
| 383 | func request_Maintenance_Defragment_0(ctx context.Context, marshaler runtime.Marshaler, client etcdserverpb.MaintenanceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { |
| 384 | var protoReq etcdserverpb.DefragmentRequest |
| 385 | var metadata runtime.ServerMetadata |
| 386 | |
| 387 | if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { |
| 388 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) |
| 389 | } |
| 390 | |
| 391 | msg, err := client.Defragment(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) |
| 392 | return msg, metadata, err |
| 393 | |
| 394 | } |
| 395 | |
| 396 | func request_Maintenance_Hash_0(ctx context.Context, marshaler runtime.Marshaler, client etcdserverpb.MaintenanceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { |
| 397 | var protoReq etcdserverpb.HashRequest |
| 398 | var metadata runtime.ServerMetadata |
| 399 | |
| 400 | if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { |
| 401 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) |
| 402 | } |
| 403 | |
| 404 | msg, err := client.Hash(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) |
| 405 | return msg, metadata, err |
| 406 | |
| 407 | } |
| 408 | |
| 409 | func request_Maintenance_HashKV_0(ctx context.Context, marshaler runtime.Marshaler, client etcdserverpb.MaintenanceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { |
| 410 | var protoReq etcdserverpb.HashKVRequest |
| 411 | var metadata runtime.ServerMetadata |
| 412 | |
| 413 | if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { |
| 414 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) |
| 415 | } |
| 416 | |
| 417 | msg, err := client.HashKV(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) |
| 418 | return msg, metadata, err |
| 419 | |
| 420 | } |
| 421 | |
| 422 | func request_Maintenance_Snapshot_0(ctx context.Context, marshaler runtime.Marshaler, client etcdserverpb.MaintenanceClient, req *http.Request, pathParams map[string]string) (etcdserverpb.Maintenance_SnapshotClient, runtime.ServerMetadata, error) { |
| 423 | var protoReq etcdserverpb.SnapshotRequest |
| 424 | var metadata runtime.ServerMetadata |
| 425 | |
| 426 | if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { |
| 427 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) |
| 428 | } |
| 429 | |
| 430 | stream, err := client.Snapshot(ctx, &protoReq) |
| 431 | if err != nil { |
| 432 | return nil, metadata, err |
| 433 | } |
| 434 | header, err := stream.Header() |
| 435 | if err != nil { |
| 436 | return nil, metadata, err |
| 437 | } |
| 438 | metadata.HeaderMD = header |
| 439 | return stream, metadata, nil |
| 440 | |
| 441 | } |
| 442 | |
| 443 | func request_Maintenance_MoveLeader_0(ctx context.Context, marshaler runtime.Marshaler, client etcdserverpb.MaintenanceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { |
| 444 | var protoReq etcdserverpb.MoveLeaderRequest |
| 445 | var metadata runtime.ServerMetadata |
| 446 | |
| 447 | if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { |
| 448 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) |
| 449 | } |
| 450 | |
| 451 | msg, err := client.MoveLeader(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) |
| 452 | return msg, metadata, err |
| 453 | |
| 454 | } |
| 455 | |
| 456 | func request_Auth_AuthEnable_0(ctx context.Context, marshaler runtime.Marshaler, client etcdserverpb.AuthClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { |
| 457 | var protoReq etcdserverpb.AuthEnableRequest |
| 458 | var metadata runtime.ServerMetadata |
| 459 | |
| 460 | if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { |
| 461 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) |
| 462 | } |
| 463 | |
| 464 | msg, err := client.AuthEnable(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) |
| 465 | return msg, metadata, err |
| 466 | |
| 467 | } |
| 468 | |
| 469 | func request_Auth_AuthDisable_0(ctx context.Context, marshaler runtime.Marshaler, client etcdserverpb.AuthClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { |
| 470 | var protoReq etcdserverpb.AuthDisableRequest |
| 471 | var metadata runtime.ServerMetadata |
| 472 | |
| 473 | if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { |
| 474 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) |
| 475 | } |
| 476 | |
| 477 | msg, err := client.AuthDisable(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) |
| 478 | return msg, metadata, err |
| 479 | |
| 480 | } |
| 481 | |
| 482 | func request_Auth_Authenticate_0(ctx context.Context, marshaler runtime.Marshaler, client etcdserverpb.AuthClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { |
| 483 | var protoReq etcdserverpb.AuthenticateRequest |
| 484 | var metadata runtime.ServerMetadata |
| 485 | |
| 486 | if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { |
| 487 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) |
| 488 | } |
| 489 | |
| 490 | msg, err := client.Authenticate(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) |
| 491 | return msg, metadata, err |
| 492 | |
| 493 | } |
| 494 | |
| 495 | func request_Auth_UserAdd_0(ctx context.Context, marshaler runtime.Marshaler, client etcdserverpb.AuthClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { |
| 496 | var protoReq etcdserverpb.AuthUserAddRequest |
| 497 | var metadata runtime.ServerMetadata |
| 498 | |
| 499 | if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { |
| 500 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) |
| 501 | } |
| 502 | |
| 503 | msg, err := client.UserAdd(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) |
| 504 | return msg, metadata, err |
| 505 | |
| 506 | } |
| 507 | |
| 508 | func request_Auth_UserGet_0(ctx context.Context, marshaler runtime.Marshaler, client etcdserverpb.AuthClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { |
| 509 | var protoReq etcdserverpb.AuthUserGetRequest |
| 510 | var metadata runtime.ServerMetadata |
| 511 | |
| 512 | if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { |
| 513 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) |
| 514 | } |
| 515 | |
| 516 | msg, err := client.UserGet(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) |
| 517 | return msg, metadata, err |
| 518 | |
| 519 | } |
| 520 | |
| 521 | func request_Auth_UserList_0(ctx context.Context, marshaler runtime.Marshaler, client etcdserverpb.AuthClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { |
| 522 | var protoReq etcdserverpb.AuthUserListRequest |
| 523 | var metadata runtime.ServerMetadata |
| 524 | |
| 525 | if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { |
| 526 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) |
| 527 | } |
| 528 | |
| 529 | msg, err := client.UserList(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) |
| 530 | return msg, metadata, err |
| 531 | |
| 532 | } |
| 533 | |
| 534 | func request_Auth_UserDelete_0(ctx context.Context, marshaler runtime.Marshaler, client etcdserverpb.AuthClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { |
| 535 | var protoReq etcdserverpb.AuthUserDeleteRequest |
| 536 | var metadata runtime.ServerMetadata |
| 537 | |
| 538 | if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { |
| 539 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) |
| 540 | } |
| 541 | |
| 542 | msg, err := client.UserDelete(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) |
| 543 | return msg, metadata, err |
| 544 | |
| 545 | } |
| 546 | |
| 547 | func request_Auth_UserChangePassword_0(ctx context.Context, marshaler runtime.Marshaler, client etcdserverpb.AuthClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { |
| 548 | var protoReq etcdserverpb.AuthUserChangePasswordRequest |
| 549 | var metadata runtime.ServerMetadata |
| 550 | |
| 551 | if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { |
| 552 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) |
| 553 | } |
| 554 | |
| 555 | msg, err := client.UserChangePassword(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) |
| 556 | return msg, metadata, err |
| 557 | |
| 558 | } |
| 559 | |
| 560 | func request_Auth_UserGrantRole_0(ctx context.Context, marshaler runtime.Marshaler, client etcdserverpb.AuthClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { |
| 561 | var protoReq etcdserverpb.AuthUserGrantRoleRequest |
| 562 | var metadata runtime.ServerMetadata |
| 563 | |
| 564 | if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { |
| 565 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) |
| 566 | } |
| 567 | |
| 568 | msg, err := client.UserGrantRole(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) |
| 569 | return msg, metadata, err |
| 570 | |
| 571 | } |
| 572 | |
| 573 | func request_Auth_UserRevokeRole_0(ctx context.Context, marshaler runtime.Marshaler, client etcdserverpb.AuthClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { |
| 574 | var protoReq etcdserverpb.AuthUserRevokeRoleRequest |
| 575 | var metadata runtime.ServerMetadata |
| 576 | |
| 577 | if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { |
| 578 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) |
| 579 | } |
| 580 | |
| 581 | msg, err := client.UserRevokeRole(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) |
| 582 | return msg, metadata, err |
| 583 | |
| 584 | } |
| 585 | |
| 586 | func request_Auth_RoleAdd_0(ctx context.Context, marshaler runtime.Marshaler, client etcdserverpb.AuthClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { |
| 587 | var protoReq etcdserverpb.AuthRoleAddRequest |
| 588 | var metadata runtime.ServerMetadata |
| 589 | |
| 590 | if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { |
| 591 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) |
| 592 | } |
| 593 | |
| 594 | msg, err := client.RoleAdd(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) |
| 595 | return msg, metadata, err |
| 596 | |
| 597 | } |
| 598 | |
| 599 | func request_Auth_RoleGet_0(ctx context.Context, marshaler runtime.Marshaler, client etcdserverpb.AuthClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { |
| 600 | var protoReq etcdserverpb.AuthRoleGetRequest |
| 601 | var metadata runtime.ServerMetadata |
| 602 | |
| 603 | if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { |
| 604 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) |
| 605 | } |
| 606 | |
| 607 | msg, err := client.RoleGet(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) |
| 608 | return msg, metadata, err |
| 609 | |
| 610 | } |
| 611 | |
| 612 | func request_Auth_RoleList_0(ctx context.Context, marshaler runtime.Marshaler, client etcdserverpb.AuthClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { |
| 613 | var protoReq etcdserverpb.AuthRoleListRequest |
| 614 | var metadata runtime.ServerMetadata |
| 615 | |
| 616 | if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { |
| 617 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) |
| 618 | } |
| 619 | |
| 620 | msg, err := client.RoleList(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) |
| 621 | return msg, metadata, err |
| 622 | |
| 623 | } |
| 624 | |
| 625 | func request_Auth_RoleDelete_0(ctx context.Context, marshaler runtime.Marshaler, client etcdserverpb.AuthClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { |
| 626 | var protoReq etcdserverpb.AuthRoleDeleteRequest |
| 627 | var metadata runtime.ServerMetadata |
| 628 | |
| 629 | if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { |
| 630 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) |
| 631 | } |
| 632 | |
| 633 | msg, err := client.RoleDelete(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) |
| 634 | return msg, metadata, err |
| 635 | |
| 636 | } |
| 637 | |
| 638 | func request_Auth_RoleGrantPermission_0(ctx context.Context, marshaler runtime.Marshaler, client etcdserverpb.AuthClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { |
| 639 | var protoReq etcdserverpb.AuthRoleGrantPermissionRequest |
| 640 | var metadata runtime.ServerMetadata |
| 641 | |
| 642 | if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { |
| 643 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) |
| 644 | } |
| 645 | |
| 646 | msg, err := client.RoleGrantPermission(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) |
| 647 | return msg, metadata, err |
| 648 | |
| 649 | } |
| 650 | |
| 651 | func request_Auth_RoleRevokePermission_0(ctx context.Context, marshaler runtime.Marshaler, client etcdserverpb.AuthClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { |
| 652 | var protoReq etcdserverpb.AuthRoleRevokePermissionRequest |
| 653 | var metadata runtime.ServerMetadata |
| 654 | |
| 655 | if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { |
| 656 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) |
| 657 | } |
| 658 | |
| 659 | msg, err := client.RoleRevokePermission(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) |
| 660 | return msg, metadata, err |
| 661 | |
| 662 | } |
| 663 | |
| 664 | // RegisterKVHandlerFromEndpoint is same as RegisterKVHandler but |
| 665 | // automatically dials to "endpoint" and closes the connection when "ctx" gets done. |
| 666 | func RegisterKVHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { |
| 667 | conn, err := grpc.Dial(endpoint, opts...) |
| 668 | if err != nil { |
| 669 | return err |
| 670 | } |
| 671 | defer func() { |
| 672 | if err != nil { |
| 673 | if cerr := conn.Close(); cerr != nil { |
| 674 | grpclog.Printf("Failed to close conn to %s: %v", endpoint, cerr) |
| 675 | } |
| 676 | return |
| 677 | } |
| 678 | go func() { |
| 679 | <-ctx.Done() |
| 680 | if cerr := conn.Close(); cerr != nil { |
| 681 | grpclog.Printf("Failed to close conn to %s: %v", endpoint, cerr) |
| 682 | } |
| 683 | }() |
| 684 | }() |
| 685 | |
| 686 | return RegisterKVHandler(ctx, mux, conn) |
| 687 | } |
| 688 | |
| 689 | // RegisterKVHandler registers the http handlers for service KV to "mux". |
| 690 | // The handlers forward requests to the grpc endpoint over "conn". |
| 691 | func RegisterKVHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { |
| 692 | return RegisterKVHandlerClient(ctx, mux, etcdserverpb.NewKVClient(conn)) |
| 693 | } |
| 694 | |
| 695 | // RegisterKVHandler registers the http handlers for service KV to "mux". |
| 696 | // The handlers forward requests to the grpc endpoint over the given implementation of "KVClient". |
| 697 | // Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "KVClient" |
| 698 | // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in |
| 699 | // "KVClient" to call the correct interceptors. |
| 700 | func RegisterKVHandlerClient(ctx context.Context, mux *runtime.ServeMux, client etcdserverpb.KVClient) error { |
| 701 | |
| 702 | mux.Handle("POST", pattern_KV_Range_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { |
| 703 | ctx, cancel := context.WithCancel(req.Context()) |
| 704 | defer cancel() |
| 705 | if cn, ok := w.(http.CloseNotifier); ok { |
| 706 | go func(done <-chan struct{}, closed <-chan bool) { |
| 707 | select { |
| 708 | case <-done: |
| 709 | case <-closed: |
| 710 | cancel() |
| 711 | } |
| 712 | }(ctx.Done(), cn.CloseNotify()) |
| 713 | } |
| 714 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) |
| 715 | rctx, err := runtime.AnnotateContext(ctx, mux, req) |
| 716 | if err != nil { |
| 717 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 718 | return |
| 719 | } |
| 720 | resp, md, err := request_KV_Range_0(rctx, inboundMarshaler, client, req, pathParams) |
| 721 | ctx = runtime.NewServerMetadataContext(ctx, md) |
| 722 | if err != nil { |
| 723 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 724 | return |
| 725 | } |
| 726 | |
| 727 | forward_KV_Range_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) |
| 728 | |
| 729 | }) |
| 730 | |
| 731 | mux.Handle("POST", pattern_KV_Put_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { |
| 732 | ctx, cancel := context.WithCancel(req.Context()) |
| 733 | defer cancel() |
| 734 | if cn, ok := w.(http.CloseNotifier); ok { |
| 735 | go func(done <-chan struct{}, closed <-chan bool) { |
| 736 | select { |
| 737 | case <-done: |
| 738 | case <-closed: |
| 739 | cancel() |
| 740 | } |
| 741 | }(ctx.Done(), cn.CloseNotify()) |
| 742 | } |
| 743 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) |
| 744 | rctx, err := runtime.AnnotateContext(ctx, mux, req) |
| 745 | if err != nil { |
| 746 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 747 | return |
| 748 | } |
| 749 | resp, md, err := request_KV_Put_0(rctx, inboundMarshaler, client, req, pathParams) |
| 750 | ctx = runtime.NewServerMetadataContext(ctx, md) |
| 751 | if err != nil { |
| 752 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 753 | return |
| 754 | } |
| 755 | |
| 756 | forward_KV_Put_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) |
| 757 | |
| 758 | }) |
| 759 | |
| 760 | mux.Handle("POST", pattern_KV_DeleteRange_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { |
| 761 | ctx, cancel := context.WithCancel(req.Context()) |
| 762 | defer cancel() |
| 763 | if cn, ok := w.(http.CloseNotifier); ok { |
| 764 | go func(done <-chan struct{}, closed <-chan bool) { |
| 765 | select { |
| 766 | case <-done: |
| 767 | case <-closed: |
| 768 | cancel() |
| 769 | } |
| 770 | }(ctx.Done(), cn.CloseNotify()) |
| 771 | } |
| 772 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) |
| 773 | rctx, err := runtime.AnnotateContext(ctx, mux, req) |
| 774 | if err != nil { |
| 775 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 776 | return |
| 777 | } |
| 778 | resp, md, err := request_KV_DeleteRange_0(rctx, inboundMarshaler, client, req, pathParams) |
| 779 | ctx = runtime.NewServerMetadataContext(ctx, md) |
| 780 | if err != nil { |
| 781 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 782 | return |
| 783 | } |
| 784 | |
| 785 | forward_KV_DeleteRange_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) |
| 786 | |
| 787 | }) |
| 788 | |
| 789 | mux.Handle("POST", pattern_KV_Txn_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { |
| 790 | ctx, cancel := context.WithCancel(req.Context()) |
| 791 | defer cancel() |
| 792 | if cn, ok := w.(http.CloseNotifier); ok { |
| 793 | go func(done <-chan struct{}, closed <-chan bool) { |
| 794 | select { |
| 795 | case <-done: |
| 796 | case <-closed: |
| 797 | cancel() |
| 798 | } |
| 799 | }(ctx.Done(), cn.CloseNotify()) |
| 800 | } |
| 801 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) |
| 802 | rctx, err := runtime.AnnotateContext(ctx, mux, req) |
| 803 | if err != nil { |
| 804 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 805 | return |
| 806 | } |
| 807 | resp, md, err := request_KV_Txn_0(rctx, inboundMarshaler, client, req, pathParams) |
| 808 | ctx = runtime.NewServerMetadataContext(ctx, md) |
| 809 | if err != nil { |
| 810 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 811 | return |
| 812 | } |
| 813 | |
| 814 | forward_KV_Txn_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) |
| 815 | |
| 816 | }) |
| 817 | |
| 818 | mux.Handle("POST", pattern_KV_Compact_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { |
| 819 | ctx, cancel := context.WithCancel(req.Context()) |
| 820 | defer cancel() |
| 821 | if cn, ok := w.(http.CloseNotifier); ok { |
| 822 | go func(done <-chan struct{}, closed <-chan bool) { |
| 823 | select { |
| 824 | case <-done: |
| 825 | case <-closed: |
| 826 | cancel() |
| 827 | } |
| 828 | }(ctx.Done(), cn.CloseNotify()) |
| 829 | } |
| 830 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) |
| 831 | rctx, err := runtime.AnnotateContext(ctx, mux, req) |
| 832 | if err != nil { |
| 833 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 834 | return |
| 835 | } |
| 836 | resp, md, err := request_KV_Compact_0(rctx, inboundMarshaler, client, req, pathParams) |
| 837 | ctx = runtime.NewServerMetadataContext(ctx, md) |
| 838 | if err != nil { |
| 839 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 840 | return |
| 841 | } |
| 842 | |
| 843 | forward_KV_Compact_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) |
| 844 | |
| 845 | }) |
| 846 | |
| 847 | return nil |
| 848 | } |
| 849 | |
| 850 | var ( |
| 851 | pattern_KV_Range_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v3", "kv", "range"}, "")) |
| 852 | |
| 853 | pattern_KV_Put_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v3", "kv", "put"}, "")) |
| 854 | |
| 855 | pattern_KV_DeleteRange_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v3", "kv", "deleterange"}, "")) |
| 856 | |
| 857 | pattern_KV_Txn_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v3", "kv", "txn"}, "")) |
| 858 | |
| 859 | pattern_KV_Compact_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v3", "kv", "compaction"}, "")) |
| 860 | ) |
| 861 | |
| 862 | var ( |
| 863 | forward_KV_Range_0 = runtime.ForwardResponseMessage |
| 864 | |
| 865 | forward_KV_Put_0 = runtime.ForwardResponseMessage |
| 866 | |
| 867 | forward_KV_DeleteRange_0 = runtime.ForwardResponseMessage |
| 868 | |
| 869 | forward_KV_Txn_0 = runtime.ForwardResponseMessage |
| 870 | |
| 871 | forward_KV_Compact_0 = runtime.ForwardResponseMessage |
| 872 | ) |
| 873 | |
| 874 | // RegisterWatchHandlerFromEndpoint is same as RegisterWatchHandler but |
| 875 | // automatically dials to "endpoint" and closes the connection when "ctx" gets done. |
| 876 | func RegisterWatchHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { |
| 877 | conn, err := grpc.Dial(endpoint, opts...) |
| 878 | if err != nil { |
| 879 | return err |
| 880 | } |
| 881 | defer func() { |
| 882 | if err != nil { |
| 883 | if cerr := conn.Close(); cerr != nil { |
| 884 | grpclog.Printf("Failed to close conn to %s: %v", endpoint, cerr) |
| 885 | } |
| 886 | return |
| 887 | } |
| 888 | go func() { |
| 889 | <-ctx.Done() |
| 890 | if cerr := conn.Close(); cerr != nil { |
| 891 | grpclog.Printf("Failed to close conn to %s: %v", endpoint, cerr) |
| 892 | } |
| 893 | }() |
| 894 | }() |
| 895 | |
| 896 | return RegisterWatchHandler(ctx, mux, conn) |
| 897 | } |
| 898 | |
| 899 | // RegisterWatchHandler registers the http handlers for service Watch to "mux". |
| 900 | // The handlers forward requests to the grpc endpoint over "conn". |
| 901 | func RegisterWatchHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { |
| 902 | return RegisterWatchHandlerClient(ctx, mux, etcdserverpb.NewWatchClient(conn)) |
| 903 | } |
| 904 | |
| 905 | // RegisterWatchHandler registers the http handlers for service Watch to "mux". |
| 906 | // The handlers forward requests to the grpc endpoint over the given implementation of "WatchClient". |
| 907 | // Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "WatchClient" |
| 908 | // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in |
| 909 | // "WatchClient" to call the correct interceptors. |
| 910 | func RegisterWatchHandlerClient(ctx context.Context, mux *runtime.ServeMux, client etcdserverpb.WatchClient) error { |
| 911 | |
| 912 | mux.Handle("POST", pattern_Watch_Watch_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { |
| 913 | ctx, cancel := context.WithCancel(req.Context()) |
| 914 | defer cancel() |
| 915 | if cn, ok := w.(http.CloseNotifier); ok { |
| 916 | go func(done <-chan struct{}, closed <-chan bool) { |
| 917 | select { |
| 918 | case <-done: |
| 919 | case <-closed: |
| 920 | cancel() |
| 921 | } |
| 922 | }(ctx.Done(), cn.CloseNotify()) |
| 923 | } |
| 924 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) |
| 925 | rctx, err := runtime.AnnotateContext(ctx, mux, req) |
| 926 | if err != nil { |
| 927 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 928 | return |
| 929 | } |
| 930 | resp, md, err := request_Watch_Watch_0(rctx, inboundMarshaler, client, req, pathParams) |
| 931 | ctx = runtime.NewServerMetadataContext(ctx, md) |
| 932 | if err != nil { |
| 933 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 934 | return |
| 935 | } |
| 936 | |
| 937 | forward_Watch_Watch_0(ctx, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) |
| 938 | |
| 939 | }) |
| 940 | |
| 941 | return nil |
| 942 | } |
| 943 | |
| 944 | var ( |
| 945 | pattern_Watch_Watch_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v3", "watch"}, "")) |
| 946 | ) |
| 947 | |
| 948 | var ( |
| 949 | forward_Watch_Watch_0 = runtime.ForwardResponseStream |
| 950 | ) |
| 951 | |
| 952 | // RegisterLeaseHandlerFromEndpoint is same as RegisterLeaseHandler but |
| 953 | // automatically dials to "endpoint" and closes the connection when "ctx" gets done. |
| 954 | func RegisterLeaseHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { |
| 955 | conn, err := grpc.Dial(endpoint, opts...) |
| 956 | if err != nil { |
| 957 | return err |
| 958 | } |
| 959 | defer func() { |
| 960 | if err != nil { |
| 961 | if cerr := conn.Close(); cerr != nil { |
| 962 | grpclog.Printf("Failed to close conn to %s: %v", endpoint, cerr) |
| 963 | } |
| 964 | return |
| 965 | } |
| 966 | go func() { |
| 967 | <-ctx.Done() |
| 968 | if cerr := conn.Close(); cerr != nil { |
| 969 | grpclog.Printf("Failed to close conn to %s: %v", endpoint, cerr) |
| 970 | } |
| 971 | }() |
| 972 | }() |
| 973 | |
| 974 | return RegisterLeaseHandler(ctx, mux, conn) |
| 975 | } |
| 976 | |
| 977 | // RegisterLeaseHandler registers the http handlers for service Lease to "mux". |
| 978 | // The handlers forward requests to the grpc endpoint over "conn". |
| 979 | func RegisterLeaseHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { |
| 980 | return RegisterLeaseHandlerClient(ctx, mux, etcdserverpb.NewLeaseClient(conn)) |
| 981 | } |
| 982 | |
| 983 | // RegisterLeaseHandler registers the http handlers for service Lease to "mux". |
| 984 | // The handlers forward requests to the grpc endpoint over the given implementation of "LeaseClient". |
| 985 | // Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "LeaseClient" |
| 986 | // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in |
| 987 | // "LeaseClient" to call the correct interceptors. |
| 988 | func RegisterLeaseHandlerClient(ctx context.Context, mux *runtime.ServeMux, client etcdserverpb.LeaseClient) error { |
| 989 | |
| 990 | mux.Handle("POST", pattern_Lease_LeaseGrant_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { |
| 991 | ctx, cancel := context.WithCancel(req.Context()) |
| 992 | defer cancel() |
| 993 | if cn, ok := w.(http.CloseNotifier); ok { |
| 994 | go func(done <-chan struct{}, closed <-chan bool) { |
| 995 | select { |
| 996 | case <-done: |
| 997 | case <-closed: |
| 998 | cancel() |
| 999 | } |
| 1000 | }(ctx.Done(), cn.CloseNotify()) |
| 1001 | } |
| 1002 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) |
| 1003 | rctx, err := runtime.AnnotateContext(ctx, mux, req) |
| 1004 | if err != nil { |
| 1005 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 1006 | return |
| 1007 | } |
| 1008 | resp, md, err := request_Lease_LeaseGrant_0(rctx, inboundMarshaler, client, req, pathParams) |
| 1009 | ctx = runtime.NewServerMetadataContext(ctx, md) |
| 1010 | if err != nil { |
| 1011 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 1012 | return |
| 1013 | } |
| 1014 | |
| 1015 | forward_Lease_LeaseGrant_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) |
| 1016 | |
| 1017 | }) |
| 1018 | |
| 1019 | mux.Handle("POST", pattern_Lease_LeaseRevoke_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { |
| 1020 | ctx, cancel := context.WithCancel(req.Context()) |
| 1021 | defer cancel() |
| 1022 | if cn, ok := w.(http.CloseNotifier); ok { |
| 1023 | go func(done <-chan struct{}, closed <-chan bool) { |
| 1024 | select { |
| 1025 | case <-done: |
| 1026 | case <-closed: |
| 1027 | cancel() |
| 1028 | } |
| 1029 | }(ctx.Done(), cn.CloseNotify()) |
| 1030 | } |
| 1031 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) |
| 1032 | rctx, err := runtime.AnnotateContext(ctx, mux, req) |
| 1033 | if err != nil { |
| 1034 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 1035 | return |
| 1036 | } |
| 1037 | resp, md, err := request_Lease_LeaseRevoke_0(rctx, inboundMarshaler, client, req, pathParams) |
| 1038 | ctx = runtime.NewServerMetadataContext(ctx, md) |
| 1039 | if err != nil { |
| 1040 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 1041 | return |
| 1042 | } |
| 1043 | |
| 1044 | forward_Lease_LeaseRevoke_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) |
| 1045 | |
| 1046 | }) |
| 1047 | |
| 1048 | mux.Handle("POST", pattern_Lease_LeaseRevoke_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { |
| 1049 | ctx, cancel := context.WithCancel(req.Context()) |
| 1050 | defer cancel() |
| 1051 | if cn, ok := w.(http.CloseNotifier); ok { |
| 1052 | go func(done <-chan struct{}, closed <-chan bool) { |
| 1053 | select { |
| 1054 | case <-done: |
| 1055 | case <-closed: |
| 1056 | cancel() |
| 1057 | } |
| 1058 | }(ctx.Done(), cn.CloseNotify()) |
| 1059 | } |
| 1060 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) |
| 1061 | rctx, err := runtime.AnnotateContext(ctx, mux, req) |
| 1062 | if err != nil { |
| 1063 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 1064 | return |
| 1065 | } |
| 1066 | resp, md, err := request_Lease_LeaseRevoke_1(rctx, inboundMarshaler, client, req, pathParams) |
| 1067 | ctx = runtime.NewServerMetadataContext(ctx, md) |
| 1068 | if err != nil { |
| 1069 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 1070 | return |
| 1071 | } |
| 1072 | |
| 1073 | forward_Lease_LeaseRevoke_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) |
| 1074 | |
| 1075 | }) |
| 1076 | |
| 1077 | mux.Handle("POST", pattern_Lease_LeaseKeepAlive_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { |
| 1078 | ctx, cancel := context.WithCancel(req.Context()) |
| 1079 | defer cancel() |
| 1080 | if cn, ok := w.(http.CloseNotifier); ok { |
| 1081 | go func(done <-chan struct{}, closed <-chan bool) { |
| 1082 | select { |
| 1083 | case <-done: |
| 1084 | case <-closed: |
| 1085 | cancel() |
| 1086 | } |
| 1087 | }(ctx.Done(), cn.CloseNotify()) |
| 1088 | } |
| 1089 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) |
| 1090 | rctx, err := runtime.AnnotateContext(ctx, mux, req) |
| 1091 | if err != nil { |
| 1092 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 1093 | return |
| 1094 | } |
| 1095 | resp, md, err := request_Lease_LeaseKeepAlive_0(rctx, inboundMarshaler, client, req, pathParams) |
| 1096 | ctx = runtime.NewServerMetadataContext(ctx, md) |
| 1097 | if err != nil { |
| 1098 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 1099 | return |
| 1100 | } |
| 1101 | |
| 1102 | forward_Lease_LeaseKeepAlive_0(ctx, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) |
| 1103 | |
| 1104 | }) |
| 1105 | |
| 1106 | mux.Handle("POST", pattern_Lease_LeaseTimeToLive_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { |
| 1107 | ctx, cancel := context.WithCancel(req.Context()) |
| 1108 | defer cancel() |
| 1109 | if cn, ok := w.(http.CloseNotifier); ok { |
| 1110 | go func(done <-chan struct{}, closed <-chan bool) { |
| 1111 | select { |
| 1112 | case <-done: |
| 1113 | case <-closed: |
| 1114 | cancel() |
| 1115 | } |
| 1116 | }(ctx.Done(), cn.CloseNotify()) |
| 1117 | } |
| 1118 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) |
| 1119 | rctx, err := runtime.AnnotateContext(ctx, mux, req) |
| 1120 | if err != nil { |
| 1121 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 1122 | return |
| 1123 | } |
| 1124 | resp, md, err := request_Lease_LeaseTimeToLive_0(rctx, inboundMarshaler, client, req, pathParams) |
| 1125 | ctx = runtime.NewServerMetadataContext(ctx, md) |
| 1126 | if err != nil { |
| 1127 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 1128 | return |
| 1129 | } |
| 1130 | |
| 1131 | forward_Lease_LeaseTimeToLive_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) |
| 1132 | |
| 1133 | }) |
| 1134 | |
| 1135 | mux.Handle("POST", pattern_Lease_LeaseTimeToLive_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { |
| 1136 | ctx, cancel := context.WithCancel(req.Context()) |
| 1137 | defer cancel() |
| 1138 | if cn, ok := w.(http.CloseNotifier); ok { |
| 1139 | go func(done <-chan struct{}, closed <-chan bool) { |
| 1140 | select { |
| 1141 | case <-done: |
| 1142 | case <-closed: |
| 1143 | cancel() |
| 1144 | } |
| 1145 | }(ctx.Done(), cn.CloseNotify()) |
| 1146 | } |
| 1147 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) |
| 1148 | rctx, err := runtime.AnnotateContext(ctx, mux, req) |
| 1149 | if err != nil { |
| 1150 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 1151 | return |
| 1152 | } |
| 1153 | resp, md, err := request_Lease_LeaseTimeToLive_1(rctx, inboundMarshaler, client, req, pathParams) |
| 1154 | ctx = runtime.NewServerMetadataContext(ctx, md) |
| 1155 | if err != nil { |
| 1156 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 1157 | return |
| 1158 | } |
| 1159 | |
| 1160 | forward_Lease_LeaseTimeToLive_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) |
| 1161 | |
| 1162 | }) |
| 1163 | |
| 1164 | mux.Handle("POST", pattern_Lease_LeaseLeases_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { |
| 1165 | ctx, cancel := context.WithCancel(req.Context()) |
| 1166 | defer cancel() |
| 1167 | if cn, ok := w.(http.CloseNotifier); ok { |
| 1168 | go func(done <-chan struct{}, closed <-chan bool) { |
| 1169 | select { |
| 1170 | case <-done: |
| 1171 | case <-closed: |
| 1172 | cancel() |
| 1173 | } |
| 1174 | }(ctx.Done(), cn.CloseNotify()) |
| 1175 | } |
| 1176 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) |
| 1177 | rctx, err := runtime.AnnotateContext(ctx, mux, req) |
| 1178 | if err != nil { |
| 1179 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 1180 | return |
| 1181 | } |
| 1182 | resp, md, err := request_Lease_LeaseLeases_0(rctx, inboundMarshaler, client, req, pathParams) |
| 1183 | ctx = runtime.NewServerMetadataContext(ctx, md) |
| 1184 | if err != nil { |
| 1185 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 1186 | return |
| 1187 | } |
| 1188 | |
| 1189 | forward_Lease_LeaseLeases_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) |
| 1190 | |
| 1191 | }) |
| 1192 | |
| 1193 | mux.Handle("POST", pattern_Lease_LeaseLeases_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { |
| 1194 | ctx, cancel := context.WithCancel(req.Context()) |
| 1195 | defer cancel() |
| 1196 | if cn, ok := w.(http.CloseNotifier); ok { |
| 1197 | go func(done <-chan struct{}, closed <-chan bool) { |
| 1198 | select { |
| 1199 | case <-done: |
| 1200 | case <-closed: |
| 1201 | cancel() |
| 1202 | } |
| 1203 | }(ctx.Done(), cn.CloseNotify()) |
| 1204 | } |
| 1205 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) |
| 1206 | rctx, err := runtime.AnnotateContext(ctx, mux, req) |
| 1207 | if err != nil { |
| 1208 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 1209 | return |
| 1210 | } |
| 1211 | resp, md, err := request_Lease_LeaseLeases_1(rctx, inboundMarshaler, client, req, pathParams) |
| 1212 | ctx = runtime.NewServerMetadataContext(ctx, md) |
| 1213 | if err != nil { |
| 1214 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 1215 | return |
| 1216 | } |
| 1217 | |
| 1218 | forward_Lease_LeaseLeases_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) |
| 1219 | |
| 1220 | }) |
| 1221 | |
| 1222 | return nil |
| 1223 | } |
| 1224 | |
| 1225 | var ( |
| 1226 | pattern_Lease_LeaseGrant_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v3", "lease", "grant"}, "")) |
| 1227 | |
| 1228 | pattern_Lease_LeaseRevoke_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v3", "lease", "revoke"}, "")) |
| 1229 | |
| 1230 | pattern_Lease_LeaseRevoke_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v3", "kv", "lease", "revoke"}, "")) |
| 1231 | |
| 1232 | pattern_Lease_LeaseKeepAlive_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v3", "lease", "keepalive"}, "")) |
| 1233 | |
| 1234 | pattern_Lease_LeaseTimeToLive_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v3", "lease", "timetolive"}, "")) |
| 1235 | |
| 1236 | pattern_Lease_LeaseTimeToLive_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v3", "kv", "lease", "timetolive"}, "")) |
| 1237 | |
| 1238 | pattern_Lease_LeaseLeases_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v3", "lease", "leases"}, "")) |
| 1239 | |
| 1240 | pattern_Lease_LeaseLeases_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v3", "kv", "lease", "leases"}, "")) |
| 1241 | ) |
| 1242 | |
| 1243 | var ( |
| 1244 | forward_Lease_LeaseGrant_0 = runtime.ForwardResponseMessage |
| 1245 | |
| 1246 | forward_Lease_LeaseRevoke_0 = runtime.ForwardResponseMessage |
| 1247 | |
| 1248 | forward_Lease_LeaseRevoke_1 = runtime.ForwardResponseMessage |
| 1249 | |
| 1250 | forward_Lease_LeaseKeepAlive_0 = runtime.ForwardResponseStream |
| 1251 | |
| 1252 | forward_Lease_LeaseTimeToLive_0 = runtime.ForwardResponseMessage |
| 1253 | |
| 1254 | forward_Lease_LeaseTimeToLive_1 = runtime.ForwardResponseMessage |
| 1255 | |
| 1256 | forward_Lease_LeaseLeases_0 = runtime.ForwardResponseMessage |
| 1257 | |
| 1258 | forward_Lease_LeaseLeases_1 = runtime.ForwardResponseMessage |
| 1259 | ) |
| 1260 | |
| 1261 | // RegisterClusterHandlerFromEndpoint is same as RegisterClusterHandler but |
| 1262 | // automatically dials to "endpoint" and closes the connection when "ctx" gets done. |
| 1263 | func RegisterClusterHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { |
| 1264 | conn, err := grpc.Dial(endpoint, opts...) |
| 1265 | if err != nil { |
| 1266 | return err |
| 1267 | } |
| 1268 | defer func() { |
| 1269 | if err != nil { |
| 1270 | if cerr := conn.Close(); cerr != nil { |
| 1271 | grpclog.Printf("Failed to close conn to %s: %v", endpoint, cerr) |
| 1272 | } |
| 1273 | return |
| 1274 | } |
| 1275 | go func() { |
| 1276 | <-ctx.Done() |
| 1277 | if cerr := conn.Close(); cerr != nil { |
| 1278 | grpclog.Printf("Failed to close conn to %s: %v", endpoint, cerr) |
| 1279 | } |
| 1280 | }() |
| 1281 | }() |
| 1282 | |
| 1283 | return RegisterClusterHandler(ctx, mux, conn) |
| 1284 | } |
| 1285 | |
| 1286 | // RegisterClusterHandler registers the http handlers for service Cluster to "mux". |
| 1287 | // The handlers forward requests to the grpc endpoint over "conn". |
| 1288 | func RegisterClusterHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { |
| 1289 | return RegisterClusterHandlerClient(ctx, mux, etcdserverpb.NewClusterClient(conn)) |
| 1290 | } |
| 1291 | |
| 1292 | // RegisterClusterHandler registers the http handlers for service Cluster to "mux". |
| 1293 | // The handlers forward requests to the grpc endpoint over the given implementation of "ClusterClient". |
| 1294 | // Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ClusterClient" |
| 1295 | // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in |
| 1296 | // "ClusterClient" to call the correct interceptors. |
| 1297 | func RegisterClusterHandlerClient(ctx context.Context, mux *runtime.ServeMux, client etcdserverpb.ClusterClient) error { |
| 1298 | |
| 1299 | mux.Handle("POST", pattern_Cluster_MemberAdd_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { |
| 1300 | ctx, cancel := context.WithCancel(req.Context()) |
| 1301 | defer cancel() |
| 1302 | if cn, ok := w.(http.CloseNotifier); ok { |
| 1303 | go func(done <-chan struct{}, closed <-chan bool) { |
| 1304 | select { |
| 1305 | case <-done: |
| 1306 | case <-closed: |
| 1307 | cancel() |
| 1308 | } |
| 1309 | }(ctx.Done(), cn.CloseNotify()) |
| 1310 | } |
| 1311 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) |
| 1312 | rctx, err := runtime.AnnotateContext(ctx, mux, req) |
| 1313 | if err != nil { |
| 1314 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 1315 | return |
| 1316 | } |
| 1317 | resp, md, err := request_Cluster_MemberAdd_0(rctx, inboundMarshaler, client, req, pathParams) |
| 1318 | ctx = runtime.NewServerMetadataContext(ctx, md) |
| 1319 | if err != nil { |
| 1320 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 1321 | return |
| 1322 | } |
| 1323 | |
| 1324 | forward_Cluster_MemberAdd_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) |
| 1325 | |
| 1326 | }) |
| 1327 | |
| 1328 | mux.Handle("POST", pattern_Cluster_MemberRemove_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { |
| 1329 | ctx, cancel := context.WithCancel(req.Context()) |
| 1330 | defer cancel() |
| 1331 | if cn, ok := w.(http.CloseNotifier); ok { |
| 1332 | go func(done <-chan struct{}, closed <-chan bool) { |
| 1333 | select { |
| 1334 | case <-done: |
| 1335 | case <-closed: |
| 1336 | cancel() |
| 1337 | } |
| 1338 | }(ctx.Done(), cn.CloseNotify()) |
| 1339 | } |
| 1340 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) |
| 1341 | rctx, err := runtime.AnnotateContext(ctx, mux, req) |
| 1342 | if err != nil { |
| 1343 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 1344 | return |
| 1345 | } |
| 1346 | resp, md, err := request_Cluster_MemberRemove_0(rctx, inboundMarshaler, client, req, pathParams) |
| 1347 | ctx = runtime.NewServerMetadataContext(ctx, md) |
| 1348 | if err != nil { |
| 1349 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 1350 | return |
| 1351 | } |
| 1352 | |
| 1353 | forward_Cluster_MemberRemove_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) |
| 1354 | |
| 1355 | }) |
| 1356 | |
| 1357 | mux.Handle("POST", pattern_Cluster_MemberUpdate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { |
| 1358 | ctx, cancel := context.WithCancel(req.Context()) |
| 1359 | defer cancel() |
| 1360 | if cn, ok := w.(http.CloseNotifier); ok { |
| 1361 | go func(done <-chan struct{}, closed <-chan bool) { |
| 1362 | select { |
| 1363 | case <-done: |
| 1364 | case <-closed: |
| 1365 | cancel() |
| 1366 | } |
| 1367 | }(ctx.Done(), cn.CloseNotify()) |
| 1368 | } |
| 1369 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) |
| 1370 | rctx, err := runtime.AnnotateContext(ctx, mux, req) |
| 1371 | if err != nil { |
| 1372 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 1373 | return |
| 1374 | } |
| 1375 | resp, md, err := request_Cluster_MemberUpdate_0(rctx, inboundMarshaler, client, req, pathParams) |
| 1376 | ctx = runtime.NewServerMetadataContext(ctx, md) |
| 1377 | if err != nil { |
| 1378 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 1379 | return |
| 1380 | } |
| 1381 | |
| 1382 | forward_Cluster_MemberUpdate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) |
| 1383 | |
| 1384 | }) |
| 1385 | |
| 1386 | mux.Handle("POST", pattern_Cluster_MemberList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { |
| 1387 | ctx, cancel := context.WithCancel(req.Context()) |
| 1388 | defer cancel() |
| 1389 | if cn, ok := w.(http.CloseNotifier); ok { |
| 1390 | go func(done <-chan struct{}, closed <-chan bool) { |
| 1391 | select { |
| 1392 | case <-done: |
| 1393 | case <-closed: |
| 1394 | cancel() |
| 1395 | } |
| 1396 | }(ctx.Done(), cn.CloseNotify()) |
| 1397 | } |
| 1398 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) |
| 1399 | rctx, err := runtime.AnnotateContext(ctx, mux, req) |
| 1400 | if err != nil { |
| 1401 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 1402 | return |
| 1403 | } |
| 1404 | resp, md, err := request_Cluster_MemberList_0(rctx, inboundMarshaler, client, req, pathParams) |
| 1405 | ctx = runtime.NewServerMetadataContext(ctx, md) |
| 1406 | if err != nil { |
| 1407 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 1408 | return |
| 1409 | } |
| 1410 | |
| 1411 | forward_Cluster_MemberList_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) |
| 1412 | |
| 1413 | }) |
| 1414 | |
| 1415 | mux.Handle("POST", pattern_Cluster_MemberPromote_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { |
| 1416 | ctx, cancel := context.WithCancel(req.Context()) |
| 1417 | defer cancel() |
| 1418 | if cn, ok := w.(http.CloseNotifier); ok { |
| 1419 | go func(done <-chan struct{}, closed <-chan bool) { |
| 1420 | select { |
| 1421 | case <-done: |
| 1422 | case <-closed: |
| 1423 | cancel() |
| 1424 | } |
| 1425 | }(ctx.Done(), cn.CloseNotify()) |
| 1426 | } |
| 1427 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) |
| 1428 | rctx, err := runtime.AnnotateContext(ctx, mux, req) |
| 1429 | if err != nil { |
| 1430 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 1431 | return |
| 1432 | } |
| 1433 | resp, md, err := request_Cluster_MemberPromote_0(rctx, inboundMarshaler, client, req, pathParams) |
| 1434 | ctx = runtime.NewServerMetadataContext(ctx, md) |
| 1435 | if err != nil { |
| 1436 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 1437 | return |
| 1438 | } |
| 1439 | |
| 1440 | forward_Cluster_MemberPromote_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) |
| 1441 | |
| 1442 | }) |
| 1443 | |
| 1444 | return nil |
| 1445 | } |
| 1446 | |
| 1447 | var ( |
| 1448 | pattern_Cluster_MemberAdd_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v3", "cluster", "member", "add"}, "")) |
| 1449 | |
| 1450 | pattern_Cluster_MemberRemove_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v3", "cluster", "member", "remove"}, "")) |
| 1451 | |
| 1452 | pattern_Cluster_MemberUpdate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v3", "cluster", "member", "update"}, "")) |
| 1453 | |
| 1454 | pattern_Cluster_MemberList_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v3", "cluster", "member", "list"}, "")) |
| 1455 | |
| 1456 | pattern_Cluster_MemberPromote_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v3", "cluster", "member", "promote"}, "")) |
| 1457 | ) |
| 1458 | |
| 1459 | var ( |
| 1460 | forward_Cluster_MemberAdd_0 = runtime.ForwardResponseMessage |
| 1461 | |
| 1462 | forward_Cluster_MemberRemove_0 = runtime.ForwardResponseMessage |
| 1463 | |
| 1464 | forward_Cluster_MemberUpdate_0 = runtime.ForwardResponseMessage |
| 1465 | |
| 1466 | forward_Cluster_MemberList_0 = runtime.ForwardResponseMessage |
| 1467 | |
| 1468 | forward_Cluster_MemberPromote_0 = runtime.ForwardResponseMessage |
| 1469 | ) |
| 1470 | |
| 1471 | // RegisterMaintenanceHandlerFromEndpoint is same as RegisterMaintenanceHandler but |
| 1472 | // automatically dials to "endpoint" and closes the connection when "ctx" gets done. |
| 1473 | func RegisterMaintenanceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { |
| 1474 | conn, err := grpc.Dial(endpoint, opts...) |
| 1475 | if err != nil { |
| 1476 | return err |
| 1477 | } |
| 1478 | defer func() { |
| 1479 | if err != nil { |
| 1480 | if cerr := conn.Close(); cerr != nil { |
| 1481 | grpclog.Printf("Failed to close conn to %s: %v", endpoint, cerr) |
| 1482 | } |
| 1483 | return |
| 1484 | } |
| 1485 | go func() { |
| 1486 | <-ctx.Done() |
| 1487 | if cerr := conn.Close(); cerr != nil { |
| 1488 | grpclog.Printf("Failed to close conn to %s: %v", endpoint, cerr) |
| 1489 | } |
| 1490 | }() |
| 1491 | }() |
| 1492 | |
| 1493 | return RegisterMaintenanceHandler(ctx, mux, conn) |
| 1494 | } |
| 1495 | |
| 1496 | // RegisterMaintenanceHandler registers the http handlers for service Maintenance to "mux". |
| 1497 | // The handlers forward requests to the grpc endpoint over "conn". |
| 1498 | func RegisterMaintenanceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { |
| 1499 | return RegisterMaintenanceHandlerClient(ctx, mux, etcdserverpb.NewMaintenanceClient(conn)) |
| 1500 | } |
| 1501 | |
| 1502 | // RegisterMaintenanceHandler registers the http handlers for service Maintenance to "mux". |
| 1503 | // The handlers forward requests to the grpc endpoint over the given implementation of "MaintenanceClient". |
| 1504 | // Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MaintenanceClient" |
| 1505 | // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in |
| 1506 | // "MaintenanceClient" to call the correct interceptors. |
| 1507 | func RegisterMaintenanceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client etcdserverpb.MaintenanceClient) error { |
| 1508 | |
| 1509 | mux.Handle("POST", pattern_Maintenance_Alarm_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { |
| 1510 | ctx, cancel := context.WithCancel(req.Context()) |
| 1511 | defer cancel() |
| 1512 | if cn, ok := w.(http.CloseNotifier); ok { |
| 1513 | go func(done <-chan struct{}, closed <-chan bool) { |
| 1514 | select { |
| 1515 | case <-done: |
| 1516 | case <-closed: |
| 1517 | cancel() |
| 1518 | } |
| 1519 | }(ctx.Done(), cn.CloseNotify()) |
| 1520 | } |
| 1521 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) |
| 1522 | rctx, err := runtime.AnnotateContext(ctx, mux, req) |
| 1523 | if err != nil { |
| 1524 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 1525 | return |
| 1526 | } |
| 1527 | resp, md, err := request_Maintenance_Alarm_0(rctx, inboundMarshaler, client, req, pathParams) |
| 1528 | ctx = runtime.NewServerMetadataContext(ctx, md) |
| 1529 | if err != nil { |
| 1530 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 1531 | return |
| 1532 | } |
| 1533 | |
| 1534 | forward_Maintenance_Alarm_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) |
| 1535 | |
| 1536 | }) |
| 1537 | |
| 1538 | mux.Handle("POST", pattern_Maintenance_Status_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { |
| 1539 | ctx, cancel := context.WithCancel(req.Context()) |
| 1540 | defer cancel() |
| 1541 | if cn, ok := w.(http.CloseNotifier); ok { |
| 1542 | go func(done <-chan struct{}, closed <-chan bool) { |
| 1543 | select { |
| 1544 | case <-done: |
| 1545 | case <-closed: |
| 1546 | cancel() |
| 1547 | } |
| 1548 | }(ctx.Done(), cn.CloseNotify()) |
| 1549 | } |
| 1550 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) |
| 1551 | rctx, err := runtime.AnnotateContext(ctx, mux, req) |
| 1552 | if err != nil { |
| 1553 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 1554 | return |
| 1555 | } |
| 1556 | resp, md, err := request_Maintenance_Status_0(rctx, inboundMarshaler, client, req, pathParams) |
| 1557 | ctx = runtime.NewServerMetadataContext(ctx, md) |
| 1558 | if err != nil { |
| 1559 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 1560 | return |
| 1561 | } |
| 1562 | |
| 1563 | forward_Maintenance_Status_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) |
| 1564 | |
| 1565 | }) |
| 1566 | |
| 1567 | mux.Handle("POST", pattern_Maintenance_Defragment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { |
| 1568 | ctx, cancel := context.WithCancel(req.Context()) |
| 1569 | defer cancel() |
| 1570 | if cn, ok := w.(http.CloseNotifier); ok { |
| 1571 | go func(done <-chan struct{}, closed <-chan bool) { |
| 1572 | select { |
| 1573 | case <-done: |
| 1574 | case <-closed: |
| 1575 | cancel() |
| 1576 | } |
| 1577 | }(ctx.Done(), cn.CloseNotify()) |
| 1578 | } |
| 1579 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) |
| 1580 | rctx, err := runtime.AnnotateContext(ctx, mux, req) |
| 1581 | if err != nil { |
| 1582 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 1583 | return |
| 1584 | } |
| 1585 | resp, md, err := request_Maintenance_Defragment_0(rctx, inboundMarshaler, client, req, pathParams) |
| 1586 | ctx = runtime.NewServerMetadataContext(ctx, md) |
| 1587 | if err != nil { |
| 1588 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 1589 | return |
| 1590 | } |
| 1591 | |
| 1592 | forward_Maintenance_Defragment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) |
| 1593 | |
| 1594 | }) |
| 1595 | |
| 1596 | mux.Handle("POST", pattern_Maintenance_Hash_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { |
| 1597 | ctx, cancel := context.WithCancel(req.Context()) |
| 1598 | defer cancel() |
| 1599 | if cn, ok := w.(http.CloseNotifier); ok { |
| 1600 | go func(done <-chan struct{}, closed <-chan bool) { |
| 1601 | select { |
| 1602 | case <-done: |
| 1603 | case <-closed: |
| 1604 | cancel() |
| 1605 | } |
| 1606 | }(ctx.Done(), cn.CloseNotify()) |
| 1607 | } |
| 1608 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) |
| 1609 | rctx, err := runtime.AnnotateContext(ctx, mux, req) |
| 1610 | if err != nil { |
| 1611 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 1612 | return |
| 1613 | } |
| 1614 | resp, md, err := request_Maintenance_Hash_0(rctx, inboundMarshaler, client, req, pathParams) |
| 1615 | ctx = runtime.NewServerMetadataContext(ctx, md) |
| 1616 | if err != nil { |
| 1617 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 1618 | return |
| 1619 | } |
| 1620 | |
| 1621 | forward_Maintenance_Hash_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) |
| 1622 | |
| 1623 | }) |
| 1624 | |
| 1625 | mux.Handle("POST", pattern_Maintenance_HashKV_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { |
| 1626 | ctx, cancel := context.WithCancel(req.Context()) |
| 1627 | defer cancel() |
| 1628 | if cn, ok := w.(http.CloseNotifier); ok { |
| 1629 | go func(done <-chan struct{}, closed <-chan bool) { |
| 1630 | select { |
| 1631 | case <-done: |
| 1632 | case <-closed: |
| 1633 | cancel() |
| 1634 | } |
| 1635 | }(ctx.Done(), cn.CloseNotify()) |
| 1636 | } |
| 1637 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) |
| 1638 | rctx, err := runtime.AnnotateContext(ctx, mux, req) |
| 1639 | if err != nil { |
| 1640 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 1641 | return |
| 1642 | } |
| 1643 | resp, md, err := request_Maintenance_HashKV_0(rctx, inboundMarshaler, client, req, pathParams) |
| 1644 | ctx = runtime.NewServerMetadataContext(ctx, md) |
| 1645 | if err != nil { |
| 1646 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 1647 | return |
| 1648 | } |
| 1649 | |
| 1650 | forward_Maintenance_HashKV_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) |
| 1651 | |
| 1652 | }) |
| 1653 | |
| 1654 | mux.Handle("POST", pattern_Maintenance_Snapshot_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { |
| 1655 | ctx, cancel := context.WithCancel(req.Context()) |
| 1656 | defer cancel() |
| 1657 | if cn, ok := w.(http.CloseNotifier); ok { |
| 1658 | go func(done <-chan struct{}, closed <-chan bool) { |
| 1659 | select { |
| 1660 | case <-done: |
| 1661 | case <-closed: |
| 1662 | cancel() |
| 1663 | } |
| 1664 | }(ctx.Done(), cn.CloseNotify()) |
| 1665 | } |
| 1666 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) |
| 1667 | rctx, err := runtime.AnnotateContext(ctx, mux, req) |
| 1668 | if err != nil { |
| 1669 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 1670 | return |
| 1671 | } |
| 1672 | resp, md, err := request_Maintenance_Snapshot_0(rctx, inboundMarshaler, client, req, pathParams) |
| 1673 | ctx = runtime.NewServerMetadataContext(ctx, md) |
| 1674 | if err != nil { |
| 1675 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 1676 | return |
| 1677 | } |
| 1678 | |
| 1679 | forward_Maintenance_Snapshot_0(ctx, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) |
| 1680 | |
| 1681 | }) |
| 1682 | |
| 1683 | mux.Handle("POST", pattern_Maintenance_MoveLeader_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { |
| 1684 | ctx, cancel := context.WithCancel(req.Context()) |
| 1685 | defer cancel() |
| 1686 | if cn, ok := w.(http.CloseNotifier); ok { |
| 1687 | go func(done <-chan struct{}, closed <-chan bool) { |
| 1688 | select { |
| 1689 | case <-done: |
| 1690 | case <-closed: |
| 1691 | cancel() |
| 1692 | } |
| 1693 | }(ctx.Done(), cn.CloseNotify()) |
| 1694 | } |
| 1695 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) |
| 1696 | rctx, err := runtime.AnnotateContext(ctx, mux, req) |
| 1697 | if err != nil { |
| 1698 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 1699 | return |
| 1700 | } |
| 1701 | resp, md, err := request_Maintenance_MoveLeader_0(rctx, inboundMarshaler, client, req, pathParams) |
| 1702 | ctx = runtime.NewServerMetadataContext(ctx, md) |
| 1703 | if err != nil { |
| 1704 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 1705 | return |
| 1706 | } |
| 1707 | |
| 1708 | forward_Maintenance_MoveLeader_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) |
| 1709 | |
| 1710 | }) |
| 1711 | |
| 1712 | return nil |
| 1713 | } |
| 1714 | |
| 1715 | var ( |
| 1716 | pattern_Maintenance_Alarm_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v3", "maintenance", "alarm"}, "")) |
| 1717 | |
| 1718 | pattern_Maintenance_Status_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v3", "maintenance", "status"}, "")) |
| 1719 | |
| 1720 | pattern_Maintenance_Defragment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v3", "maintenance", "defragment"}, "")) |
| 1721 | |
| 1722 | pattern_Maintenance_Hash_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v3", "maintenance", "hash"}, "")) |
| 1723 | |
| 1724 | pattern_Maintenance_HashKV_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v3", "maintenance", "hash"}, "")) |
| 1725 | |
| 1726 | pattern_Maintenance_Snapshot_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v3", "maintenance", "snapshot"}, "")) |
| 1727 | |
| 1728 | pattern_Maintenance_MoveLeader_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v3", "maintenance", "transfer-leadership"}, "")) |
| 1729 | ) |
| 1730 | |
| 1731 | var ( |
| 1732 | forward_Maintenance_Alarm_0 = runtime.ForwardResponseMessage |
| 1733 | |
| 1734 | forward_Maintenance_Status_0 = runtime.ForwardResponseMessage |
| 1735 | |
| 1736 | forward_Maintenance_Defragment_0 = runtime.ForwardResponseMessage |
| 1737 | |
| 1738 | forward_Maintenance_Hash_0 = runtime.ForwardResponseMessage |
| 1739 | |
| 1740 | forward_Maintenance_HashKV_0 = runtime.ForwardResponseMessage |
| 1741 | |
| 1742 | forward_Maintenance_Snapshot_0 = runtime.ForwardResponseStream |
| 1743 | |
| 1744 | forward_Maintenance_MoveLeader_0 = runtime.ForwardResponseMessage |
| 1745 | ) |
| 1746 | |
| 1747 | // RegisterAuthHandlerFromEndpoint is same as RegisterAuthHandler but |
| 1748 | // automatically dials to "endpoint" and closes the connection when "ctx" gets done. |
| 1749 | func RegisterAuthHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { |
| 1750 | conn, err := grpc.Dial(endpoint, opts...) |
| 1751 | if err != nil { |
| 1752 | return err |
| 1753 | } |
| 1754 | defer func() { |
| 1755 | if err != nil { |
| 1756 | if cerr := conn.Close(); cerr != nil { |
| 1757 | grpclog.Printf("Failed to close conn to %s: %v", endpoint, cerr) |
| 1758 | } |
| 1759 | return |
| 1760 | } |
| 1761 | go func() { |
| 1762 | <-ctx.Done() |
| 1763 | if cerr := conn.Close(); cerr != nil { |
| 1764 | grpclog.Printf("Failed to close conn to %s: %v", endpoint, cerr) |
| 1765 | } |
| 1766 | }() |
| 1767 | }() |
| 1768 | |
| 1769 | return RegisterAuthHandler(ctx, mux, conn) |
| 1770 | } |
| 1771 | |
| 1772 | // RegisterAuthHandler registers the http handlers for service Auth to "mux". |
| 1773 | // The handlers forward requests to the grpc endpoint over "conn". |
| 1774 | func RegisterAuthHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { |
| 1775 | return RegisterAuthHandlerClient(ctx, mux, etcdserverpb.NewAuthClient(conn)) |
| 1776 | } |
| 1777 | |
| 1778 | // RegisterAuthHandler registers the http handlers for service Auth to "mux". |
| 1779 | // The handlers forward requests to the grpc endpoint over the given implementation of "AuthClient". |
| 1780 | // Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AuthClient" |
| 1781 | // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in |
| 1782 | // "AuthClient" to call the correct interceptors. |
| 1783 | func RegisterAuthHandlerClient(ctx context.Context, mux *runtime.ServeMux, client etcdserverpb.AuthClient) error { |
| 1784 | |
| 1785 | mux.Handle("POST", pattern_Auth_AuthEnable_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { |
| 1786 | ctx, cancel := context.WithCancel(req.Context()) |
| 1787 | defer cancel() |
| 1788 | if cn, ok := w.(http.CloseNotifier); ok { |
| 1789 | go func(done <-chan struct{}, closed <-chan bool) { |
| 1790 | select { |
| 1791 | case <-done: |
| 1792 | case <-closed: |
| 1793 | cancel() |
| 1794 | } |
| 1795 | }(ctx.Done(), cn.CloseNotify()) |
| 1796 | } |
| 1797 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) |
| 1798 | rctx, err := runtime.AnnotateContext(ctx, mux, req) |
| 1799 | if err != nil { |
| 1800 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 1801 | return |
| 1802 | } |
| 1803 | resp, md, err := request_Auth_AuthEnable_0(rctx, inboundMarshaler, client, req, pathParams) |
| 1804 | ctx = runtime.NewServerMetadataContext(ctx, md) |
| 1805 | if err != nil { |
| 1806 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 1807 | return |
| 1808 | } |
| 1809 | |
| 1810 | forward_Auth_AuthEnable_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) |
| 1811 | |
| 1812 | }) |
| 1813 | |
| 1814 | mux.Handle("POST", pattern_Auth_AuthDisable_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { |
| 1815 | ctx, cancel := context.WithCancel(req.Context()) |
| 1816 | defer cancel() |
| 1817 | if cn, ok := w.(http.CloseNotifier); ok { |
| 1818 | go func(done <-chan struct{}, closed <-chan bool) { |
| 1819 | select { |
| 1820 | case <-done: |
| 1821 | case <-closed: |
| 1822 | cancel() |
| 1823 | } |
| 1824 | }(ctx.Done(), cn.CloseNotify()) |
| 1825 | } |
| 1826 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) |
| 1827 | rctx, err := runtime.AnnotateContext(ctx, mux, req) |
| 1828 | if err != nil { |
| 1829 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 1830 | return |
| 1831 | } |
| 1832 | resp, md, err := request_Auth_AuthDisable_0(rctx, inboundMarshaler, client, req, pathParams) |
| 1833 | ctx = runtime.NewServerMetadataContext(ctx, md) |
| 1834 | if err != nil { |
| 1835 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 1836 | return |
| 1837 | } |
| 1838 | |
| 1839 | forward_Auth_AuthDisable_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) |
| 1840 | |
| 1841 | }) |
| 1842 | |
| 1843 | mux.Handle("POST", pattern_Auth_Authenticate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { |
| 1844 | ctx, cancel := context.WithCancel(req.Context()) |
| 1845 | defer cancel() |
| 1846 | if cn, ok := w.(http.CloseNotifier); ok { |
| 1847 | go func(done <-chan struct{}, closed <-chan bool) { |
| 1848 | select { |
| 1849 | case <-done: |
| 1850 | case <-closed: |
| 1851 | cancel() |
| 1852 | } |
| 1853 | }(ctx.Done(), cn.CloseNotify()) |
| 1854 | } |
| 1855 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) |
| 1856 | rctx, err := runtime.AnnotateContext(ctx, mux, req) |
| 1857 | if err != nil { |
| 1858 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 1859 | return |
| 1860 | } |
| 1861 | resp, md, err := request_Auth_Authenticate_0(rctx, inboundMarshaler, client, req, pathParams) |
| 1862 | ctx = runtime.NewServerMetadataContext(ctx, md) |
| 1863 | if err != nil { |
| 1864 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 1865 | return |
| 1866 | } |
| 1867 | |
| 1868 | forward_Auth_Authenticate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) |
| 1869 | |
| 1870 | }) |
| 1871 | |
| 1872 | mux.Handle("POST", pattern_Auth_UserAdd_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { |
| 1873 | ctx, cancel := context.WithCancel(req.Context()) |
| 1874 | defer cancel() |
| 1875 | if cn, ok := w.(http.CloseNotifier); ok { |
| 1876 | go func(done <-chan struct{}, closed <-chan bool) { |
| 1877 | select { |
| 1878 | case <-done: |
| 1879 | case <-closed: |
| 1880 | cancel() |
| 1881 | } |
| 1882 | }(ctx.Done(), cn.CloseNotify()) |
| 1883 | } |
| 1884 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) |
| 1885 | rctx, err := runtime.AnnotateContext(ctx, mux, req) |
| 1886 | if err != nil { |
| 1887 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 1888 | return |
| 1889 | } |
| 1890 | resp, md, err := request_Auth_UserAdd_0(rctx, inboundMarshaler, client, req, pathParams) |
| 1891 | ctx = runtime.NewServerMetadataContext(ctx, md) |
| 1892 | if err != nil { |
| 1893 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 1894 | return |
| 1895 | } |
| 1896 | |
| 1897 | forward_Auth_UserAdd_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) |
| 1898 | |
| 1899 | }) |
| 1900 | |
| 1901 | mux.Handle("POST", pattern_Auth_UserGet_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { |
| 1902 | ctx, cancel := context.WithCancel(req.Context()) |
| 1903 | defer cancel() |
| 1904 | if cn, ok := w.(http.CloseNotifier); ok { |
| 1905 | go func(done <-chan struct{}, closed <-chan bool) { |
| 1906 | select { |
| 1907 | case <-done: |
| 1908 | case <-closed: |
| 1909 | cancel() |
| 1910 | } |
| 1911 | }(ctx.Done(), cn.CloseNotify()) |
| 1912 | } |
| 1913 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) |
| 1914 | rctx, err := runtime.AnnotateContext(ctx, mux, req) |
| 1915 | if err != nil { |
| 1916 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 1917 | return |
| 1918 | } |
| 1919 | resp, md, err := request_Auth_UserGet_0(rctx, inboundMarshaler, client, req, pathParams) |
| 1920 | ctx = runtime.NewServerMetadataContext(ctx, md) |
| 1921 | if err != nil { |
| 1922 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 1923 | return |
| 1924 | } |
| 1925 | |
| 1926 | forward_Auth_UserGet_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) |
| 1927 | |
| 1928 | }) |
| 1929 | |
| 1930 | mux.Handle("POST", pattern_Auth_UserList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { |
| 1931 | ctx, cancel := context.WithCancel(req.Context()) |
| 1932 | defer cancel() |
| 1933 | if cn, ok := w.(http.CloseNotifier); ok { |
| 1934 | go func(done <-chan struct{}, closed <-chan bool) { |
| 1935 | select { |
| 1936 | case <-done: |
| 1937 | case <-closed: |
| 1938 | cancel() |
| 1939 | } |
| 1940 | }(ctx.Done(), cn.CloseNotify()) |
| 1941 | } |
| 1942 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) |
| 1943 | rctx, err := runtime.AnnotateContext(ctx, mux, req) |
| 1944 | if err != nil { |
| 1945 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 1946 | return |
| 1947 | } |
| 1948 | resp, md, err := request_Auth_UserList_0(rctx, inboundMarshaler, client, req, pathParams) |
| 1949 | ctx = runtime.NewServerMetadataContext(ctx, md) |
| 1950 | if err != nil { |
| 1951 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 1952 | return |
| 1953 | } |
| 1954 | |
| 1955 | forward_Auth_UserList_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) |
| 1956 | |
| 1957 | }) |
| 1958 | |
| 1959 | mux.Handle("POST", pattern_Auth_UserDelete_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { |
| 1960 | ctx, cancel := context.WithCancel(req.Context()) |
| 1961 | defer cancel() |
| 1962 | if cn, ok := w.(http.CloseNotifier); ok { |
| 1963 | go func(done <-chan struct{}, closed <-chan bool) { |
| 1964 | select { |
| 1965 | case <-done: |
| 1966 | case <-closed: |
| 1967 | cancel() |
| 1968 | } |
| 1969 | }(ctx.Done(), cn.CloseNotify()) |
| 1970 | } |
| 1971 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) |
| 1972 | rctx, err := runtime.AnnotateContext(ctx, mux, req) |
| 1973 | if err != nil { |
| 1974 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 1975 | return |
| 1976 | } |
| 1977 | resp, md, err := request_Auth_UserDelete_0(rctx, inboundMarshaler, client, req, pathParams) |
| 1978 | ctx = runtime.NewServerMetadataContext(ctx, md) |
| 1979 | if err != nil { |
| 1980 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 1981 | return |
| 1982 | } |
| 1983 | |
| 1984 | forward_Auth_UserDelete_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) |
| 1985 | |
| 1986 | }) |
| 1987 | |
| 1988 | mux.Handle("POST", pattern_Auth_UserChangePassword_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { |
| 1989 | ctx, cancel := context.WithCancel(req.Context()) |
| 1990 | defer cancel() |
| 1991 | if cn, ok := w.(http.CloseNotifier); ok { |
| 1992 | go func(done <-chan struct{}, closed <-chan bool) { |
| 1993 | select { |
| 1994 | case <-done: |
| 1995 | case <-closed: |
| 1996 | cancel() |
| 1997 | } |
| 1998 | }(ctx.Done(), cn.CloseNotify()) |
| 1999 | } |
| 2000 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) |
| 2001 | rctx, err := runtime.AnnotateContext(ctx, mux, req) |
| 2002 | if err != nil { |
| 2003 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 2004 | return |
| 2005 | } |
| 2006 | resp, md, err := request_Auth_UserChangePassword_0(rctx, inboundMarshaler, client, req, pathParams) |
| 2007 | ctx = runtime.NewServerMetadataContext(ctx, md) |
| 2008 | if err != nil { |
| 2009 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 2010 | return |
| 2011 | } |
| 2012 | |
| 2013 | forward_Auth_UserChangePassword_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) |
| 2014 | |
| 2015 | }) |
| 2016 | |
| 2017 | mux.Handle("POST", pattern_Auth_UserGrantRole_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { |
| 2018 | ctx, cancel := context.WithCancel(req.Context()) |
| 2019 | defer cancel() |
| 2020 | if cn, ok := w.(http.CloseNotifier); ok { |
| 2021 | go func(done <-chan struct{}, closed <-chan bool) { |
| 2022 | select { |
| 2023 | case <-done: |
| 2024 | case <-closed: |
| 2025 | cancel() |
| 2026 | } |
| 2027 | }(ctx.Done(), cn.CloseNotify()) |
| 2028 | } |
| 2029 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) |
| 2030 | rctx, err := runtime.AnnotateContext(ctx, mux, req) |
| 2031 | if err != nil { |
| 2032 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 2033 | return |
| 2034 | } |
| 2035 | resp, md, err := request_Auth_UserGrantRole_0(rctx, inboundMarshaler, client, req, pathParams) |
| 2036 | ctx = runtime.NewServerMetadataContext(ctx, md) |
| 2037 | if err != nil { |
| 2038 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 2039 | return |
| 2040 | } |
| 2041 | |
| 2042 | forward_Auth_UserGrantRole_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) |
| 2043 | |
| 2044 | }) |
| 2045 | |
| 2046 | mux.Handle("POST", pattern_Auth_UserRevokeRole_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { |
| 2047 | ctx, cancel := context.WithCancel(req.Context()) |
| 2048 | defer cancel() |
| 2049 | if cn, ok := w.(http.CloseNotifier); ok { |
| 2050 | go func(done <-chan struct{}, closed <-chan bool) { |
| 2051 | select { |
| 2052 | case <-done: |
| 2053 | case <-closed: |
| 2054 | cancel() |
| 2055 | } |
| 2056 | }(ctx.Done(), cn.CloseNotify()) |
| 2057 | } |
| 2058 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) |
| 2059 | rctx, err := runtime.AnnotateContext(ctx, mux, req) |
| 2060 | if err != nil { |
| 2061 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 2062 | return |
| 2063 | } |
| 2064 | resp, md, err := request_Auth_UserRevokeRole_0(rctx, inboundMarshaler, client, req, pathParams) |
| 2065 | ctx = runtime.NewServerMetadataContext(ctx, md) |
| 2066 | if err != nil { |
| 2067 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 2068 | return |
| 2069 | } |
| 2070 | |
| 2071 | forward_Auth_UserRevokeRole_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) |
| 2072 | |
| 2073 | }) |
| 2074 | |
| 2075 | mux.Handle("POST", pattern_Auth_RoleAdd_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { |
| 2076 | ctx, cancel := context.WithCancel(req.Context()) |
| 2077 | defer cancel() |
| 2078 | if cn, ok := w.(http.CloseNotifier); ok { |
| 2079 | go func(done <-chan struct{}, closed <-chan bool) { |
| 2080 | select { |
| 2081 | case <-done: |
| 2082 | case <-closed: |
| 2083 | cancel() |
| 2084 | } |
| 2085 | }(ctx.Done(), cn.CloseNotify()) |
| 2086 | } |
| 2087 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) |
| 2088 | rctx, err := runtime.AnnotateContext(ctx, mux, req) |
| 2089 | if err != nil { |
| 2090 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 2091 | return |
| 2092 | } |
| 2093 | resp, md, err := request_Auth_RoleAdd_0(rctx, inboundMarshaler, client, req, pathParams) |
| 2094 | ctx = runtime.NewServerMetadataContext(ctx, md) |
| 2095 | if err != nil { |
| 2096 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 2097 | return |
| 2098 | } |
| 2099 | |
| 2100 | forward_Auth_RoleAdd_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) |
| 2101 | |
| 2102 | }) |
| 2103 | |
| 2104 | mux.Handle("POST", pattern_Auth_RoleGet_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { |
| 2105 | ctx, cancel := context.WithCancel(req.Context()) |
| 2106 | defer cancel() |
| 2107 | if cn, ok := w.(http.CloseNotifier); ok { |
| 2108 | go func(done <-chan struct{}, closed <-chan bool) { |
| 2109 | select { |
| 2110 | case <-done: |
| 2111 | case <-closed: |
| 2112 | cancel() |
| 2113 | } |
| 2114 | }(ctx.Done(), cn.CloseNotify()) |
| 2115 | } |
| 2116 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) |
| 2117 | rctx, err := runtime.AnnotateContext(ctx, mux, req) |
| 2118 | if err != nil { |
| 2119 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 2120 | return |
| 2121 | } |
| 2122 | resp, md, err := request_Auth_RoleGet_0(rctx, inboundMarshaler, client, req, pathParams) |
| 2123 | ctx = runtime.NewServerMetadataContext(ctx, md) |
| 2124 | if err != nil { |
| 2125 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 2126 | return |
| 2127 | } |
| 2128 | |
| 2129 | forward_Auth_RoleGet_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) |
| 2130 | |
| 2131 | }) |
| 2132 | |
| 2133 | mux.Handle("POST", pattern_Auth_RoleList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { |
| 2134 | ctx, cancel := context.WithCancel(req.Context()) |
| 2135 | defer cancel() |
| 2136 | if cn, ok := w.(http.CloseNotifier); ok { |
| 2137 | go func(done <-chan struct{}, closed <-chan bool) { |
| 2138 | select { |
| 2139 | case <-done: |
| 2140 | case <-closed: |
| 2141 | cancel() |
| 2142 | } |
| 2143 | }(ctx.Done(), cn.CloseNotify()) |
| 2144 | } |
| 2145 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) |
| 2146 | rctx, err := runtime.AnnotateContext(ctx, mux, req) |
| 2147 | if err != nil { |
| 2148 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 2149 | return |
| 2150 | } |
| 2151 | resp, md, err := request_Auth_RoleList_0(rctx, inboundMarshaler, client, req, pathParams) |
| 2152 | ctx = runtime.NewServerMetadataContext(ctx, md) |
| 2153 | if err != nil { |
| 2154 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 2155 | return |
| 2156 | } |
| 2157 | |
| 2158 | forward_Auth_RoleList_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) |
| 2159 | |
| 2160 | }) |
| 2161 | |
| 2162 | mux.Handle("POST", pattern_Auth_RoleDelete_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { |
| 2163 | ctx, cancel := context.WithCancel(req.Context()) |
| 2164 | defer cancel() |
| 2165 | if cn, ok := w.(http.CloseNotifier); ok { |
| 2166 | go func(done <-chan struct{}, closed <-chan bool) { |
| 2167 | select { |
| 2168 | case <-done: |
| 2169 | case <-closed: |
| 2170 | cancel() |
| 2171 | } |
| 2172 | }(ctx.Done(), cn.CloseNotify()) |
| 2173 | } |
| 2174 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) |
| 2175 | rctx, err := runtime.AnnotateContext(ctx, mux, req) |
| 2176 | if err != nil { |
| 2177 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 2178 | return |
| 2179 | } |
| 2180 | resp, md, err := request_Auth_RoleDelete_0(rctx, inboundMarshaler, client, req, pathParams) |
| 2181 | ctx = runtime.NewServerMetadataContext(ctx, md) |
| 2182 | if err != nil { |
| 2183 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 2184 | return |
| 2185 | } |
| 2186 | |
| 2187 | forward_Auth_RoleDelete_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) |
| 2188 | |
| 2189 | }) |
| 2190 | |
| 2191 | mux.Handle("POST", pattern_Auth_RoleGrantPermission_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { |
| 2192 | ctx, cancel := context.WithCancel(req.Context()) |
| 2193 | defer cancel() |
| 2194 | if cn, ok := w.(http.CloseNotifier); ok { |
| 2195 | go func(done <-chan struct{}, closed <-chan bool) { |
| 2196 | select { |
| 2197 | case <-done: |
| 2198 | case <-closed: |
| 2199 | cancel() |
| 2200 | } |
| 2201 | }(ctx.Done(), cn.CloseNotify()) |
| 2202 | } |
| 2203 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) |
| 2204 | rctx, err := runtime.AnnotateContext(ctx, mux, req) |
| 2205 | if err != nil { |
| 2206 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 2207 | return |
| 2208 | } |
| 2209 | resp, md, err := request_Auth_RoleGrantPermission_0(rctx, inboundMarshaler, client, req, pathParams) |
| 2210 | ctx = runtime.NewServerMetadataContext(ctx, md) |
| 2211 | if err != nil { |
| 2212 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 2213 | return |
| 2214 | } |
| 2215 | |
| 2216 | forward_Auth_RoleGrantPermission_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) |
| 2217 | |
| 2218 | }) |
| 2219 | |
| 2220 | mux.Handle("POST", pattern_Auth_RoleRevokePermission_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { |
| 2221 | ctx, cancel := context.WithCancel(req.Context()) |
| 2222 | defer cancel() |
| 2223 | if cn, ok := w.(http.CloseNotifier); ok { |
| 2224 | go func(done <-chan struct{}, closed <-chan bool) { |
| 2225 | select { |
| 2226 | case <-done: |
| 2227 | case <-closed: |
| 2228 | cancel() |
| 2229 | } |
| 2230 | }(ctx.Done(), cn.CloseNotify()) |
| 2231 | } |
| 2232 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) |
| 2233 | rctx, err := runtime.AnnotateContext(ctx, mux, req) |
| 2234 | if err != nil { |
| 2235 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 2236 | return |
| 2237 | } |
| 2238 | resp, md, err := request_Auth_RoleRevokePermission_0(rctx, inboundMarshaler, client, req, pathParams) |
| 2239 | ctx = runtime.NewServerMetadataContext(ctx, md) |
| 2240 | if err != nil { |
| 2241 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) |
| 2242 | return |
| 2243 | } |
| 2244 | |
| 2245 | forward_Auth_RoleRevokePermission_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) |
| 2246 | |
| 2247 | }) |
| 2248 | |
| 2249 | return nil |
| 2250 | } |
| 2251 | |
| 2252 | var ( |
| 2253 | pattern_Auth_AuthEnable_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v3", "auth", "enable"}, "")) |
| 2254 | |
| 2255 | pattern_Auth_AuthDisable_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v3", "auth", "disable"}, "")) |
| 2256 | |
| 2257 | pattern_Auth_Authenticate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v3", "auth", "authenticate"}, "")) |
| 2258 | |
| 2259 | pattern_Auth_UserAdd_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v3", "auth", "user", "add"}, "")) |
| 2260 | |
| 2261 | pattern_Auth_UserGet_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v3", "auth", "user", "get"}, "")) |
| 2262 | |
| 2263 | pattern_Auth_UserList_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v3", "auth", "user", "list"}, "")) |
| 2264 | |
| 2265 | pattern_Auth_UserDelete_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v3", "auth", "user", "delete"}, "")) |
| 2266 | |
| 2267 | pattern_Auth_UserChangePassword_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v3", "auth", "user", "changepw"}, "")) |
| 2268 | |
| 2269 | pattern_Auth_UserGrantRole_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v3", "auth", "user", "grant"}, "")) |
| 2270 | |
| 2271 | pattern_Auth_UserRevokeRole_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v3", "auth", "user", "revoke"}, "")) |
| 2272 | |
| 2273 | pattern_Auth_RoleAdd_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v3", "auth", "role", "add"}, "")) |
| 2274 | |
| 2275 | pattern_Auth_RoleGet_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v3", "auth", "role", "get"}, "")) |
| 2276 | |
| 2277 | pattern_Auth_RoleList_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v3", "auth", "role", "list"}, "")) |
| 2278 | |
| 2279 | pattern_Auth_RoleDelete_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v3", "auth", "role", "delete"}, "")) |
| 2280 | |
| 2281 | pattern_Auth_RoleGrantPermission_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v3", "auth", "role", "grant"}, "")) |
| 2282 | |
| 2283 | pattern_Auth_RoleRevokePermission_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v3", "auth", "role", "revoke"}, "")) |
| 2284 | ) |
| 2285 | |
| 2286 | var ( |
| 2287 | forward_Auth_AuthEnable_0 = runtime.ForwardResponseMessage |
| 2288 | |
| 2289 | forward_Auth_AuthDisable_0 = runtime.ForwardResponseMessage |
| 2290 | |
| 2291 | forward_Auth_Authenticate_0 = runtime.ForwardResponseMessage |
| 2292 | |
| 2293 | forward_Auth_UserAdd_0 = runtime.ForwardResponseMessage |
| 2294 | |
| 2295 | forward_Auth_UserGet_0 = runtime.ForwardResponseMessage |
| 2296 | |
| 2297 | forward_Auth_UserList_0 = runtime.ForwardResponseMessage |
| 2298 | |
| 2299 | forward_Auth_UserDelete_0 = runtime.ForwardResponseMessage |
| 2300 | |
| 2301 | forward_Auth_UserChangePassword_0 = runtime.ForwardResponseMessage |
| 2302 | |
| 2303 | forward_Auth_UserGrantRole_0 = runtime.ForwardResponseMessage |
| 2304 | |
| 2305 | forward_Auth_UserRevokeRole_0 = runtime.ForwardResponseMessage |
| 2306 | |
| 2307 | forward_Auth_RoleAdd_0 = runtime.ForwardResponseMessage |
| 2308 | |
| 2309 | forward_Auth_RoleGet_0 = runtime.ForwardResponseMessage |
| 2310 | |
| 2311 | forward_Auth_RoleList_0 = runtime.ForwardResponseMessage |
| 2312 | |
| 2313 | forward_Auth_RoleDelete_0 = runtime.ForwardResponseMessage |
| 2314 | |
| 2315 | forward_Auth_RoleGrantPermission_0 = runtime.ForwardResponseMessage |
| 2316 | |
| 2317 | forward_Auth_RoleRevokePermission_0 = runtime.ForwardResponseMessage |
| 2318 | ) |