github.com/zorawar87/trillian@v1.2.1/trillian_log_api.pb.gw.go (about) 1 // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. 2 // source: trillian_log_api.proto 3 4 /* 5 Package trillian is a reverse proxy. 6 7 It translates gRPC into RESTful JSON APIs. 8 */ 9 package trillian 10 11 import ( 12 "io" 13 "net/http" 14 15 "github.com/golang/protobuf/proto" 16 "github.com/grpc-ecosystem/grpc-gateway/runtime" 17 "github.com/grpc-ecosystem/grpc-gateway/utilities" 18 "golang.org/x/net/context" 19 "google.golang.org/grpc" 20 "google.golang.org/grpc/codes" 21 "google.golang.org/grpc/grpclog" 22 "google.golang.org/grpc/status" 23 ) 24 25 var _ codes.Code 26 var _ io.Reader 27 var _ status.Status 28 var _ = runtime.String 29 var _ = utilities.NewDoubleArray 30 31 func request_TrillianLog_QueueLeaf_0(ctx context.Context, marshaler runtime.Marshaler, client TrillianLogClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 32 var protoReq QueueLeafRequest 33 var metadata runtime.ServerMetadata 34 35 if req.ContentLength > 0 { 36 if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil { 37 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 38 } 39 } 40 41 var ( 42 val string 43 ok bool 44 err error 45 _ = err 46 ) 47 48 val, ok = pathParams["log_id"] 49 if !ok { 50 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "log_id") 51 } 52 53 protoReq.LogId, err = runtime.Int64(val) 54 55 if err != nil { 56 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "log_id", err) 57 } 58 59 msg, err := client.QueueLeaf(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 60 return msg, metadata, err 61 62 } 63 64 func request_TrillianLog_AddSequencedLeaf_0(ctx context.Context, marshaler runtime.Marshaler, client TrillianLogClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 65 var protoReq AddSequencedLeafRequest 66 var metadata runtime.ServerMetadata 67 68 if req.ContentLength > 0 { 69 if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil { 70 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 71 } 72 } 73 74 var ( 75 val string 76 ok bool 77 err error 78 _ = err 79 ) 80 81 val, ok = pathParams["log_id"] 82 if !ok { 83 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "log_id") 84 } 85 86 protoReq.LogId, err = runtime.Int64(val) 87 88 if err != nil { 89 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "log_id", err) 90 } 91 92 msg, err := client.AddSequencedLeaf(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 93 return msg, metadata, err 94 95 } 96 97 var ( 98 filter_TrillianLog_GetInclusionProof_0 = &utilities.DoubleArray{Encoding: map[string]int{"log_id": 0, "leaf_index": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} 99 ) 100 101 func request_TrillianLog_GetInclusionProof_0(ctx context.Context, marshaler runtime.Marshaler, client TrillianLogClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 102 var protoReq GetInclusionProofRequest 103 var metadata runtime.ServerMetadata 104 105 var ( 106 val string 107 ok bool 108 err error 109 _ = err 110 ) 111 112 val, ok = pathParams["log_id"] 113 if !ok { 114 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "log_id") 115 } 116 117 protoReq.LogId, err = runtime.Int64(val) 118 119 if err != nil { 120 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "log_id", err) 121 } 122 123 val, ok = pathParams["leaf_index"] 124 if !ok { 125 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "leaf_index") 126 } 127 128 protoReq.LeafIndex, err = runtime.Int64(val) 129 130 if err != nil { 131 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "leaf_index", err) 132 } 133 134 if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_TrillianLog_GetInclusionProof_0); err != nil { 135 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 136 } 137 138 msg, err := client.GetInclusionProof(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 139 return msg, metadata, err 140 141 } 142 143 var ( 144 filter_TrillianLog_GetInclusionProofByHash_0 = &utilities.DoubleArray{Encoding: map[string]int{"log_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} 145 ) 146 147 func request_TrillianLog_GetInclusionProofByHash_0(ctx context.Context, marshaler runtime.Marshaler, client TrillianLogClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 148 var protoReq GetInclusionProofByHashRequest 149 var metadata runtime.ServerMetadata 150 151 var ( 152 val string 153 ok bool 154 err error 155 _ = err 156 ) 157 158 val, ok = pathParams["log_id"] 159 if !ok { 160 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "log_id") 161 } 162 163 protoReq.LogId, err = runtime.Int64(val) 164 165 if err != nil { 166 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "log_id", err) 167 } 168 169 if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_TrillianLog_GetInclusionProofByHash_0); err != nil { 170 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 171 } 172 173 msg, err := client.GetInclusionProofByHash(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 174 return msg, metadata, err 175 176 } 177 178 var ( 179 filter_TrillianLog_GetConsistencyProof_0 = &utilities.DoubleArray{Encoding: map[string]int{"log_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} 180 ) 181 182 func request_TrillianLog_GetConsistencyProof_0(ctx context.Context, marshaler runtime.Marshaler, client TrillianLogClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 183 var protoReq GetConsistencyProofRequest 184 var metadata runtime.ServerMetadata 185 186 var ( 187 val string 188 ok bool 189 err error 190 _ = err 191 ) 192 193 val, ok = pathParams["log_id"] 194 if !ok { 195 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "log_id") 196 } 197 198 protoReq.LogId, err = runtime.Int64(val) 199 200 if err != nil { 201 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "log_id", err) 202 } 203 204 if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_TrillianLog_GetConsistencyProof_0); err != nil { 205 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 206 } 207 208 msg, err := client.GetConsistencyProof(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 209 return msg, metadata, err 210 211 } 212 213 var ( 214 filter_TrillianLog_GetLatestSignedLogRoot_0 = &utilities.DoubleArray{Encoding: map[string]int{"log_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} 215 ) 216 217 func request_TrillianLog_GetLatestSignedLogRoot_0(ctx context.Context, marshaler runtime.Marshaler, client TrillianLogClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 218 var protoReq GetLatestSignedLogRootRequest 219 var metadata runtime.ServerMetadata 220 221 var ( 222 val string 223 ok bool 224 err error 225 _ = err 226 ) 227 228 val, ok = pathParams["log_id"] 229 if !ok { 230 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "log_id") 231 } 232 233 protoReq.LogId, err = runtime.Int64(val) 234 235 if err != nil { 236 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "log_id", err) 237 } 238 239 if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_TrillianLog_GetLatestSignedLogRoot_0); err != nil { 240 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 241 } 242 243 msg, err := client.GetLatestSignedLogRoot(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 244 return msg, metadata, err 245 246 } 247 248 var ( 249 filter_TrillianLog_GetSequencedLeafCount_0 = &utilities.DoubleArray{Encoding: map[string]int{"log_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} 250 ) 251 252 func request_TrillianLog_GetSequencedLeafCount_0(ctx context.Context, marshaler runtime.Marshaler, client TrillianLogClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 253 var protoReq GetSequencedLeafCountRequest 254 var metadata runtime.ServerMetadata 255 256 var ( 257 val string 258 ok bool 259 err error 260 _ = err 261 ) 262 263 val, ok = pathParams["log_id"] 264 if !ok { 265 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "log_id") 266 } 267 268 protoReq.LogId, err = runtime.Int64(val) 269 270 if err != nil { 271 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "log_id", err) 272 } 273 274 if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_TrillianLog_GetSequencedLeafCount_0); err != nil { 275 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 276 } 277 278 msg, err := client.GetSequencedLeafCount(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 279 return msg, metadata, err 280 281 } 282 283 var ( 284 filter_TrillianLog_GetEntryAndProof_0 = &utilities.DoubleArray{Encoding: map[string]int{"log_id": 0, "leaf_index": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} 285 ) 286 287 func request_TrillianLog_GetEntryAndProof_0(ctx context.Context, marshaler runtime.Marshaler, client TrillianLogClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 288 var protoReq GetEntryAndProofRequest 289 var metadata runtime.ServerMetadata 290 291 var ( 292 val string 293 ok bool 294 err error 295 _ = err 296 ) 297 298 val, ok = pathParams["log_id"] 299 if !ok { 300 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "log_id") 301 } 302 303 protoReq.LogId, err = runtime.Int64(val) 304 305 if err != nil { 306 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "log_id", err) 307 } 308 309 val, ok = pathParams["leaf_index"] 310 if !ok { 311 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "leaf_index") 312 } 313 314 protoReq.LeafIndex, err = runtime.Int64(val) 315 316 if err != nil { 317 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "leaf_index", err) 318 } 319 320 if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_TrillianLog_GetEntryAndProof_0); err != nil { 321 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 322 } 323 324 msg, err := client.GetEntryAndProof(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 325 return msg, metadata, err 326 327 } 328 329 var ( 330 filter_TrillianLog_InitLog_0 = &utilities.DoubleArray{Encoding: map[string]int{"log_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} 331 ) 332 333 func request_TrillianLog_InitLog_0(ctx context.Context, marshaler runtime.Marshaler, client TrillianLogClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 334 var protoReq InitLogRequest 335 var metadata runtime.ServerMetadata 336 337 var ( 338 val string 339 ok bool 340 err error 341 _ = err 342 ) 343 344 val, ok = pathParams["log_id"] 345 if !ok { 346 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "log_id") 347 } 348 349 protoReq.LogId, err = runtime.Int64(val) 350 351 if err != nil { 352 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "log_id", err) 353 } 354 355 if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_TrillianLog_InitLog_0); err != nil { 356 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 357 } 358 359 msg, err := client.InitLog(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 360 return msg, metadata, err 361 362 } 363 364 // RegisterTrillianLogHandlerFromEndpoint is same as RegisterTrillianLogHandler but 365 // automatically dials to "endpoint" and closes the connection when "ctx" gets done. 366 func RegisterTrillianLogHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { 367 conn, err := grpc.Dial(endpoint, opts...) 368 if err != nil { 369 return err 370 } 371 defer func() { 372 if err != nil { 373 if cerr := conn.Close(); cerr != nil { 374 grpclog.Printf("Failed to close conn to %s: %v", endpoint, cerr) 375 } 376 return 377 } 378 go func() { 379 <-ctx.Done() 380 if cerr := conn.Close(); cerr != nil { 381 grpclog.Printf("Failed to close conn to %s: %v", endpoint, cerr) 382 } 383 }() 384 }() 385 386 return RegisterTrillianLogHandler(ctx, mux, conn) 387 } 388 389 // RegisterTrillianLogHandler registers the http handlers for service TrillianLog to "mux". 390 // The handlers forward requests to the grpc endpoint over "conn". 391 func RegisterTrillianLogHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { 392 return RegisterTrillianLogHandlerClient(ctx, mux, NewTrillianLogClient(conn)) 393 } 394 395 // RegisterTrillianLogHandler registers the http handlers for service TrillianLog to "mux". 396 // The handlers forward requests to the grpc endpoint over the given implementation of "TrillianLogClient". 397 // Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "TrillianLogClient" 398 // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in 399 // "TrillianLogClient" to call the correct interceptors. 400 func RegisterTrillianLogHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TrillianLogClient) error { 401 402 mux.Handle("POST", pattern_TrillianLog_QueueLeaf_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 403 ctx, cancel := context.WithCancel(req.Context()) 404 defer cancel() 405 if cn, ok := w.(http.CloseNotifier); ok { 406 go func(done <-chan struct{}, closed <-chan bool) { 407 select { 408 case <-done: 409 case <-closed: 410 cancel() 411 } 412 }(ctx.Done(), cn.CloseNotify()) 413 } 414 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 415 rctx, err := runtime.AnnotateContext(ctx, mux, req) 416 if err != nil { 417 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 418 return 419 } 420 resp, md, err := request_TrillianLog_QueueLeaf_0(rctx, inboundMarshaler, client, req, pathParams) 421 ctx = runtime.NewServerMetadataContext(ctx, md) 422 if err != nil { 423 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 424 return 425 } 426 427 forward_TrillianLog_QueueLeaf_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 428 429 }) 430 431 mux.Handle("POST", pattern_TrillianLog_AddSequencedLeaf_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 432 ctx, cancel := context.WithCancel(req.Context()) 433 defer cancel() 434 if cn, ok := w.(http.CloseNotifier); ok { 435 go func(done <-chan struct{}, closed <-chan bool) { 436 select { 437 case <-done: 438 case <-closed: 439 cancel() 440 } 441 }(ctx.Done(), cn.CloseNotify()) 442 } 443 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 444 rctx, err := runtime.AnnotateContext(ctx, mux, req) 445 if err != nil { 446 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 447 return 448 } 449 resp, md, err := request_TrillianLog_AddSequencedLeaf_0(rctx, inboundMarshaler, client, req, pathParams) 450 ctx = runtime.NewServerMetadataContext(ctx, md) 451 if err != nil { 452 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 453 return 454 } 455 456 forward_TrillianLog_AddSequencedLeaf_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 457 458 }) 459 460 mux.Handle("GET", pattern_TrillianLog_GetInclusionProof_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 461 ctx, cancel := context.WithCancel(req.Context()) 462 defer cancel() 463 if cn, ok := w.(http.CloseNotifier); ok { 464 go func(done <-chan struct{}, closed <-chan bool) { 465 select { 466 case <-done: 467 case <-closed: 468 cancel() 469 } 470 }(ctx.Done(), cn.CloseNotify()) 471 } 472 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 473 rctx, err := runtime.AnnotateContext(ctx, mux, req) 474 if err != nil { 475 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 476 return 477 } 478 resp, md, err := request_TrillianLog_GetInclusionProof_0(rctx, inboundMarshaler, client, req, pathParams) 479 ctx = runtime.NewServerMetadataContext(ctx, md) 480 if err != nil { 481 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 482 return 483 } 484 485 forward_TrillianLog_GetInclusionProof_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 486 487 }) 488 489 mux.Handle("GET", pattern_TrillianLog_GetInclusionProofByHash_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 490 ctx, cancel := context.WithCancel(req.Context()) 491 defer cancel() 492 if cn, ok := w.(http.CloseNotifier); ok { 493 go func(done <-chan struct{}, closed <-chan bool) { 494 select { 495 case <-done: 496 case <-closed: 497 cancel() 498 } 499 }(ctx.Done(), cn.CloseNotify()) 500 } 501 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 502 rctx, err := runtime.AnnotateContext(ctx, mux, req) 503 if err != nil { 504 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 505 return 506 } 507 resp, md, err := request_TrillianLog_GetInclusionProofByHash_0(rctx, inboundMarshaler, client, req, pathParams) 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_TrillianLog_GetInclusionProofByHash_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 515 516 }) 517 518 mux.Handle("GET", pattern_TrillianLog_GetConsistencyProof_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 519 ctx, cancel := context.WithCancel(req.Context()) 520 defer cancel() 521 if cn, ok := w.(http.CloseNotifier); ok { 522 go func(done <-chan struct{}, closed <-chan bool) { 523 select { 524 case <-done: 525 case <-closed: 526 cancel() 527 } 528 }(ctx.Done(), cn.CloseNotify()) 529 } 530 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 531 rctx, err := runtime.AnnotateContext(ctx, mux, req) 532 if err != nil { 533 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 534 return 535 } 536 resp, md, err := request_TrillianLog_GetConsistencyProof_0(rctx, inboundMarshaler, client, req, pathParams) 537 ctx = runtime.NewServerMetadataContext(ctx, md) 538 if err != nil { 539 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 540 return 541 } 542 543 forward_TrillianLog_GetConsistencyProof_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 544 545 }) 546 547 mux.Handle("GET", pattern_TrillianLog_GetLatestSignedLogRoot_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 548 ctx, cancel := context.WithCancel(req.Context()) 549 defer cancel() 550 if cn, ok := w.(http.CloseNotifier); ok { 551 go func(done <-chan struct{}, closed <-chan bool) { 552 select { 553 case <-done: 554 case <-closed: 555 cancel() 556 } 557 }(ctx.Done(), cn.CloseNotify()) 558 } 559 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 560 rctx, err := runtime.AnnotateContext(ctx, mux, req) 561 if err != nil { 562 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 563 return 564 } 565 resp, md, err := request_TrillianLog_GetLatestSignedLogRoot_0(rctx, inboundMarshaler, client, req, pathParams) 566 ctx = runtime.NewServerMetadataContext(ctx, md) 567 if err != nil { 568 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 569 return 570 } 571 572 forward_TrillianLog_GetLatestSignedLogRoot_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 573 574 }) 575 576 mux.Handle("GET", pattern_TrillianLog_GetSequencedLeafCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 577 ctx, cancel := context.WithCancel(req.Context()) 578 defer cancel() 579 if cn, ok := w.(http.CloseNotifier); ok { 580 go func(done <-chan struct{}, closed <-chan bool) { 581 select { 582 case <-done: 583 case <-closed: 584 cancel() 585 } 586 }(ctx.Done(), cn.CloseNotify()) 587 } 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_TrillianLog_GetSequencedLeafCount_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_TrillianLog_GetSequencedLeafCount_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 602 603 }) 604 605 mux.Handle("GET", pattern_TrillianLog_GetEntryAndProof_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 606 ctx, cancel := context.WithCancel(req.Context()) 607 defer cancel() 608 if cn, ok := w.(http.CloseNotifier); ok { 609 go func(done <-chan struct{}, closed <-chan bool) { 610 select { 611 case <-done: 612 case <-closed: 613 cancel() 614 } 615 }(ctx.Done(), cn.CloseNotify()) 616 } 617 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 618 rctx, err := runtime.AnnotateContext(ctx, mux, req) 619 if err != nil { 620 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 621 return 622 } 623 resp, md, err := request_TrillianLog_GetEntryAndProof_0(rctx, inboundMarshaler, client, req, pathParams) 624 ctx = runtime.NewServerMetadataContext(ctx, md) 625 if err != nil { 626 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 627 return 628 } 629 630 forward_TrillianLog_GetEntryAndProof_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 631 632 }) 633 634 mux.Handle("POST", pattern_TrillianLog_InitLog_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 635 ctx, cancel := context.WithCancel(req.Context()) 636 defer cancel() 637 if cn, ok := w.(http.CloseNotifier); ok { 638 go func(done <-chan struct{}, closed <-chan bool) { 639 select { 640 case <-done: 641 case <-closed: 642 cancel() 643 } 644 }(ctx.Done(), cn.CloseNotify()) 645 } 646 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 647 rctx, err := runtime.AnnotateContext(ctx, mux, req) 648 if err != nil { 649 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 650 return 651 } 652 resp, md, err := request_TrillianLog_InitLog_0(rctx, inboundMarshaler, client, req, pathParams) 653 ctx = runtime.NewServerMetadataContext(ctx, md) 654 if err != nil { 655 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 656 return 657 } 658 659 forward_TrillianLog_InitLog_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 660 661 }) 662 663 return nil 664 } 665 666 var ( 667 pattern_TrillianLog_QueueLeaf_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"v1beta1", "logs", "log_id", "leaves"}, "")) 668 669 pattern_TrillianLog_AddSequencedLeaf_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"v1beta1", "logs", "log_id", "leaves"}, "sequenced")) 670 671 pattern_TrillianLog_GetInclusionProof_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"v1beta1", "logs", "log_id", "leaves", "leaf_index"}, "inclusion_proof")) 672 673 pattern_TrillianLog_GetInclusionProofByHash_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"v1beta1", "logs", "log_id", "leaves"}, "inclusion_by_hash")) 674 675 pattern_TrillianLog_GetConsistencyProof_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1beta1", "logs", "log_id"}, "consistency_proof")) 676 677 pattern_TrillianLog_GetLatestSignedLogRoot_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"v1beta1", "logs", "log_id", "roots"}, "latest")) 678 679 pattern_TrillianLog_GetSequencedLeafCount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"v1beta1", "logs", "log_id", "leaves"}, "sequenced_count")) 680 681 pattern_TrillianLog_GetEntryAndProof_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"v1beta1", "logs", "log_id", "leaves", "leaf_index"}, "")) 682 683 pattern_TrillianLog_InitLog_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1beta1", "logs", "log_id"}, "init")) 684 ) 685 686 var ( 687 forward_TrillianLog_QueueLeaf_0 = runtime.ForwardResponseMessage 688 689 forward_TrillianLog_AddSequencedLeaf_0 = runtime.ForwardResponseMessage 690 691 forward_TrillianLog_GetInclusionProof_0 = runtime.ForwardResponseMessage 692 693 forward_TrillianLog_GetInclusionProofByHash_0 = runtime.ForwardResponseMessage 694 695 forward_TrillianLog_GetConsistencyProof_0 = runtime.ForwardResponseMessage 696 697 forward_TrillianLog_GetLatestSignedLogRoot_0 = runtime.ForwardResponseMessage 698 699 forward_TrillianLog_GetSequencedLeafCount_0 = runtime.ForwardResponseMessage 700 701 forward_TrillianLog_GetEntryAndProof_0 = runtime.ForwardResponseMessage 702 703 forward_TrillianLog_InitLog_0 = runtime.ForwardResponseMessage 704 )