github.com/Finschia/finschia-sdk@v0.48.1/client/grpc/ocservice/query.pb.gw.go (about) 1 // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. 2 // source: lbm/base/ostracon/v1/query.proto 3 4 /* 5 Package ocservice is a reverse proxy. 6 7 It translates gRPC into RESTful JSON APIs. 8 */ 9 package ocservice 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 func request_Service_GetNodeInfo_0(ctx context.Context, marshaler runtime.Marshaler, client ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 35 var protoReq GetNodeInfoRequest 36 var metadata runtime.ServerMetadata 37 38 msg, err := client.GetNodeInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 39 return msg, metadata, err 40 41 } 42 43 func local_request_Service_GetNodeInfo_0(ctx context.Context, marshaler runtime.Marshaler, server ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 44 var protoReq GetNodeInfoRequest 45 var metadata runtime.ServerMetadata 46 47 msg, err := server.GetNodeInfo(ctx, &protoReq) 48 return msg, metadata, err 49 50 } 51 52 func request_Service_GetSyncing_0(ctx context.Context, marshaler runtime.Marshaler, client ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 53 var protoReq GetSyncingRequest 54 var metadata runtime.ServerMetadata 55 56 msg, err := client.GetSyncing(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 57 return msg, metadata, err 58 59 } 60 61 func local_request_Service_GetSyncing_0(ctx context.Context, marshaler runtime.Marshaler, server ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 62 var protoReq GetSyncingRequest 63 var metadata runtime.ServerMetadata 64 65 msg, err := server.GetSyncing(ctx, &protoReq) 66 return msg, metadata, err 67 68 } 69 70 func request_Service_GetLatestBlock_0(ctx context.Context, marshaler runtime.Marshaler, client ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 71 var protoReq GetLatestBlockRequest 72 var metadata runtime.ServerMetadata 73 74 msg, err := client.GetLatestBlock(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 75 return msg, metadata, err 76 77 } 78 79 func local_request_Service_GetLatestBlock_0(ctx context.Context, marshaler runtime.Marshaler, server ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 80 var protoReq GetLatestBlockRequest 81 var metadata runtime.ServerMetadata 82 83 msg, err := server.GetLatestBlock(ctx, &protoReq) 84 return msg, metadata, err 85 86 } 87 88 func request_Service_GetBlockByHeight_0(ctx context.Context, marshaler runtime.Marshaler, client ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 89 var protoReq GetBlockByHeightRequest 90 var metadata runtime.ServerMetadata 91 92 var ( 93 val string 94 ok bool 95 err error 96 _ = err 97 ) 98 99 val, ok = pathParams["height"] 100 if !ok { 101 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "height") 102 } 103 104 protoReq.Height, err = runtime.Int64(val) 105 106 if err != nil { 107 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "height", err) 108 } 109 110 msg, err := client.GetBlockByHeight(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 111 return msg, metadata, err 112 113 } 114 115 func local_request_Service_GetBlockByHeight_0(ctx context.Context, marshaler runtime.Marshaler, server ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 116 var protoReq GetBlockByHeightRequest 117 var metadata runtime.ServerMetadata 118 119 var ( 120 val string 121 ok bool 122 err error 123 _ = err 124 ) 125 126 val, ok = pathParams["height"] 127 if !ok { 128 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "height") 129 } 130 131 protoReq.Height, err = runtime.Int64(val) 132 133 if err != nil { 134 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "height", err) 135 } 136 137 msg, err := server.GetBlockByHeight(ctx, &protoReq) 138 return msg, metadata, err 139 140 } 141 142 func request_Service_GetBlockByHash_0(ctx context.Context, marshaler runtime.Marshaler, client ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 143 var protoReq GetBlockByHashRequest 144 var metadata runtime.ServerMetadata 145 146 var ( 147 val string 148 ok bool 149 err error 150 _ = err 151 ) 152 153 val, ok = pathParams["hash"] 154 if !ok { 155 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "hash") 156 } 157 158 protoReq.Hash, err = runtime.Bytes(val) 159 160 if err != nil { 161 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "hash", err) 162 } 163 164 msg, err := client.GetBlockByHash(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 165 return msg, metadata, err 166 167 } 168 169 func local_request_Service_GetBlockByHash_0(ctx context.Context, marshaler runtime.Marshaler, server ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 170 var protoReq GetBlockByHashRequest 171 var metadata runtime.ServerMetadata 172 173 var ( 174 val string 175 ok bool 176 err error 177 _ = err 178 ) 179 180 val, ok = pathParams["hash"] 181 if !ok { 182 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "hash") 183 } 184 185 protoReq.Hash, err = runtime.Bytes(val) 186 187 if err != nil { 188 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "hash", err) 189 } 190 191 msg, err := server.GetBlockByHash(ctx, &protoReq) 192 return msg, metadata, err 193 194 } 195 196 func request_Service_GetBlockResultsByHeight_0(ctx context.Context, marshaler runtime.Marshaler, client ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 197 var protoReq GetBlockResultsByHeightRequest 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["height"] 208 if !ok { 209 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "height") 210 } 211 212 protoReq.Height, err = runtime.Int64(val) 213 214 if err != nil { 215 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "height", err) 216 } 217 218 msg, err := client.GetBlockResultsByHeight(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 219 return msg, metadata, err 220 221 } 222 223 func local_request_Service_GetBlockResultsByHeight_0(ctx context.Context, marshaler runtime.Marshaler, server ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 224 var protoReq GetBlockResultsByHeightRequest 225 var metadata runtime.ServerMetadata 226 227 var ( 228 val string 229 ok bool 230 err error 231 _ = err 232 ) 233 234 val, ok = pathParams["height"] 235 if !ok { 236 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "height") 237 } 238 239 protoReq.Height, err = runtime.Int64(val) 240 241 if err != nil { 242 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "height", err) 243 } 244 245 msg, err := server.GetBlockResultsByHeight(ctx, &protoReq) 246 return msg, metadata, err 247 248 } 249 250 var ( 251 filter_Service_GetLatestValidatorSet_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} 252 ) 253 254 func request_Service_GetLatestValidatorSet_0(ctx context.Context, marshaler runtime.Marshaler, client ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 255 var protoReq GetLatestValidatorSetRequest 256 var metadata runtime.ServerMetadata 257 258 if err := req.ParseForm(); err != nil { 259 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 260 } 261 if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Service_GetLatestValidatorSet_0); err != nil { 262 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 263 } 264 265 msg, err := client.GetLatestValidatorSet(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 266 return msg, metadata, err 267 268 } 269 270 func local_request_Service_GetLatestValidatorSet_0(ctx context.Context, marshaler runtime.Marshaler, server ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 271 var protoReq GetLatestValidatorSetRequest 272 var metadata runtime.ServerMetadata 273 274 if err := req.ParseForm(); err != nil { 275 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 276 } 277 if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Service_GetLatestValidatorSet_0); err != nil { 278 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 279 } 280 281 msg, err := server.GetLatestValidatorSet(ctx, &protoReq) 282 return msg, metadata, err 283 284 } 285 286 var ( 287 filter_Service_GetValidatorSetByHeight_0 = &utilities.DoubleArray{Encoding: map[string]int{"height": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} 288 ) 289 290 func request_Service_GetValidatorSetByHeight_0(ctx context.Context, marshaler runtime.Marshaler, client ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 291 var protoReq GetValidatorSetByHeightRequest 292 var metadata runtime.ServerMetadata 293 294 var ( 295 val string 296 ok bool 297 err error 298 _ = err 299 ) 300 301 val, ok = pathParams["height"] 302 if !ok { 303 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "height") 304 } 305 306 protoReq.Height, err = runtime.Int64(val) 307 308 if err != nil { 309 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "height", err) 310 } 311 312 if err := req.ParseForm(); err != nil { 313 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 314 } 315 if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Service_GetValidatorSetByHeight_0); err != nil { 316 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 317 } 318 319 msg, err := client.GetValidatorSetByHeight(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 320 return msg, metadata, err 321 322 } 323 324 func local_request_Service_GetValidatorSetByHeight_0(ctx context.Context, marshaler runtime.Marshaler, server ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 325 var protoReq GetValidatorSetByHeightRequest 326 var metadata runtime.ServerMetadata 327 328 var ( 329 val string 330 ok bool 331 err error 332 _ = err 333 ) 334 335 val, ok = pathParams["height"] 336 if !ok { 337 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "height") 338 } 339 340 protoReq.Height, err = runtime.Int64(val) 341 342 if err != nil { 343 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "height", err) 344 } 345 346 if err := req.ParseForm(); err != nil { 347 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 348 } 349 if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Service_GetValidatorSetByHeight_0); err != nil { 350 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 351 } 352 353 msg, err := server.GetValidatorSetByHeight(ctx, &protoReq) 354 return msg, metadata, err 355 356 } 357 358 // RegisterServiceHandlerServer registers the http handlers for service Service to "mux". 359 // UnaryRPC :call ServiceServer directly. 360 // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. 361 // Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterServiceHandlerFromEndpoint instead. 362 func RegisterServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ServiceServer) error { 363 364 mux.Handle("GET", pattern_Service_GetNodeInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 365 ctx, cancel := context.WithCancel(req.Context()) 366 defer cancel() 367 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 368 rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) 369 if err != nil { 370 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 371 return 372 } 373 resp, md, err := local_request_Service_GetNodeInfo_0(rctx, inboundMarshaler, server, req, pathParams) 374 ctx = runtime.NewServerMetadataContext(ctx, md) 375 if err != nil { 376 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 377 return 378 } 379 380 forward_Service_GetNodeInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 381 382 }) 383 384 mux.Handle("GET", pattern_Service_GetSyncing_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 385 ctx, cancel := context.WithCancel(req.Context()) 386 defer cancel() 387 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 388 rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) 389 if err != nil { 390 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 391 return 392 } 393 resp, md, err := local_request_Service_GetSyncing_0(rctx, inboundMarshaler, server, req, pathParams) 394 ctx = runtime.NewServerMetadataContext(ctx, md) 395 if err != nil { 396 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 397 return 398 } 399 400 forward_Service_GetSyncing_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 401 402 }) 403 404 mux.Handle("GET", pattern_Service_GetLatestBlock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 405 ctx, cancel := context.WithCancel(req.Context()) 406 defer cancel() 407 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 408 rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) 409 if err != nil { 410 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 411 return 412 } 413 resp, md, err := local_request_Service_GetLatestBlock_0(rctx, inboundMarshaler, server, req, pathParams) 414 ctx = runtime.NewServerMetadataContext(ctx, md) 415 if err != nil { 416 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 417 return 418 } 419 420 forward_Service_GetLatestBlock_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 421 422 }) 423 424 mux.Handle("GET", pattern_Service_GetBlockByHeight_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 425 ctx, cancel := context.WithCancel(req.Context()) 426 defer cancel() 427 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 428 rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) 429 if err != nil { 430 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 431 return 432 } 433 resp, md, err := local_request_Service_GetBlockByHeight_0(rctx, inboundMarshaler, server, req, pathParams) 434 ctx = runtime.NewServerMetadataContext(ctx, md) 435 if err != nil { 436 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 437 return 438 } 439 440 forward_Service_GetBlockByHeight_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 441 442 }) 443 444 mux.Handle("GET", pattern_Service_GetBlockByHash_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 445 ctx, cancel := context.WithCancel(req.Context()) 446 defer cancel() 447 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 448 rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) 449 if err != nil { 450 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 451 return 452 } 453 resp, md, err := local_request_Service_GetBlockByHash_0(rctx, inboundMarshaler, server, req, pathParams) 454 ctx = runtime.NewServerMetadataContext(ctx, md) 455 if err != nil { 456 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 457 return 458 } 459 460 forward_Service_GetBlockByHash_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 461 462 }) 463 464 mux.Handle("GET", pattern_Service_GetBlockResultsByHeight_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 465 ctx, cancel := context.WithCancel(req.Context()) 466 defer cancel() 467 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 468 rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) 469 if err != nil { 470 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 471 return 472 } 473 resp, md, err := local_request_Service_GetBlockResultsByHeight_0(rctx, inboundMarshaler, server, req, pathParams) 474 ctx = runtime.NewServerMetadataContext(ctx, md) 475 if err != nil { 476 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 477 return 478 } 479 480 forward_Service_GetBlockResultsByHeight_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 481 482 }) 483 484 mux.Handle("GET", pattern_Service_GetLatestValidatorSet_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 485 ctx, cancel := context.WithCancel(req.Context()) 486 defer cancel() 487 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 488 rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) 489 if err != nil { 490 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 491 return 492 } 493 resp, md, err := local_request_Service_GetLatestValidatorSet_0(rctx, inboundMarshaler, server, req, pathParams) 494 ctx = runtime.NewServerMetadataContext(ctx, md) 495 if err != nil { 496 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 497 return 498 } 499 500 forward_Service_GetLatestValidatorSet_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 501 502 }) 503 504 mux.Handle("GET", pattern_Service_GetValidatorSetByHeight_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 505 ctx, cancel := context.WithCancel(req.Context()) 506 defer cancel() 507 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 508 rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) 509 if err != nil { 510 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 511 return 512 } 513 resp, md, err := local_request_Service_GetValidatorSetByHeight_0(rctx, inboundMarshaler, server, req, pathParams) 514 ctx = runtime.NewServerMetadataContext(ctx, md) 515 if err != nil { 516 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 517 return 518 } 519 520 forward_Service_GetValidatorSetByHeight_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 521 522 }) 523 524 return nil 525 } 526 527 // RegisterServiceHandlerFromEndpoint is same as RegisterServiceHandler but 528 // automatically dials to "endpoint" and closes the connection when "ctx" gets done. 529 func RegisterServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { 530 conn, err := grpc.Dial(endpoint, opts...) 531 if err != nil { 532 return err 533 } 534 defer func() { 535 if err != nil { 536 if cerr := conn.Close(); cerr != nil { 537 grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) 538 } 539 return 540 } 541 go func() { 542 <-ctx.Done() 543 if cerr := conn.Close(); cerr != nil { 544 grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) 545 } 546 }() 547 }() 548 549 return RegisterServiceHandler(ctx, mux, conn) 550 } 551 552 // RegisterServiceHandler registers the http handlers for service Service to "mux". 553 // The handlers forward requests to the grpc endpoint over "conn". 554 func RegisterServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { 555 return RegisterServiceHandlerClient(ctx, mux, NewServiceClient(conn)) 556 } 557 558 // RegisterServiceHandlerClient registers the http handlers for service Service 559 // to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ServiceClient". 560 // Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ServiceClient" 561 // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in 562 // "ServiceClient" to call the correct interceptors. 563 func RegisterServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ServiceClient) error { 564 565 mux.Handle("GET", pattern_Service_GetNodeInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 566 ctx, cancel := context.WithCancel(req.Context()) 567 defer cancel() 568 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 569 rctx, err := runtime.AnnotateContext(ctx, mux, req) 570 if err != nil { 571 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 572 return 573 } 574 resp, md, err := request_Service_GetNodeInfo_0(rctx, inboundMarshaler, client, req, pathParams) 575 ctx = runtime.NewServerMetadataContext(ctx, md) 576 if err != nil { 577 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 578 return 579 } 580 581 forward_Service_GetNodeInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 582 583 }) 584 585 mux.Handle("GET", pattern_Service_GetSyncing_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 586 ctx, cancel := context.WithCancel(req.Context()) 587 defer cancel() 588 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 589 rctx, err := runtime.AnnotateContext(ctx, mux, req) 590 if err != nil { 591 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 592 return 593 } 594 resp, md, err := request_Service_GetSyncing_0(rctx, inboundMarshaler, client, req, pathParams) 595 ctx = runtime.NewServerMetadataContext(ctx, md) 596 if err != nil { 597 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 598 return 599 } 600 601 forward_Service_GetSyncing_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 602 603 }) 604 605 mux.Handle("GET", pattern_Service_GetLatestBlock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 606 ctx, cancel := context.WithCancel(req.Context()) 607 defer cancel() 608 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 609 rctx, err := runtime.AnnotateContext(ctx, mux, req) 610 if err != nil { 611 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 612 return 613 } 614 resp, md, err := request_Service_GetLatestBlock_0(rctx, inboundMarshaler, client, req, pathParams) 615 ctx = runtime.NewServerMetadataContext(ctx, md) 616 if err != nil { 617 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 618 return 619 } 620 621 forward_Service_GetLatestBlock_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 622 623 }) 624 625 mux.Handle("GET", pattern_Service_GetBlockByHeight_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 626 ctx, cancel := context.WithCancel(req.Context()) 627 defer cancel() 628 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 629 rctx, err := runtime.AnnotateContext(ctx, mux, req) 630 if err != nil { 631 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 632 return 633 } 634 resp, md, err := request_Service_GetBlockByHeight_0(rctx, inboundMarshaler, client, req, pathParams) 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_Service_GetBlockByHeight_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 642 643 }) 644 645 mux.Handle("GET", pattern_Service_GetBlockByHash_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 646 ctx, cancel := context.WithCancel(req.Context()) 647 defer cancel() 648 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 649 rctx, err := runtime.AnnotateContext(ctx, mux, req) 650 if err != nil { 651 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 652 return 653 } 654 resp, md, err := request_Service_GetBlockByHash_0(rctx, inboundMarshaler, client, req, pathParams) 655 ctx = runtime.NewServerMetadataContext(ctx, md) 656 if err != nil { 657 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 658 return 659 } 660 661 forward_Service_GetBlockByHash_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 662 663 }) 664 665 mux.Handle("GET", pattern_Service_GetBlockResultsByHeight_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 666 ctx, cancel := context.WithCancel(req.Context()) 667 defer cancel() 668 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 669 rctx, err := runtime.AnnotateContext(ctx, mux, req) 670 if err != nil { 671 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 672 return 673 } 674 resp, md, err := request_Service_GetBlockResultsByHeight_0(rctx, inboundMarshaler, client, req, pathParams) 675 ctx = runtime.NewServerMetadataContext(ctx, md) 676 if err != nil { 677 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 678 return 679 } 680 681 forward_Service_GetBlockResultsByHeight_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 682 683 }) 684 685 mux.Handle("GET", pattern_Service_GetLatestValidatorSet_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 686 ctx, cancel := context.WithCancel(req.Context()) 687 defer cancel() 688 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 689 rctx, err := runtime.AnnotateContext(ctx, mux, req) 690 if err != nil { 691 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 692 return 693 } 694 resp, md, err := request_Service_GetLatestValidatorSet_0(rctx, inboundMarshaler, client, req, pathParams) 695 ctx = runtime.NewServerMetadataContext(ctx, md) 696 if err != nil { 697 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 698 return 699 } 700 701 forward_Service_GetLatestValidatorSet_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 702 703 }) 704 705 mux.Handle("GET", pattern_Service_GetValidatorSetByHeight_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 706 ctx, cancel := context.WithCancel(req.Context()) 707 defer cancel() 708 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 709 rctx, err := runtime.AnnotateContext(ctx, mux, req) 710 if err != nil { 711 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 712 return 713 } 714 resp, md, err := request_Service_GetValidatorSetByHeight_0(rctx, inboundMarshaler, client, req, pathParams) 715 ctx = runtime.NewServerMetadataContext(ctx, md) 716 if err != nil { 717 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 718 return 719 } 720 721 forward_Service_GetValidatorSetByHeight_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 722 723 }) 724 725 return nil 726 } 727 728 var ( 729 pattern_Service_GetNodeInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"lbm", "base", "ostracon", "v1", "node_info"}, "", runtime.AssumeColonVerbOpt(false))) 730 731 pattern_Service_GetSyncing_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"lbm", "base", "ostracon", "v1", "syncing"}, "", runtime.AssumeColonVerbOpt(false))) 732 733 pattern_Service_GetLatestBlock_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5}, []string{"lbm", "base", "ostracon", "v1", "blocks", "latest"}, "", runtime.AssumeColonVerbOpt(false))) 734 735 pattern_Service_GetBlockByHeight_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"lbm", "base", "ostracon", "v1", "blocks", "height"}, "", runtime.AssumeColonVerbOpt(false))) 736 737 pattern_Service_GetBlockByHash_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"lbm", "base", "ostracon", "v1", "block", "hash"}, "", runtime.AssumeColonVerbOpt(false))) 738 739 pattern_Service_GetBlockResultsByHeight_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"lbm", "base", "ostracon", "v1", "blockresults", "height"}, "", runtime.AssumeColonVerbOpt(false))) 740 741 pattern_Service_GetLatestValidatorSet_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5}, []string{"lbm", "base", "ostracon", "v1", "validatorsets", "latest"}, "", runtime.AssumeColonVerbOpt(false))) 742 743 pattern_Service_GetValidatorSetByHeight_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"lbm", "base", "ostracon", "v1", "validatorsets", "height"}, "", runtime.AssumeColonVerbOpt(false))) 744 ) 745 746 var ( 747 forward_Service_GetNodeInfo_0 = runtime.ForwardResponseMessage 748 749 forward_Service_GetSyncing_0 = runtime.ForwardResponseMessage 750 751 forward_Service_GetLatestBlock_0 = runtime.ForwardResponseMessage 752 753 forward_Service_GetBlockByHeight_0 = runtime.ForwardResponseMessage 754 755 forward_Service_GetBlockByHash_0 = runtime.ForwardResponseMessage 756 757 forward_Service_GetBlockResultsByHeight_0 = runtime.ForwardResponseMessage 758 759 forward_Service_GetLatestValidatorSet_0 = runtime.ForwardResponseMessage 760 761 forward_Service_GetValidatorSetByHeight_0 = runtime.ForwardResponseMessage 762 )