github.com/argoproj/argo-cd@v1.8.7/pkg/apiclient/cluster/cluster.pb.gw.go (about) 1 // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. 2 // source: server/cluster/cluster.proto 3 4 /* 5 Package cluster is a reverse proxy. 6 7 It translates gRPC into RESTful JSON APIs. 8 */ 9 package cluster 10 11 import ( 12 "context" 13 "io" 14 "net/http" 15 16 "github.com/golang/protobuf/descriptor" 17 "github.com/golang/protobuf/proto" 18 "github.com/grpc-ecosystem/grpc-gateway/runtime" 19 "github.com/grpc-ecosystem/grpc-gateway/utilities" 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 // Suppress "imported and not used" errors 27 var _ codes.Code 28 var _ io.Reader 29 var _ status.Status 30 var _ = runtime.String 31 var _ = utilities.NewDoubleArray 32 var _ = descriptor.ForMessage 33 34 var ( 35 filter_ClusterService_List_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} 36 ) 37 38 func request_ClusterService_List_0(ctx context.Context, marshaler runtime.Marshaler, client ClusterServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 39 var protoReq ClusterQuery 40 var metadata runtime.ServerMetadata 41 42 if err := req.ParseForm(); err != nil { 43 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 44 } 45 if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ClusterService_List_0); err != nil { 46 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 47 } 48 49 msg, err := client.List(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 50 return msg, metadata, err 51 52 } 53 54 func local_request_ClusterService_List_0(ctx context.Context, marshaler runtime.Marshaler, server ClusterServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 55 var protoReq ClusterQuery 56 var metadata runtime.ServerMetadata 57 58 if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_ClusterService_List_0); err != nil { 59 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 60 } 61 62 msg, err := server.List(ctx, &protoReq) 63 return msg, metadata, err 64 65 } 66 67 var ( 68 filter_ClusterService_Create_0 = &utilities.DoubleArray{Encoding: map[string]int{"cluster": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} 69 ) 70 71 func request_ClusterService_Create_0(ctx context.Context, marshaler runtime.Marshaler, client ClusterServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 72 var protoReq ClusterCreateRequest 73 var metadata runtime.ServerMetadata 74 75 newReader, berr := utilities.IOReaderFactory(req.Body) 76 if berr != nil { 77 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) 78 } 79 if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Cluster); err != nil && err != io.EOF { 80 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 81 } 82 83 if err := req.ParseForm(); err != nil { 84 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 85 } 86 if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ClusterService_Create_0); err != nil { 87 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 88 } 89 90 msg, err := client.Create(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 91 return msg, metadata, err 92 93 } 94 95 func local_request_ClusterService_Create_0(ctx context.Context, marshaler runtime.Marshaler, server ClusterServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 96 var protoReq ClusterCreateRequest 97 var metadata runtime.ServerMetadata 98 99 newReader, berr := utilities.IOReaderFactory(req.Body) 100 if berr != nil { 101 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) 102 } 103 if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Cluster); err != nil && err != io.EOF { 104 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 105 } 106 107 if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_ClusterService_Create_0); err != nil { 108 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 109 } 110 111 msg, err := server.Create(ctx, &protoReq) 112 return msg, metadata, err 113 114 } 115 116 var ( 117 filter_ClusterService_Get_0 = &utilities.DoubleArray{Encoding: map[string]int{"server": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} 118 ) 119 120 func request_ClusterService_Get_0(ctx context.Context, marshaler runtime.Marshaler, client ClusterServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 121 var protoReq ClusterQuery 122 var metadata runtime.ServerMetadata 123 124 var ( 125 val string 126 ok bool 127 err error 128 _ = err 129 ) 130 131 val, ok = pathParams["server"] 132 if !ok { 133 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "server") 134 } 135 136 protoReq.Server, err = runtime.String(val) 137 138 if err != nil { 139 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "server", err) 140 } 141 142 if err := req.ParseForm(); err != nil { 143 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 144 } 145 if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ClusterService_Get_0); err != nil { 146 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 147 } 148 149 msg, err := client.Get(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 150 return msg, metadata, err 151 152 } 153 154 func local_request_ClusterService_Get_0(ctx context.Context, marshaler runtime.Marshaler, server ClusterServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 155 var protoReq ClusterQuery 156 var metadata runtime.ServerMetadata 157 158 var ( 159 val string 160 ok bool 161 err error 162 _ = err 163 ) 164 165 val, ok = pathParams["server"] 166 if !ok { 167 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "server") 168 } 169 170 protoReq.Server, err = runtime.String(val) 171 172 if err != nil { 173 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "server", err) 174 } 175 176 if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_ClusterService_Get_0); err != nil { 177 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 178 } 179 180 msg, err := server.Get(ctx, &protoReq) 181 return msg, metadata, err 182 183 } 184 185 var ( 186 filter_ClusterService_Update_0 = &utilities.DoubleArray{Encoding: map[string]int{"cluster": 0, "server": 1}, Base: []int{1, 2, 1, 0, 0}, Check: []int{0, 1, 2, 3, 2}} 187 ) 188 189 func request_ClusterService_Update_0(ctx context.Context, marshaler runtime.Marshaler, client ClusterServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 190 var protoReq ClusterUpdateRequest 191 var metadata runtime.ServerMetadata 192 193 newReader, berr := utilities.IOReaderFactory(req.Body) 194 if berr != nil { 195 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) 196 } 197 if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Cluster); err != nil && err != io.EOF { 198 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 199 } 200 201 var ( 202 val string 203 ok bool 204 err error 205 _ = err 206 ) 207 208 val, ok = pathParams["cluster.server"] 209 if !ok { 210 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "cluster.server") 211 } 212 213 err = runtime.PopulateFieldFromPath(&protoReq, "cluster.server", val) 214 215 if err != nil { 216 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "cluster.server", err) 217 } 218 219 if err := req.ParseForm(); err != nil { 220 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 221 } 222 if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ClusterService_Update_0); err != nil { 223 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 224 } 225 226 msg, err := client.Update(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 227 return msg, metadata, err 228 229 } 230 231 func local_request_ClusterService_Update_0(ctx context.Context, marshaler runtime.Marshaler, server ClusterServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 232 var protoReq ClusterUpdateRequest 233 var metadata runtime.ServerMetadata 234 235 newReader, berr := utilities.IOReaderFactory(req.Body) 236 if berr != nil { 237 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) 238 } 239 if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Cluster); err != nil && err != io.EOF { 240 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 241 } 242 243 var ( 244 val string 245 ok bool 246 err error 247 _ = err 248 ) 249 250 val, ok = pathParams["cluster.server"] 251 if !ok { 252 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "cluster.server") 253 } 254 255 err = runtime.PopulateFieldFromPath(&protoReq, "cluster.server", val) 256 257 if err != nil { 258 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "cluster.server", err) 259 } 260 261 if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_ClusterService_Update_0); err != nil { 262 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 263 } 264 265 msg, err := server.Update(ctx, &protoReq) 266 return msg, metadata, err 267 268 } 269 270 var ( 271 filter_ClusterService_Delete_0 = &utilities.DoubleArray{Encoding: map[string]int{"server": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} 272 ) 273 274 func request_ClusterService_Delete_0(ctx context.Context, marshaler runtime.Marshaler, client ClusterServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 275 var protoReq ClusterQuery 276 var metadata runtime.ServerMetadata 277 278 var ( 279 val string 280 ok bool 281 err error 282 _ = err 283 ) 284 285 val, ok = pathParams["server"] 286 if !ok { 287 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "server") 288 } 289 290 protoReq.Server, err = runtime.String(val) 291 292 if err != nil { 293 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "server", err) 294 } 295 296 if err := req.ParseForm(); err != nil { 297 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 298 } 299 if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ClusterService_Delete_0); err != nil { 300 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 301 } 302 303 msg, err := client.Delete(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 304 return msg, metadata, err 305 306 } 307 308 func local_request_ClusterService_Delete_0(ctx context.Context, marshaler runtime.Marshaler, server ClusterServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 309 var protoReq ClusterQuery 310 var metadata runtime.ServerMetadata 311 312 var ( 313 val string 314 ok bool 315 err error 316 _ = err 317 ) 318 319 val, ok = pathParams["server"] 320 if !ok { 321 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "server") 322 } 323 324 protoReq.Server, err = runtime.String(val) 325 326 if err != nil { 327 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "server", err) 328 } 329 330 if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_ClusterService_Delete_0); err != nil { 331 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 332 } 333 334 msg, err := server.Delete(ctx, &protoReq) 335 return msg, metadata, err 336 337 } 338 339 var ( 340 filter_ClusterService_RotateAuth_0 = &utilities.DoubleArray{Encoding: map[string]int{"server": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} 341 ) 342 343 func request_ClusterService_RotateAuth_0(ctx context.Context, marshaler runtime.Marshaler, client ClusterServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 344 var protoReq ClusterQuery 345 var metadata runtime.ServerMetadata 346 347 var ( 348 val string 349 ok bool 350 err error 351 _ = err 352 ) 353 354 val, ok = pathParams["server"] 355 if !ok { 356 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "server") 357 } 358 359 protoReq.Server, err = runtime.String(val) 360 361 if err != nil { 362 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "server", err) 363 } 364 365 if err := req.ParseForm(); err != nil { 366 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 367 } 368 if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ClusterService_RotateAuth_0); err != nil { 369 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 370 } 371 372 msg, err := client.RotateAuth(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 373 return msg, metadata, err 374 375 } 376 377 func local_request_ClusterService_RotateAuth_0(ctx context.Context, marshaler runtime.Marshaler, server ClusterServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 378 var protoReq ClusterQuery 379 var metadata runtime.ServerMetadata 380 381 var ( 382 val string 383 ok bool 384 err error 385 _ = err 386 ) 387 388 val, ok = pathParams["server"] 389 if !ok { 390 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "server") 391 } 392 393 protoReq.Server, err = runtime.String(val) 394 395 if err != nil { 396 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "server", err) 397 } 398 399 if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_ClusterService_RotateAuth_0); err != nil { 400 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 401 } 402 403 msg, err := server.RotateAuth(ctx, &protoReq) 404 return msg, metadata, err 405 406 } 407 408 var ( 409 filter_ClusterService_InvalidateCache_0 = &utilities.DoubleArray{Encoding: map[string]int{"server": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} 410 ) 411 412 func request_ClusterService_InvalidateCache_0(ctx context.Context, marshaler runtime.Marshaler, client ClusterServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 413 var protoReq ClusterQuery 414 var metadata runtime.ServerMetadata 415 416 var ( 417 val string 418 ok bool 419 err error 420 _ = err 421 ) 422 423 val, ok = pathParams["server"] 424 if !ok { 425 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "server") 426 } 427 428 protoReq.Server, err = runtime.String(val) 429 430 if err != nil { 431 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "server", err) 432 } 433 434 if err := req.ParseForm(); err != nil { 435 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 436 } 437 if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ClusterService_InvalidateCache_0); err != nil { 438 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 439 } 440 441 msg, err := client.InvalidateCache(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 442 return msg, metadata, err 443 444 } 445 446 func local_request_ClusterService_InvalidateCache_0(ctx context.Context, marshaler runtime.Marshaler, server ClusterServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 447 var protoReq ClusterQuery 448 var metadata runtime.ServerMetadata 449 450 var ( 451 val string 452 ok bool 453 err error 454 _ = err 455 ) 456 457 val, ok = pathParams["server"] 458 if !ok { 459 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "server") 460 } 461 462 protoReq.Server, err = runtime.String(val) 463 464 if err != nil { 465 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "server", err) 466 } 467 468 if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_ClusterService_InvalidateCache_0); err != nil { 469 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 470 } 471 472 msg, err := server.InvalidateCache(ctx, &protoReq) 473 return msg, metadata, err 474 475 } 476 477 // RegisterClusterServiceHandlerServer registers the http handlers for service ClusterService to "mux". 478 // UnaryRPC :call ClusterServiceServer directly. 479 // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. 480 func RegisterClusterServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ClusterServiceServer) error { 481 482 mux.Handle("GET", pattern_ClusterService_List_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 483 ctx, cancel := context.WithCancel(req.Context()) 484 defer cancel() 485 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 486 rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) 487 if err != nil { 488 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 489 return 490 } 491 resp, md, err := local_request_ClusterService_List_0(rctx, inboundMarshaler, server, req, pathParams) 492 ctx = runtime.NewServerMetadataContext(ctx, md) 493 if err != nil { 494 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 495 return 496 } 497 498 forward_ClusterService_List_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 499 500 }) 501 502 mux.Handle("POST", pattern_ClusterService_Create_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 503 ctx, cancel := context.WithCancel(req.Context()) 504 defer cancel() 505 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 506 rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) 507 if err != nil { 508 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 509 return 510 } 511 resp, md, err := local_request_ClusterService_Create_0(rctx, inboundMarshaler, server, req, pathParams) 512 ctx = runtime.NewServerMetadataContext(ctx, md) 513 if err != nil { 514 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 515 return 516 } 517 518 forward_ClusterService_Create_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 519 520 }) 521 522 mux.Handle("GET", pattern_ClusterService_Get_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 523 ctx, cancel := context.WithCancel(req.Context()) 524 defer cancel() 525 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 526 rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) 527 if err != nil { 528 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 529 return 530 } 531 resp, md, err := local_request_ClusterService_Get_0(rctx, inboundMarshaler, server, req, pathParams) 532 ctx = runtime.NewServerMetadataContext(ctx, md) 533 if err != nil { 534 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 535 return 536 } 537 538 forward_ClusterService_Get_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 539 540 }) 541 542 mux.Handle("PUT", pattern_ClusterService_Update_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 543 ctx, cancel := context.WithCancel(req.Context()) 544 defer cancel() 545 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 546 rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) 547 if err != nil { 548 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 549 return 550 } 551 resp, md, err := local_request_ClusterService_Update_0(rctx, inboundMarshaler, server, req, pathParams) 552 ctx = runtime.NewServerMetadataContext(ctx, md) 553 if err != nil { 554 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 555 return 556 } 557 558 forward_ClusterService_Update_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 559 560 }) 561 562 mux.Handle("DELETE", pattern_ClusterService_Delete_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 563 ctx, cancel := context.WithCancel(req.Context()) 564 defer cancel() 565 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 566 rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) 567 if err != nil { 568 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 569 return 570 } 571 resp, md, err := local_request_ClusterService_Delete_0(rctx, inboundMarshaler, server, req, pathParams) 572 ctx = runtime.NewServerMetadataContext(ctx, md) 573 if err != nil { 574 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 575 return 576 } 577 578 forward_ClusterService_Delete_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 579 580 }) 581 582 mux.Handle("POST", pattern_ClusterService_RotateAuth_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 583 ctx, cancel := context.WithCancel(req.Context()) 584 defer cancel() 585 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 586 rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) 587 if err != nil { 588 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 589 return 590 } 591 resp, md, err := local_request_ClusterService_RotateAuth_0(rctx, inboundMarshaler, server, req, pathParams) 592 ctx = runtime.NewServerMetadataContext(ctx, md) 593 if err != nil { 594 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 595 return 596 } 597 598 forward_ClusterService_RotateAuth_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 599 600 }) 601 602 mux.Handle("POST", pattern_ClusterService_InvalidateCache_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 603 ctx, cancel := context.WithCancel(req.Context()) 604 defer cancel() 605 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 606 rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) 607 if err != nil { 608 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 609 return 610 } 611 resp, md, err := local_request_ClusterService_InvalidateCache_0(rctx, inboundMarshaler, server, req, pathParams) 612 ctx = runtime.NewServerMetadataContext(ctx, md) 613 if err != nil { 614 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 615 return 616 } 617 618 forward_ClusterService_InvalidateCache_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 619 620 }) 621 622 return nil 623 } 624 625 // RegisterClusterServiceHandlerFromEndpoint is same as RegisterClusterServiceHandler but 626 // automatically dials to "endpoint" and closes the connection when "ctx" gets done. 627 func RegisterClusterServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { 628 conn, err := grpc.Dial(endpoint, opts...) 629 if err != nil { 630 return err 631 } 632 defer func() { 633 if err != nil { 634 if cerr := conn.Close(); cerr != nil { 635 grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) 636 } 637 return 638 } 639 go func() { 640 <-ctx.Done() 641 if cerr := conn.Close(); cerr != nil { 642 grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) 643 } 644 }() 645 }() 646 647 return RegisterClusterServiceHandler(ctx, mux, conn) 648 } 649 650 // RegisterClusterServiceHandler registers the http handlers for service ClusterService to "mux". 651 // The handlers forward requests to the grpc endpoint over "conn". 652 func RegisterClusterServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { 653 return RegisterClusterServiceHandlerClient(ctx, mux, NewClusterServiceClient(conn)) 654 } 655 656 // RegisterClusterServiceHandlerClient registers the http handlers for service ClusterService 657 // to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ClusterServiceClient". 658 // Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ClusterServiceClient" 659 // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in 660 // "ClusterServiceClient" to call the correct interceptors. 661 func RegisterClusterServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ClusterServiceClient) error { 662 663 mux.Handle("GET", pattern_ClusterService_List_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 664 ctx, cancel := context.WithCancel(req.Context()) 665 defer cancel() 666 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 667 rctx, err := runtime.AnnotateContext(ctx, mux, req) 668 if err != nil { 669 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 670 return 671 } 672 resp, md, err := request_ClusterService_List_0(rctx, inboundMarshaler, client, req, pathParams) 673 ctx = runtime.NewServerMetadataContext(ctx, md) 674 if err != nil { 675 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 676 return 677 } 678 679 forward_ClusterService_List_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 680 681 }) 682 683 mux.Handle("POST", pattern_ClusterService_Create_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 684 ctx, cancel := context.WithCancel(req.Context()) 685 defer cancel() 686 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 687 rctx, err := runtime.AnnotateContext(ctx, mux, req) 688 if err != nil { 689 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 690 return 691 } 692 resp, md, err := request_ClusterService_Create_0(rctx, inboundMarshaler, client, req, pathParams) 693 ctx = runtime.NewServerMetadataContext(ctx, md) 694 if err != nil { 695 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 696 return 697 } 698 699 forward_ClusterService_Create_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 700 701 }) 702 703 mux.Handle("GET", pattern_ClusterService_Get_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 704 ctx, cancel := context.WithCancel(req.Context()) 705 defer cancel() 706 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 707 rctx, err := runtime.AnnotateContext(ctx, mux, req) 708 if err != nil { 709 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 710 return 711 } 712 resp, md, err := request_ClusterService_Get_0(rctx, inboundMarshaler, client, req, pathParams) 713 ctx = runtime.NewServerMetadataContext(ctx, md) 714 if err != nil { 715 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 716 return 717 } 718 719 forward_ClusterService_Get_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 720 721 }) 722 723 mux.Handle("PUT", pattern_ClusterService_Update_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 724 ctx, cancel := context.WithCancel(req.Context()) 725 defer cancel() 726 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 727 rctx, err := runtime.AnnotateContext(ctx, mux, req) 728 if err != nil { 729 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 730 return 731 } 732 resp, md, err := request_ClusterService_Update_0(rctx, inboundMarshaler, client, req, pathParams) 733 ctx = runtime.NewServerMetadataContext(ctx, md) 734 if err != nil { 735 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 736 return 737 } 738 739 forward_ClusterService_Update_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 740 741 }) 742 743 mux.Handle("DELETE", pattern_ClusterService_Delete_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 744 ctx, cancel := context.WithCancel(req.Context()) 745 defer cancel() 746 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 747 rctx, err := runtime.AnnotateContext(ctx, mux, req) 748 if err != nil { 749 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 750 return 751 } 752 resp, md, err := request_ClusterService_Delete_0(rctx, inboundMarshaler, client, req, pathParams) 753 ctx = runtime.NewServerMetadataContext(ctx, md) 754 if err != nil { 755 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 756 return 757 } 758 759 forward_ClusterService_Delete_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 760 761 }) 762 763 mux.Handle("POST", pattern_ClusterService_RotateAuth_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 764 ctx, cancel := context.WithCancel(req.Context()) 765 defer cancel() 766 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 767 rctx, err := runtime.AnnotateContext(ctx, mux, req) 768 if err != nil { 769 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 770 return 771 } 772 resp, md, err := request_ClusterService_RotateAuth_0(rctx, inboundMarshaler, client, req, pathParams) 773 ctx = runtime.NewServerMetadataContext(ctx, md) 774 if err != nil { 775 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 776 return 777 } 778 779 forward_ClusterService_RotateAuth_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 780 781 }) 782 783 mux.Handle("POST", pattern_ClusterService_InvalidateCache_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 784 ctx, cancel := context.WithCancel(req.Context()) 785 defer cancel() 786 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 787 rctx, err := runtime.AnnotateContext(ctx, mux, req) 788 if err != nil { 789 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 790 return 791 } 792 resp, md, err := request_ClusterService_InvalidateCache_0(rctx, inboundMarshaler, client, req, pathParams) 793 ctx = runtime.NewServerMetadataContext(ctx, md) 794 if err != nil { 795 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 796 return 797 } 798 799 forward_ClusterService_InvalidateCache_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 800 801 }) 802 803 return nil 804 } 805 806 var ( 807 pattern_ClusterService_List_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "clusters"}, "", runtime.AssumeColonVerbOpt(true))) 808 809 pattern_ClusterService_Create_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "clusters"}, "", runtime.AssumeColonVerbOpt(true))) 810 811 pattern_ClusterService_Get_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v1", "clusters", "server"}, "", runtime.AssumeColonVerbOpt(true))) 812 813 pattern_ClusterService_Update_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v1", "clusters", "cluster.server"}, "", runtime.AssumeColonVerbOpt(true))) 814 815 pattern_ClusterService_Delete_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v1", "clusters", "server"}, "", runtime.AssumeColonVerbOpt(true))) 816 817 pattern_ClusterService_RotateAuth_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v1", "clusters", "server", "rotate-auth"}, "", runtime.AssumeColonVerbOpt(true))) 818 819 pattern_ClusterService_InvalidateCache_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v1", "clusters", "server", "invalidate-cache"}, "", runtime.AssumeColonVerbOpt(true))) 820 ) 821 822 var ( 823 forward_ClusterService_List_0 = runtime.ForwardResponseMessage 824 825 forward_ClusterService_Create_0 = runtime.ForwardResponseMessage 826 827 forward_ClusterService_Get_0 = runtime.ForwardResponseMessage 828 829 forward_ClusterService_Update_0 = runtime.ForwardResponseMessage 830 831 forward_ClusterService_Delete_0 = runtime.ForwardResponseMessage 832 833 forward_ClusterService_RotateAuth_0 = runtime.ForwardResponseMessage 834 835 forward_ClusterService_InvalidateCache_0 = runtime.ForwardResponseMessage 836 )