github.com/pingcap/tiflow@v0.0.0-20240520035814-5bf52d54e205/engine/enginepb/master.pb.gw.go (about) 1 // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. 2 // source: engine/proto/master.proto 3 4 /* 5 Package enginepb is a reverse proxy. 6 7 It translates gRPC into RESTful JSON APIs. 8 */ 9 package enginepb 10 11 import ( 12 "context" 13 "io" 14 "net/http" 15 16 "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" 17 "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" 18 "google.golang.org/grpc" 19 "google.golang.org/grpc/codes" 20 "google.golang.org/grpc/grpclog" 21 "google.golang.org/grpc/metadata" 22 "google.golang.org/grpc/status" 23 "google.golang.org/protobuf/proto" 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 _ = metadata.Join 33 34 func request_Discovery_RegisterExecutor_0(ctx context.Context, marshaler runtime.Marshaler, client DiscoveryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 35 var protoReq RegisterExecutorRequest 36 var metadata runtime.ServerMetadata 37 38 newReader, berr := utilities.IOReaderFactory(req.Body) 39 if berr != nil { 40 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) 41 } 42 if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Executor); err != nil && err != io.EOF { 43 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 44 } 45 46 msg, err := client.RegisterExecutor(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 47 return msg, metadata, err 48 49 } 50 51 func local_request_Discovery_RegisterExecutor_0(ctx context.Context, marshaler runtime.Marshaler, server DiscoveryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 52 var protoReq RegisterExecutorRequest 53 var metadata runtime.ServerMetadata 54 55 newReader, berr := utilities.IOReaderFactory(req.Body) 56 if berr != nil { 57 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) 58 } 59 if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Executor); err != nil && err != io.EOF { 60 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 61 } 62 63 msg, err := server.RegisterExecutor(ctx, &protoReq) 64 return msg, metadata, err 65 66 } 67 68 func request_Discovery_ListExecutors_0(ctx context.Context, marshaler runtime.Marshaler, client DiscoveryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 69 var protoReq ListExecutorsRequest 70 var metadata runtime.ServerMetadata 71 72 msg, err := client.ListExecutors(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 73 return msg, metadata, err 74 75 } 76 77 func local_request_Discovery_ListExecutors_0(ctx context.Context, marshaler runtime.Marshaler, server DiscoveryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 78 var protoReq ListExecutorsRequest 79 var metadata runtime.ServerMetadata 80 81 msg, err := server.ListExecutors(ctx, &protoReq) 82 return msg, metadata, err 83 84 } 85 86 func request_Discovery_ListMasters_0(ctx context.Context, marshaler runtime.Marshaler, client DiscoveryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 87 var protoReq ListMastersRequest 88 var metadata runtime.ServerMetadata 89 90 msg, err := client.ListMasters(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 91 return msg, metadata, err 92 93 } 94 95 func local_request_Discovery_ListMasters_0(ctx context.Context, marshaler runtime.Marshaler, server DiscoveryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 96 var protoReq ListMastersRequest 97 var metadata runtime.ServerMetadata 98 99 msg, err := server.ListMasters(ctx, &protoReq) 100 return msg, metadata, err 101 102 } 103 104 func request_Discovery_GetLeader_0(ctx context.Context, marshaler runtime.Marshaler, client DiscoveryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 105 var protoReq GetLeaderRequest 106 var metadata runtime.ServerMetadata 107 108 msg, err := client.GetLeader(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 109 return msg, metadata, err 110 111 } 112 113 func local_request_Discovery_GetLeader_0(ctx context.Context, marshaler runtime.Marshaler, server DiscoveryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 114 var protoReq GetLeaderRequest 115 var metadata runtime.ServerMetadata 116 117 msg, err := server.GetLeader(ctx, &protoReq) 118 return msg, metadata, err 119 120 } 121 122 func request_Discovery_ResignLeader_0(ctx context.Context, marshaler runtime.Marshaler, client DiscoveryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 123 var protoReq ResignLeaderRequest 124 var metadata runtime.ServerMetadata 125 126 msg, err := client.ResignLeader(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 127 return msg, metadata, err 128 129 } 130 131 func local_request_Discovery_ResignLeader_0(ctx context.Context, marshaler runtime.Marshaler, server DiscoveryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 132 var protoReq ResignLeaderRequest 133 var metadata runtime.ServerMetadata 134 135 msg, err := server.ResignLeader(ctx, &protoReq) 136 return msg, metadata, err 137 138 } 139 140 var ( 141 filter_JobManager_CreateJob_0 = &utilities.DoubleArray{Encoding: map[string]int{"job": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} 142 ) 143 144 func request_JobManager_CreateJob_0(ctx context.Context, marshaler runtime.Marshaler, client JobManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 145 var protoReq CreateJobRequest 146 var metadata runtime.ServerMetadata 147 148 newReader, berr := utilities.IOReaderFactory(req.Body) 149 if berr != nil { 150 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) 151 } 152 if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Job); err != nil && err != io.EOF { 153 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 154 } 155 156 if err := req.ParseForm(); err != nil { 157 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 158 } 159 if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_JobManager_CreateJob_0); err != nil { 160 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 161 } 162 163 msg, err := client.CreateJob(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 164 return msg, metadata, err 165 166 } 167 168 func local_request_JobManager_CreateJob_0(ctx context.Context, marshaler runtime.Marshaler, server JobManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 169 var protoReq CreateJobRequest 170 var metadata runtime.ServerMetadata 171 172 newReader, berr := utilities.IOReaderFactory(req.Body) 173 if berr != nil { 174 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) 175 } 176 if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Job); err != nil && err != io.EOF { 177 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 178 } 179 180 if err := req.ParseForm(); err != nil { 181 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 182 } 183 if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_JobManager_CreateJob_0); err != nil { 184 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 185 } 186 187 msg, err := server.CreateJob(ctx, &protoReq) 188 return msg, metadata, err 189 190 } 191 192 var ( 193 filter_JobManager_GetJob_0 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} 194 ) 195 196 func request_JobManager_GetJob_0(ctx context.Context, marshaler runtime.Marshaler, client JobManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 197 var protoReq GetJobRequest 198 var metadata runtime.ServerMetadata 199 200 var ( 201 val string 202 ok bool 203 err error 204 _ = err 205 ) 206 207 val, ok = pathParams["id"] 208 if !ok { 209 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") 210 } 211 212 protoReq.Id, err = runtime.String(val) 213 if err != nil { 214 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) 215 } 216 217 if err := req.ParseForm(); err != nil { 218 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 219 } 220 if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_JobManager_GetJob_0); err != nil { 221 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 222 } 223 224 msg, err := client.GetJob(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 225 return msg, metadata, err 226 227 } 228 229 func local_request_JobManager_GetJob_0(ctx context.Context, marshaler runtime.Marshaler, server JobManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 230 var protoReq GetJobRequest 231 var metadata runtime.ServerMetadata 232 233 var ( 234 val string 235 ok bool 236 err error 237 _ = err 238 ) 239 240 val, ok = pathParams["id"] 241 if !ok { 242 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") 243 } 244 245 protoReq.Id, err = runtime.String(val) 246 if err != nil { 247 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) 248 } 249 250 if err := req.ParseForm(); err != nil { 251 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 252 } 253 if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_JobManager_GetJob_0); err != nil { 254 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 255 } 256 257 msg, err := server.GetJob(ctx, &protoReq) 258 return msg, metadata, err 259 260 } 261 262 var ( 263 filter_JobManager_ListJobs_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} 264 ) 265 266 func request_JobManager_ListJobs_0(ctx context.Context, marshaler runtime.Marshaler, client JobManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 267 var protoReq ListJobsRequest 268 var metadata runtime.ServerMetadata 269 270 if err := req.ParseForm(); err != nil { 271 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 272 } 273 if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_JobManager_ListJobs_0); err != nil { 274 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 275 } 276 277 msg, err := client.ListJobs(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 278 return msg, metadata, err 279 280 } 281 282 func local_request_JobManager_ListJobs_0(ctx context.Context, marshaler runtime.Marshaler, server JobManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 283 var protoReq ListJobsRequest 284 var metadata runtime.ServerMetadata 285 286 if err := req.ParseForm(); err != nil { 287 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 288 } 289 if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_JobManager_ListJobs_0); err != nil { 290 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 291 } 292 293 msg, err := server.ListJobs(ctx, &protoReq) 294 return msg, metadata, err 295 296 } 297 298 var ( 299 filter_JobManager_CancelJob_0 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} 300 ) 301 302 func request_JobManager_CancelJob_0(ctx context.Context, marshaler runtime.Marshaler, client JobManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 303 var protoReq CancelJobRequest 304 var metadata runtime.ServerMetadata 305 306 var ( 307 val string 308 ok bool 309 err error 310 _ = err 311 ) 312 313 val, ok = pathParams["id"] 314 if !ok { 315 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") 316 } 317 318 protoReq.Id, err = runtime.String(val) 319 if err != nil { 320 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) 321 } 322 323 if err := req.ParseForm(); err != nil { 324 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 325 } 326 if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_JobManager_CancelJob_0); err != nil { 327 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 328 } 329 330 msg, err := client.CancelJob(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 331 return msg, metadata, err 332 333 } 334 335 func local_request_JobManager_CancelJob_0(ctx context.Context, marshaler runtime.Marshaler, server JobManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 336 var protoReq CancelJobRequest 337 var metadata runtime.ServerMetadata 338 339 var ( 340 val string 341 ok bool 342 err error 343 _ = err 344 ) 345 346 val, ok = pathParams["id"] 347 if !ok { 348 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") 349 } 350 351 protoReq.Id, err = runtime.String(val) 352 if err != nil { 353 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) 354 } 355 356 if err := req.ParseForm(); err != nil { 357 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 358 } 359 if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_JobManager_CancelJob_0); err != nil { 360 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 361 } 362 363 msg, err := server.CancelJob(ctx, &protoReq) 364 return msg, metadata, err 365 366 } 367 368 var ( 369 filter_JobManager_DeleteJob_0 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} 370 ) 371 372 func request_JobManager_DeleteJob_0(ctx context.Context, marshaler runtime.Marshaler, client JobManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 373 var protoReq DeleteJobRequest 374 var metadata runtime.ServerMetadata 375 376 var ( 377 val string 378 ok bool 379 err error 380 _ = err 381 ) 382 383 val, ok = pathParams["id"] 384 if !ok { 385 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") 386 } 387 388 protoReq.Id, err = runtime.String(val) 389 if err != nil { 390 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) 391 } 392 393 if err := req.ParseForm(); err != nil { 394 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 395 } 396 if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_JobManager_DeleteJob_0); err != nil { 397 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 398 } 399 400 msg, err := client.DeleteJob(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 401 return msg, metadata, err 402 403 } 404 405 func local_request_JobManager_DeleteJob_0(ctx context.Context, marshaler runtime.Marshaler, server JobManagerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 406 var protoReq DeleteJobRequest 407 var metadata runtime.ServerMetadata 408 409 var ( 410 val string 411 ok bool 412 err error 413 _ = err 414 ) 415 416 val, ok = pathParams["id"] 417 if !ok { 418 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") 419 } 420 421 protoReq.Id, err = runtime.String(val) 422 if err != nil { 423 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) 424 } 425 426 if err := req.ParseForm(); err != nil { 427 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 428 } 429 if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_JobManager_DeleteJob_0); err != nil { 430 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 431 } 432 433 msg, err := server.DeleteJob(ctx, &protoReq) 434 return msg, metadata, err 435 436 } 437 438 // RegisterDiscoveryHandlerServer registers the http handlers for service Discovery to "mux". 439 // UnaryRPC :call DiscoveryServer directly. 440 // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. 441 // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterDiscoveryHandlerFromEndpoint instead. 442 func RegisterDiscoveryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server DiscoveryServer) error { 443 444 mux.Handle("POST", pattern_Discovery_RegisterExecutor_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 445 ctx, cancel := context.WithCancel(req.Context()) 446 defer cancel() 447 var stream runtime.ServerTransportStream 448 ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) 449 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 450 var err error 451 ctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/enginepb.Discovery/RegisterExecutor", runtime.WithHTTPPathPattern("/api/v1/executors/register")) 452 if err != nil { 453 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 454 return 455 } 456 resp, md, err := local_request_Discovery_RegisterExecutor_0(ctx, inboundMarshaler, server, req, pathParams) 457 md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) 458 ctx = runtime.NewServerMetadataContext(ctx, md) 459 if err != nil { 460 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 461 return 462 } 463 464 forward_Discovery_RegisterExecutor_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 465 466 }) 467 468 mux.Handle("GET", pattern_Discovery_ListExecutors_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 469 ctx, cancel := context.WithCancel(req.Context()) 470 defer cancel() 471 var stream runtime.ServerTransportStream 472 ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) 473 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 474 var err error 475 ctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/enginepb.Discovery/ListExecutors", runtime.WithHTTPPathPattern("/api/v1/executors")) 476 if err != nil { 477 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 478 return 479 } 480 resp, md, err := local_request_Discovery_ListExecutors_0(ctx, inboundMarshaler, server, req, pathParams) 481 md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) 482 ctx = runtime.NewServerMetadataContext(ctx, md) 483 if err != nil { 484 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 485 return 486 } 487 488 forward_Discovery_ListExecutors_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 489 490 }) 491 492 mux.Handle("GET", pattern_Discovery_ListMasters_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 493 ctx, cancel := context.WithCancel(req.Context()) 494 defer cancel() 495 var stream runtime.ServerTransportStream 496 ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) 497 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 498 var err error 499 ctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/enginepb.Discovery/ListMasters", runtime.WithHTTPPathPattern("/api/v1/masters")) 500 if err != nil { 501 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 502 return 503 } 504 resp, md, err := local_request_Discovery_ListMasters_0(ctx, inboundMarshaler, server, req, pathParams) 505 md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) 506 ctx = runtime.NewServerMetadataContext(ctx, md) 507 if err != nil { 508 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 509 return 510 } 511 512 forward_Discovery_ListMasters_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 513 514 }) 515 516 mux.Handle("GET", pattern_Discovery_GetLeader_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 517 ctx, cancel := context.WithCancel(req.Context()) 518 defer cancel() 519 var stream runtime.ServerTransportStream 520 ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) 521 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 522 var err error 523 ctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/enginepb.Discovery/GetLeader", runtime.WithHTTPPathPattern("/api/v1/leader")) 524 if err != nil { 525 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 526 return 527 } 528 resp, md, err := local_request_Discovery_GetLeader_0(ctx, inboundMarshaler, server, req, pathParams) 529 md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) 530 ctx = runtime.NewServerMetadataContext(ctx, md) 531 if err != nil { 532 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 533 return 534 } 535 536 forward_Discovery_GetLeader_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 537 538 }) 539 540 mux.Handle("POST", pattern_Discovery_ResignLeader_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 541 ctx, cancel := context.WithCancel(req.Context()) 542 defer cancel() 543 var stream runtime.ServerTransportStream 544 ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) 545 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 546 var err error 547 ctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/enginepb.Discovery/ResignLeader", runtime.WithHTTPPathPattern("/api/v1/leader/resign")) 548 if err != nil { 549 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 550 return 551 } 552 resp, md, err := local_request_Discovery_ResignLeader_0(ctx, inboundMarshaler, server, req, pathParams) 553 md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) 554 ctx = runtime.NewServerMetadataContext(ctx, md) 555 if err != nil { 556 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 557 return 558 } 559 560 forward_Discovery_ResignLeader_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 561 562 }) 563 564 return nil 565 } 566 567 // RegisterJobManagerHandlerServer registers the http handlers for service JobManager to "mux". 568 // UnaryRPC :call JobManagerServer directly. 569 // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. 570 // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterJobManagerHandlerFromEndpoint instead. 571 func RegisterJobManagerHandlerServer(ctx context.Context, mux *runtime.ServeMux, server JobManagerServer) error { 572 573 mux.Handle("POST", pattern_JobManager_CreateJob_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 574 ctx, cancel := context.WithCancel(req.Context()) 575 defer cancel() 576 var stream runtime.ServerTransportStream 577 ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) 578 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 579 var err error 580 ctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/enginepb.JobManager/CreateJob", runtime.WithHTTPPathPattern("/api/v1/jobs")) 581 if err != nil { 582 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 583 return 584 } 585 resp, md, err := local_request_JobManager_CreateJob_0(ctx, inboundMarshaler, server, req, pathParams) 586 md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) 587 ctx = runtime.NewServerMetadataContext(ctx, md) 588 if err != nil { 589 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 590 return 591 } 592 593 forward_JobManager_CreateJob_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 594 595 }) 596 597 mux.Handle("GET", pattern_JobManager_GetJob_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 598 ctx, cancel := context.WithCancel(req.Context()) 599 defer cancel() 600 var stream runtime.ServerTransportStream 601 ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) 602 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 603 var err error 604 ctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/enginepb.JobManager/GetJob", runtime.WithHTTPPathPattern("/api/v1/jobs/{id=*}")) 605 if err != nil { 606 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 607 return 608 } 609 resp, md, err := local_request_JobManager_GetJob_0(ctx, inboundMarshaler, server, req, pathParams) 610 md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) 611 ctx = runtime.NewServerMetadataContext(ctx, md) 612 if err != nil { 613 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 614 return 615 } 616 617 forward_JobManager_GetJob_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 618 619 }) 620 621 mux.Handle("GET", pattern_JobManager_ListJobs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 622 ctx, cancel := context.WithCancel(req.Context()) 623 defer cancel() 624 var stream runtime.ServerTransportStream 625 ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) 626 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 627 var err error 628 ctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/enginepb.JobManager/ListJobs", runtime.WithHTTPPathPattern("/api/v1/jobs")) 629 if err != nil { 630 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 631 return 632 } 633 resp, md, err := local_request_JobManager_ListJobs_0(ctx, inboundMarshaler, server, req, pathParams) 634 md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) 635 ctx = runtime.NewServerMetadataContext(ctx, md) 636 if err != nil { 637 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 638 return 639 } 640 641 forward_JobManager_ListJobs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 642 643 }) 644 645 mux.Handle("POST", pattern_JobManager_CancelJob_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 646 ctx, cancel := context.WithCancel(req.Context()) 647 defer cancel() 648 var stream runtime.ServerTransportStream 649 ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) 650 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 651 var err error 652 ctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/enginepb.JobManager/CancelJob", runtime.WithHTTPPathPattern("/api/v1/jobs/{id=*}/cancel")) 653 if err != nil { 654 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 655 return 656 } 657 resp, md, err := local_request_JobManager_CancelJob_0(ctx, inboundMarshaler, server, req, pathParams) 658 md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) 659 ctx = runtime.NewServerMetadataContext(ctx, md) 660 if err != nil { 661 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 662 return 663 } 664 665 forward_JobManager_CancelJob_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 666 667 }) 668 669 mux.Handle("DELETE", pattern_JobManager_DeleteJob_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 670 ctx, cancel := context.WithCancel(req.Context()) 671 defer cancel() 672 var stream runtime.ServerTransportStream 673 ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) 674 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 675 var err error 676 ctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/enginepb.JobManager/DeleteJob", runtime.WithHTTPPathPattern("/api/v1/jobs/{id=*}")) 677 if err != nil { 678 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 679 return 680 } 681 resp, md, err := local_request_JobManager_DeleteJob_0(ctx, inboundMarshaler, server, req, pathParams) 682 md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) 683 ctx = runtime.NewServerMetadataContext(ctx, md) 684 if err != nil { 685 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 686 return 687 } 688 689 forward_JobManager_DeleteJob_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 690 691 }) 692 693 return nil 694 } 695 696 // RegisterDiscoveryHandlerFromEndpoint is same as RegisterDiscoveryHandler but 697 // automatically dials to "endpoint" and closes the connection when "ctx" gets done. 698 func RegisterDiscoveryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { 699 conn, err := grpc.Dial(endpoint, opts...) 700 if err != nil { 701 return err 702 } 703 defer func() { 704 if err != nil { 705 if cerr := conn.Close(); cerr != nil { 706 grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) 707 } 708 return 709 } 710 go func() { 711 <-ctx.Done() 712 if cerr := conn.Close(); cerr != nil { 713 grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) 714 } 715 }() 716 }() 717 718 return RegisterDiscoveryHandler(ctx, mux, conn) 719 } 720 721 // RegisterDiscoveryHandler registers the http handlers for service Discovery to "mux". 722 // The handlers forward requests to the grpc endpoint over "conn". 723 func RegisterDiscoveryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { 724 return RegisterDiscoveryHandlerClient(ctx, mux, NewDiscoveryClient(conn)) 725 } 726 727 // RegisterDiscoveryHandlerClient registers the http handlers for service Discovery 728 // to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "DiscoveryClient". 729 // Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "DiscoveryClient" 730 // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in 731 // "DiscoveryClient" to call the correct interceptors. 732 func RegisterDiscoveryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client DiscoveryClient) error { 733 734 mux.Handle("POST", pattern_Discovery_RegisterExecutor_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 735 ctx, cancel := context.WithCancel(req.Context()) 736 defer cancel() 737 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 738 var err error 739 ctx, err = runtime.AnnotateContext(ctx, mux, req, "/enginepb.Discovery/RegisterExecutor", runtime.WithHTTPPathPattern("/api/v1/executors/register")) 740 if err != nil { 741 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 742 return 743 } 744 resp, md, err := request_Discovery_RegisterExecutor_0(ctx, inboundMarshaler, client, req, pathParams) 745 ctx = runtime.NewServerMetadataContext(ctx, md) 746 if err != nil { 747 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 748 return 749 } 750 751 forward_Discovery_RegisterExecutor_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 752 753 }) 754 755 mux.Handle("GET", pattern_Discovery_ListExecutors_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 756 ctx, cancel := context.WithCancel(req.Context()) 757 defer cancel() 758 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 759 var err error 760 ctx, err = runtime.AnnotateContext(ctx, mux, req, "/enginepb.Discovery/ListExecutors", runtime.WithHTTPPathPattern("/api/v1/executors")) 761 if err != nil { 762 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 763 return 764 } 765 resp, md, err := request_Discovery_ListExecutors_0(ctx, inboundMarshaler, client, req, pathParams) 766 ctx = runtime.NewServerMetadataContext(ctx, md) 767 if err != nil { 768 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 769 return 770 } 771 772 forward_Discovery_ListExecutors_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 773 774 }) 775 776 mux.Handle("GET", pattern_Discovery_ListMasters_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 777 ctx, cancel := context.WithCancel(req.Context()) 778 defer cancel() 779 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 780 var err error 781 ctx, err = runtime.AnnotateContext(ctx, mux, req, "/enginepb.Discovery/ListMasters", runtime.WithHTTPPathPattern("/api/v1/masters")) 782 if err != nil { 783 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 784 return 785 } 786 resp, md, err := request_Discovery_ListMasters_0(ctx, inboundMarshaler, client, req, pathParams) 787 ctx = runtime.NewServerMetadataContext(ctx, md) 788 if err != nil { 789 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 790 return 791 } 792 793 forward_Discovery_ListMasters_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 794 795 }) 796 797 mux.Handle("GET", pattern_Discovery_GetLeader_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 798 ctx, cancel := context.WithCancel(req.Context()) 799 defer cancel() 800 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 801 var err error 802 ctx, err = runtime.AnnotateContext(ctx, mux, req, "/enginepb.Discovery/GetLeader", runtime.WithHTTPPathPattern("/api/v1/leader")) 803 if err != nil { 804 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 805 return 806 } 807 resp, md, err := request_Discovery_GetLeader_0(ctx, 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_Discovery_GetLeader_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 815 816 }) 817 818 mux.Handle("POST", pattern_Discovery_ResignLeader_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 819 ctx, cancel := context.WithCancel(req.Context()) 820 defer cancel() 821 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 822 var err error 823 ctx, err = runtime.AnnotateContext(ctx, mux, req, "/enginepb.Discovery/ResignLeader", runtime.WithHTTPPathPattern("/api/v1/leader/resign")) 824 if err != nil { 825 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 826 return 827 } 828 resp, md, err := request_Discovery_ResignLeader_0(ctx, inboundMarshaler, client, req, pathParams) 829 ctx = runtime.NewServerMetadataContext(ctx, md) 830 if err != nil { 831 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 832 return 833 } 834 835 forward_Discovery_ResignLeader_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 836 837 }) 838 839 return nil 840 } 841 842 var ( 843 pattern_Discovery_RegisterExecutor_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "executors", "register"}, "")) 844 845 pattern_Discovery_ListExecutors_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "executors"}, "")) 846 847 pattern_Discovery_ListMasters_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "masters"}, "")) 848 849 pattern_Discovery_GetLeader_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "leader"}, "")) 850 851 pattern_Discovery_ResignLeader_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "leader", "resign"}, "")) 852 ) 853 854 var ( 855 forward_Discovery_RegisterExecutor_0 = runtime.ForwardResponseMessage 856 857 forward_Discovery_ListExecutors_0 = runtime.ForwardResponseMessage 858 859 forward_Discovery_ListMasters_0 = runtime.ForwardResponseMessage 860 861 forward_Discovery_GetLeader_0 = runtime.ForwardResponseMessage 862 863 forward_Discovery_ResignLeader_0 = runtime.ForwardResponseMessage 864 ) 865 866 // RegisterJobManagerHandlerFromEndpoint is same as RegisterJobManagerHandler but 867 // automatically dials to "endpoint" and closes the connection when "ctx" gets done. 868 func RegisterJobManagerHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { 869 conn, err := grpc.Dial(endpoint, opts...) 870 if err != nil { 871 return err 872 } 873 defer func() { 874 if err != nil { 875 if cerr := conn.Close(); cerr != nil { 876 grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) 877 } 878 return 879 } 880 go func() { 881 <-ctx.Done() 882 if cerr := conn.Close(); cerr != nil { 883 grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) 884 } 885 }() 886 }() 887 888 return RegisterJobManagerHandler(ctx, mux, conn) 889 } 890 891 // RegisterJobManagerHandler registers the http handlers for service JobManager to "mux". 892 // The handlers forward requests to the grpc endpoint over "conn". 893 func RegisterJobManagerHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { 894 return RegisterJobManagerHandlerClient(ctx, mux, NewJobManagerClient(conn)) 895 } 896 897 // RegisterJobManagerHandlerClient registers the http handlers for service JobManager 898 // to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "JobManagerClient". 899 // Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "JobManagerClient" 900 // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in 901 // "JobManagerClient" to call the correct interceptors. 902 func RegisterJobManagerHandlerClient(ctx context.Context, mux *runtime.ServeMux, client JobManagerClient) error { 903 904 mux.Handle("POST", pattern_JobManager_CreateJob_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 905 ctx, cancel := context.WithCancel(req.Context()) 906 defer cancel() 907 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 908 var err error 909 ctx, err = runtime.AnnotateContext(ctx, mux, req, "/enginepb.JobManager/CreateJob", runtime.WithHTTPPathPattern("/api/v1/jobs")) 910 if err != nil { 911 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 912 return 913 } 914 resp, md, err := request_JobManager_CreateJob_0(ctx, inboundMarshaler, client, req, pathParams) 915 ctx = runtime.NewServerMetadataContext(ctx, md) 916 if err != nil { 917 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 918 return 919 } 920 921 forward_JobManager_CreateJob_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 922 923 }) 924 925 mux.Handle("GET", pattern_JobManager_GetJob_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 926 ctx, cancel := context.WithCancel(req.Context()) 927 defer cancel() 928 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 929 var err error 930 ctx, err = runtime.AnnotateContext(ctx, mux, req, "/enginepb.JobManager/GetJob", runtime.WithHTTPPathPattern("/api/v1/jobs/{id=*}")) 931 if err != nil { 932 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 933 return 934 } 935 resp, md, err := request_JobManager_GetJob_0(ctx, inboundMarshaler, client, req, pathParams) 936 ctx = runtime.NewServerMetadataContext(ctx, md) 937 if err != nil { 938 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 939 return 940 } 941 942 forward_JobManager_GetJob_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 943 944 }) 945 946 mux.Handle("GET", pattern_JobManager_ListJobs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 947 ctx, cancel := context.WithCancel(req.Context()) 948 defer cancel() 949 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 950 var err error 951 ctx, err = runtime.AnnotateContext(ctx, mux, req, "/enginepb.JobManager/ListJobs", runtime.WithHTTPPathPattern("/api/v1/jobs")) 952 if err != nil { 953 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 954 return 955 } 956 resp, md, err := request_JobManager_ListJobs_0(ctx, inboundMarshaler, client, req, pathParams) 957 ctx = runtime.NewServerMetadataContext(ctx, md) 958 if err != nil { 959 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 960 return 961 } 962 963 forward_JobManager_ListJobs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 964 965 }) 966 967 mux.Handle("POST", pattern_JobManager_CancelJob_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 968 ctx, cancel := context.WithCancel(req.Context()) 969 defer cancel() 970 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 971 var err error 972 ctx, err = runtime.AnnotateContext(ctx, mux, req, "/enginepb.JobManager/CancelJob", runtime.WithHTTPPathPattern("/api/v1/jobs/{id=*}/cancel")) 973 if err != nil { 974 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 975 return 976 } 977 resp, md, err := request_JobManager_CancelJob_0(ctx, inboundMarshaler, client, req, pathParams) 978 ctx = runtime.NewServerMetadataContext(ctx, md) 979 if err != nil { 980 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 981 return 982 } 983 984 forward_JobManager_CancelJob_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 985 986 }) 987 988 mux.Handle("DELETE", pattern_JobManager_DeleteJob_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 989 ctx, cancel := context.WithCancel(req.Context()) 990 defer cancel() 991 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 992 var err error 993 ctx, err = runtime.AnnotateContext(ctx, mux, req, "/enginepb.JobManager/DeleteJob", runtime.WithHTTPPathPattern("/api/v1/jobs/{id=*}")) 994 if err != nil { 995 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 996 return 997 } 998 resp, md, err := request_JobManager_DeleteJob_0(ctx, inboundMarshaler, client, req, pathParams) 999 ctx = runtime.NewServerMetadataContext(ctx, md) 1000 if err != nil { 1001 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 1002 return 1003 } 1004 1005 forward_JobManager_DeleteJob_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 1006 1007 }) 1008 1009 return nil 1010 } 1011 1012 var ( 1013 pattern_JobManager_CreateJob_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "jobs"}, "")) 1014 1015 pattern_JobManager_GetJob_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v1", "jobs", "id"}, "")) 1016 1017 pattern_JobManager_ListJobs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "jobs"}, "")) 1018 1019 pattern_JobManager_CancelJob_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v1", "jobs", "id", "cancel"}, "")) 1020 1021 pattern_JobManager_DeleteJob_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v1", "jobs", "id"}, "")) 1022 ) 1023 1024 var ( 1025 forward_JobManager_CreateJob_0 = runtime.ForwardResponseMessage 1026 1027 forward_JobManager_GetJob_0 = runtime.ForwardResponseMessage 1028 1029 forward_JobManager_ListJobs_0 = runtime.ForwardResponseMessage 1030 1031 forward_JobManager_CancelJob_0 = runtime.ForwardResponseMessage 1032 1033 forward_JobManager_DeleteJob_0 = runtime.ForwardResponseMessage 1034 )