github.com/argoproj/argo-cd/v3@v3.2.1/pkg/apiclient/applicationset/applicationset.pb.gw.go (about) 1 // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. 2 // source: server/applicationset/applicationset.proto 3 4 /* 5 Package applicationset is a reverse proxy. 6 7 It translates gRPC into RESTful JSON APIs. 8 */ 9 package applicationset 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/metadata" 24 "google.golang.org/grpc/status" 25 ) 26 27 // Suppress "imported and not used" errors 28 var _ codes.Code 29 var _ io.Reader 30 var _ status.Status 31 var _ = runtime.String 32 var _ = utilities.NewDoubleArray 33 var _ = descriptor.ForMessage 34 var _ = metadata.Join 35 36 var ( 37 filter_ApplicationSetService_Get_0 = &utilities.DoubleArray{Encoding: map[string]int{"name": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} 38 ) 39 40 func request_ApplicationSetService_Get_0(ctx context.Context, marshaler runtime.Marshaler, client ApplicationSetServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 41 var protoReq ApplicationSetGetQuery 42 var metadata runtime.ServerMetadata 43 44 var ( 45 val string 46 ok bool 47 err error 48 _ = err 49 ) 50 51 val, ok = pathParams["name"] 52 if !ok { 53 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") 54 } 55 56 protoReq.Name, err = runtime.String(val) 57 58 if err != nil { 59 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) 60 } 61 62 if err := req.ParseForm(); err != nil { 63 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 64 } 65 if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ApplicationSetService_Get_0); err != nil { 66 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 67 } 68 69 msg, err := client.Get(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 70 return msg, metadata, err 71 72 } 73 74 func local_request_ApplicationSetService_Get_0(ctx context.Context, marshaler runtime.Marshaler, server ApplicationSetServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 75 var protoReq ApplicationSetGetQuery 76 var metadata runtime.ServerMetadata 77 78 var ( 79 val string 80 ok bool 81 err error 82 _ = err 83 ) 84 85 val, ok = pathParams["name"] 86 if !ok { 87 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") 88 } 89 90 protoReq.Name, err = runtime.String(val) 91 92 if err != nil { 93 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) 94 } 95 96 if err := req.ParseForm(); err != nil { 97 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 98 } 99 if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ApplicationSetService_Get_0); err != nil { 100 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 101 } 102 103 msg, err := server.Get(ctx, &protoReq) 104 return msg, metadata, err 105 106 } 107 108 func request_ApplicationSetService_Generate_0(ctx context.Context, marshaler runtime.Marshaler, client ApplicationSetServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 109 var protoReq ApplicationSetGenerateRequest 110 var metadata runtime.ServerMetadata 111 112 newReader, berr := utilities.IOReaderFactory(req.Body) 113 if berr != nil { 114 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) 115 } 116 if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { 117 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 118 } 119 120 msg, err := client.Generate(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 121 return msg, metadata, err 122 123 } 124 125 func local_request_ApplicationSetService_Generate_0(ctx context.Context, marshaler runtime.Marshaler, server ApplicationSetServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 126 var protoReq ApplicationSetGenerateRequest 127 var metadata runtime.ServerMetadata 128 129 newReader, berr := utilities.IOReaderFactory(req.Body) 130 if berr != nil { 131 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) 132 } 133 if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { 134 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 135 } 136 137 msg, err := server.Generate(ctx, &protoReq) 138 return msg, metadata, err 139 140 } 141 142 var ( 143 filter_ApplicationSetService_List_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} 144 ) 145 146 func request_ApplicationSetService_List_0(ctx context.Context, marshaler runtime.Marshaler, client ApplicationSetServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 147 var protoReq ApplicationSetListQuery 148 var metadata runtime.ServerMetadata 149 150 if err := req.ParseForm(); err != nil { 151 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 152 } 153 if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ApplicationSetService_List_0); err != nil { 154 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 155 } 156 157 msg, err := client.List(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 158 return msg, metadata, err 159 160 } 161 162 func local_request_ApplicationSetService_List_0(ctx context.Context, marshaler runtime.Marshaler, server ApplicationSetServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 163 var protoReq ApplicationSetListQuery 164 var metadata runtime.ServerMetadata 165 166 if err := req.ParseForm(); err != nil { 167 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 168 } 169 if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ApplicationSetService_List_0); err != nil { 170 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 171 } 172 173 msg, err := server.List(ctx, &protoReq) 174 return msg, metadata, err 175 176 } 177 178 var ( 179 filter_ApplicationSetService_Create_0 = &utilities.DoubleArray{Encoding: map[string]int{"applicationset": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} 180 ) 181 182 func request_ApplicationSetService_Create_0(ctx context.Context, marshaler runtime.Marshaler, client ApplicationSetServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 183 var protoReq ApplicationSetCreateRequest 184 var metadata runtime.ServerMetadata 185 186 newReader, berr := utilities.IOReaderFactory(req.Body) 187 if berr != nil { 188 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) 189 } 190 if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Applicationset); err != nil && err != io.EOF { 191 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 192 } 193 194 if err := req.ParseForm(); err != nil { 195 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 196 } 197 if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ApplicationSetService_Create_0); err != nil { 198 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 199 } 200 201 msg, err := client.Create(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 202 return msg, metadata, err 203 204 } 205 206 func local_request_ApplicationSetService_Create_0(ctx context.Context, marshaler runtime.Marshaler, server ApplicationSetServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 207 var protoReq ApplicationSetCreateRequest 208 var metadata runtime.ServerMetadata 209 210 newReader, berr := utilities.IOReaderFactory(req.Body) 211 if berr != nil { 212 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) 213 } 214 if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Applicationset); err != nil && err != io.EOF { 215 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 216 } 217 218 if err := req.ParseForm(); err != nil { 219 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 220 } 221 if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ApplicationSetService_Create_0); err != nil { 222 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 223 } 224 225 msg, err := server.Create(ctx, &protoReq) 226 return msg, metadata, err 227 228 } 229 230 var ( 231 filter_ApplicationSetService_Delete_0 = &utilities.DoubleArray{Encoding: map[string]int{"name": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} 232 ) 233 234 func request_ApplicationSetService_Delete_0(ctx context.Context, marshaler runtime.Marshaler, client ApplicationSetServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 235 var protoReq ApplicationSetDeleteRequest 236 var metadata runtime.ServerMetadata 237 238 var ( 239 val string 240 ok bool 241 err error 242 _ = err 243 ) 244 245 val, ok = pathParams["name"] 246 if !ok { 247 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") 248 } 249 250 protoReq.Name, err = runtime.String(val) 251 252 if err != nil { 253 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) 254 } 255 256 if err := req.ParseForm(); err != nil { 257 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 258 } 259 if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ApplicationSetService_Delete_0); err != nil { 260 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 261 } 262 263 msg, err := client.Delete(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 264 return msg, metadata, err 265 266 } 267 268 func local_request_ApplicationSetService_Delete_0(ctx context.Context, marshaler runtime.Marshaler, server ApplicationSetServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 269 var protoReq ApplicationSetDeleteRequest 270 var metadata runtime.ServerMetadata 271 272 var ( 273 val string 274 ok bool 275 err error 276 _ = err 277 ) 278 279 val, ok = pathParams["name"] 280 if !ok { 281 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") 282 } 283 284 protoReq.Name, err = runtime.String(val) 285 286 if err != nil { 287 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) 288 } 289 290 if err := req.ParseForm(); err != nil { 291 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 292 } 293 if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ApplicationSetService_Delete_0); err != nil { 294 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 295 } 296 297 msg, err := server.Delete(ctx, &protoReq) 298 return msg, metadata, err 299 300 } 301 302 var ( 303 filter_ApplicationSetService_ResourceTree_0 = &utilities.DoubleArray{Encoding: map[string]int{"name": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} 304 ) 305 306 func request_ApplicationSetService_ResourceTree_0(ctx context.Context, marshaler runtime.Marshaler, client ApplicationSetServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 307 var protoReq ApplicationSetTreeQuery 308 var metadata runtime.ServerMetadata 309 310 var ( 311 val string 312 ok bool 313 err error 314 _ = err 315 ) 316 317 val, ok = pathParams["name"] 318 if !ok { 319 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") 320 } 321 322 protoReq.Name, err = runtime.String(val) 323 324 if err != nil { 325 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) 326 } 327 328 if err := req.ParseForm(); err != nil { 329 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 330 } 331 if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ApplicationSetService_ResourceTree_0); err != nil { 332 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 333 } 334 335 msg, err := client.ResourceTree(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 336 return msg, metadata, err 337 338 } 339 340 func local_request_ApplicationSetService_ResourceTree_0(ctx context.Context, marshaler runtime.Marshaler, server ApplicationSetServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 341 var protoReq ApplicationSetTreeQuery 342 var metadata runtime.ServerMetadata 343 344 var ( 345 val string 346 ok bool 347 err error 348 _ = err 349 ) 350 351 val, ok = pathParams["name"] 352 if !ok { 353 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") 354 } 355 356 protoReq.Name, err = runtime.String(val) 357 358 if err != nil { 359 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) 360 } 361 362 if err := req.ParseForm(); err != nil { 363 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 364 } 365 if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ApplicationSetService_ResourceTree_0); err != nil { 366 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 367 } 368 369 msg, err := server.ResourceTree(ctx, &protoReq) 370 return msg, metadata, err 371 372 } 373 374 // RegisterApplicationSetServiceHandlerServer registers the http handlers for service ApplicationSetService to "mux". 375 // UnaryRPC :call ApplicationSetServiceServer directly. 376 // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. 377 // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterApplicationSetServiceHandlerFromEndpoint instead. 378 func RegisterApplicationSetServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ApplicationSetServiceServer) error { 379 380 mux.Handle("GET", pattern_ApplicationSetService_Get_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 381 ctx, cancel := context.WithCancel(req.Context()) 382 defer cancel() 383 var stream runtime.ServerTransportStream 384 ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) 385 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 386 rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) 387 if err != nil { 388 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 389 return 390 } 391 resp, md, err := local_request_ApplicationSetService_Get_0(rctx, inboundMarshaler, server, req, pathParams) 392 md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) 393 ctx = runtime.NewServerMetadataContext(ctx, md) 394 if err != nil { 395 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 396 return 397 } 398 399 forward_ApplicationSetService_Get_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 400 401 }) 402 403 mux.Handle("POST", pattern_ApplicationSetService_Generate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 404 ctx, cancel := context.WithCancel(req.Context()) 405 defer cancel() 406 var stream runtime.ServerTransportStream 407 ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) 408 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 409 rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) 410 if err != nil { 411 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 412 return 413 } 414 resp, md, err := local_request_ApplicationSetService_Generate_0(rctx, inboundMarshaler, server, req, pathParams) 415 md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) 416 ctx = runtime.NewServerMetadataContext(ctx, md) 417 if err != nil { 418 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 419 return 420 } 421 422 forward_ApplicationSetService_Generate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 423 424 }) 425 426 mux.Handle("GET", pattern_ApplicationSetService_List_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 427 ctx, cancel := context.WithCancel(req.Context()) 428 defer cancel() 429 var stream runtime.ServerTransportStream 430 ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) 431 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 432 rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) 433 if err != nil { 434 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 435 return 436 } 437 resp, md, err := local_request_ApplicationSetService_List_0(rctx, inboundMarshaler, server, req, pathParams) 438 md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) 439 ctx = runtime.NewServerMetadataContext(ctx, md) 440 if err != nil { 441 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 442 return 443 } 444 445 forward_ApplicationSetService_List_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 446 447 }) 448 449 mux.Handle("POST", pattern_ApplicationSetService_Create_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 450 ctx, cancel := context.WithCancel(req.Context()) 451 defer cancel() 452 var stream runtime.ServerTransportStream 453 ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) 454 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 455 rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) 456 if err != nil { 457 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 458 return 459 } 460 resp, md, err := local_request_ApplicationSetService_Create_0(rctx, inboundMarshaler, server, req, pathParams) 461 md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) 462 ctx = runtime.NewServerMetadataContext(ctx, md) 463 if err != nil { 464 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 465 return 466 } 467 468 forward_ApplicationSetService_Create_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 469 470 }) 471 472 mux.Handle("DELETE", pattern_ApplicationSetService_Delete_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 473 ctx, cancel := context.WithCancel(req.Context()) 474 defer cancel() 475 var stream runtime.ServerTransportStream 476 ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) 477 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 478 rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) 479 if err != nil { 480 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 481 return 482 } 483 resp, md, err := local_request_ApplicationSetService_Delete_0(rctx, inboundMarshaler, server, req, pathParams) 484 md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) 485 ctx = runtime.NewServerMetadataContext(ctx, md) 486 if err != nil { 487 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 488 return 489 } 490 491 forward_ApplicationSetService_Delete_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 492 493 }) 494 495 mux.Handle("GET", pattern_ApplicationSetService_ResourceTree_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 496 ctx, cancel := context.WithCancel(req.Context()) 497 defer cancel() 498 var stream runtime.ServerTransportStream 499 ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) 500 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 501 rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) 502 if err != nil { 503 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 504 return 505 } 506 resp, md, err := local_request_ApplicationSetService_ResourceTree_0(rctx, inboundMarshaler, server, req, pathParams) 507 md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) 508 ctx = runtime.NewServerMetadataContext(ctx, md) 509 if err != nil { 510 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 511 return 512 } 513 514 forward_ApplicationSetService_ResourceTree_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 515 516 }) 517 518 return nil 519 } 520 521 // RegisterApplicationSetServiceHandlerFromEndpoint is same as RegisterApplicationSetServiceHandler but 522 // automatically dials to "endpoint" and closes the connection when "ctx" gets done. 523 func RegisterApplicationSetServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { 524 conn, err := grpc.Dial(endpoint, opts...) 525 if err != nil { 526 return err 527 } 528 defer func() { 529 if err != nil { 530 if cerr := conn.Close(); cerr != nil { 531 grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) 532 } 533 return 534 } 535 go func() { 536 <-ctx.Done() 537 if cerr := conn.Close(); cerr != nil { 538 grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) 539 } 540 }() 541 }() 542 543 return RegisterApplicationSetServiceHandler(ctx, mux, conn) 544 } 545 546 // RegisterApplicationSetServiceHandler registers the http handlers for service ApplicationSetService to "mux". 547 // The handlers forward requests to the grpc endpoint over "conn". 548 func RegisterApplicationSetServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { 549 return RegisterApplicationSetServiceHandlerClient(ctx, mux, NewApplicationSetServiceClient(conn)) 550 } 551 552 // RegisterApplicationSetServiceHandlerClient registers the http handlers for service ApplicationSetService 553 // to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ApplicationSetServiceClient". 554 // Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ApplicationSetServiceClient" 555 // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in 556 // "ApplicationSetServiceClient" to call the correct interceptors. 557 func RegisterApplicationSetServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ApplicationSetServiceClient) error { 558 559 mux.Handle("GET", pattern_ApplicationSetService_Get_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 560 ctx, cancel := context.WithCancel(req.Context()) 561 defer cancel() 562 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 563 rctx, err := runtime.AnnotateContext(ctx, mux, req) 564 if err != nil { 565 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 566 return 567 } 568 resp, md, err := request_ApplicationSetService_Get_0(rctx, inboundMarshaler, client, req, pathParams) 569 ctx = runtime.NewServerMetadataContext(ctx, md) 570 if err != nil { 571 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 572 return 573 } 574 575 forward_ApplicationSetService_Get_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 576 577 }) 578 579 mux.Handle("POST", pattern_ApplicationSetService_Generate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 580 ctx, cancel := context.WithCancel(req.Context()) 581 defer cancel() 582 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 583 rctx, err := runtime.AnnotateContext(ctx, mux, req) 584 if err != nil { 585 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 586 return 587 } 588 resp, md, err := request_ApplicationSetService_Generate_0(rctx, inboundMarshaler, client, req, pathParams) 589 ctx = runtime.NewServerMetadataContext(ctx, md) 590 if err != nil { 591 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 592 return 593 } 594 595 forward_ApplicationSetService_Generate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 596 597 }) 598 599 mux.Handle("GET", pattern_ApplicationSetService_List_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 600 ctx, cancel := context.WithCancel(req.Context()) 601 defer cancel() 602 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 603 rctx, err := runtime.AnnotateContext(ctx, mux, req) 604 if err != nil { 605 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 606 return 607 } 608 resp, md, err := request_ApplicationSetService_List_0(rctx, inboundMarshaler, client, req, pathParams) 609 ctx = runtime.NewServerMetadataContext(ctx, md) 610 if err != nil { 611 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 612 return 613 } 614 615 forward_ApplicationSetService_List_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 616 617 }) 618 619 mux.Handle("POST", pattern_ApplicationSetService_Create_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 620 ctx, cancel := context.WithCancel(req.Context()) 621 defer cancel() 622 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 623 rctx, err := runtime.AnnotateContext(ctx, mux, req) 624 if err != nil { 625 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 626 return 627 } 628 resp, md, err := request_ApplicationSetService_Create_0(rctx, inboundMarshaler, client, req, pathParams) 629 ctx = runtime.NewServerMetadataContext(ctx, md) 630 if err != nil { 631 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 632 return 633 } 634 635 forward_ApplicationSetService_Create_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 636 637 }) 638 639 mux.Handle("DELETE", pattern_ApplicationSetService_Delete_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 640 ctx, cancel := context.WithCancel(req.Context()) 641 defer cancel() 642 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 643 rctx, err := runtime.AnnotateContext(ctx, mux, req) 644 if err != nil { 645 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 646 return 647 } 648 resp, md, err := request_ApplicationSetService_Delete_0(rctx, inboundMarshaler, client, req, pathParams) 649 ctx = runtime.NewServerMetadataContext(ctx, md) 650 if err != nil { 651 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 652 return 653 } 654 655 forward_ApplicationSetService_Delete_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 656 657 }) 658 659 mux.Handle("GET", pattern_ApplicationSetService_ResourceTree_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 660 ctx, cancel := context.WithCancel(req.Context()) 661 defer cancel() 662 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 663 rctx, err := runtime.AnnotateContext(ctx, mux, req) 664 if err != nil { 665 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 666 return 667 } 668 resp, md, err := request_ApplicationSetService_ResourceTree_0(rctx, inboundMarshaler, client, req, pathParams) 669 ctx = runtime.NewServerMetadataContext(ctx, md) 670 if err != nil { 671 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 672 return 673 } 674 675 forward_ApplicationSetService_ResourceTree_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 676 677 }) 678 679 return nil 680 } 681 682 var ( 683 pattern_ApplicationSetService_Get_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v1", "applicationsets", "name"}, "", runtime.AssumeColonVerbOpt(true))) 684 685 pattern_ApplicationSetService_Generate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "applicationsets", "generate"}, "", runtime.AssumeColonVerbOpt(true))) 686 687 pattern_ApplicationSetService_List_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "applicationsets"}, "", runtime.AssumeColonVerbOpt(true))) 688 689 pattern_ApplicationSetService_Create_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "applicationsets"}, "", runtime.AssumeColonVerbOpt(true))) 690 691 pattern_ApplicationSetService_Delete_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v1", "applicationsets", "name"}, "", runtime.AssumeColonVerbOpt(true))) 692 693 pattern_ApplicationSetService_ResourceTree_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v1", "applicationsets", "name", "resource-tree"}, "", runtime.AssumeColonVerbOpt(true))) 694 ) 695 696 var ( 697 forward_ApplicationSetService_Get_0 = runtime.ForwardResponseMessage 698 699 forward_ApplicationSetService_Generate_0 = runtime.ForwardResponseMessage 700 701 forward_ApplicationSetService_List_0 = runtime.ForwardResponseMessage 702 703 forward_ApplicationSetService_Create_0 = runtime.ForwardResponseMessage 704 705 forward_ApplicationSetService_Delete_0 = runtime.ForwardResponseMessage 706 707 forward_ApplicationSetService_ResourceTree_0 = runtime.ForwardResponseMessage 708 )