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