1 // Code generated by go-swagger; DO NOT EDIT. 2 3 // 4 // Copyright 2021 The Sigstore Authors. 5 // 6 // Licensed under the Apache License, Version 2.0 (the "License"); 7 // you may not use this file except in compliance with the License. 8 // You may obtain a copy of the License at 9 // 10 // http://www.apache.org/licenses/LICENSE-2.0 11 // 12 // Unless required by applicable law or agreed to in writing, software 13 // distributed under the License is distributed on an "AS IS" BASIS, 14 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 // See the License for the specific language governing permissions and 16 // limitations under the License. 17 // 18 19 package tlog 20 21 // This file was generated by the swagger tool. 22 // Editing this file might prove futile when you re-run the generate command 23 24 import ( 25 "net/http" 26 27 "github.com/go-openapi/runtime/middleware" 28 ) 29 30 // GetLogInfoHandlerFunc turns a function with the right signature into a get log info handler 31 type GetLogInfoHandlerFunc func(GetLogInfoParams) middleware.Responder 32 33 // Handle executing the request and returning a response 34 func (fn GetLogInfoHandlerFunc) Handle(params GetLogInfoParams) middleware.Responder { 35 return fn(params) 36 } 37 38 // GetLogInfoHandler interface for that can handle valid get log info params 39 type GetLogInfoHandler interface { 40 Handle(GetLogInfoParams) middleware.Responder 41 } 42 43 // NewGetLogInfo creates a new http.Handler for the get log info operation 44 func NewGetLogInfo(ctx *middleware.Context, handler GetLogInfoHandler) *GetLogInfo { 45 return &GetLogInfo{Context: ctx, Handler: handler} 46 } 47 48 /* 49 GetLogInfo swagger:route GET /api/v1/log tlog getLogInfo 50 51 # Get information about the current state of the transparency log 52 53 Returns the current root hash and size of the merkle tree used to store the log entries. 54 */ 55 type GetLogInfo struct { 56 Context *middleware.Context 57 Handler GetLogInfoHandler 58 } 59 60 func (o *GetLogInfo) ServeHTTP(rw http.ResponseWriter, r *http.Request) { 61 route, rCtx, _ := o.Context.RouteInfo(r) 62 if rCtx != nil { 63 *r = *rCtx 64 } 65 var Params = NewGetLogInfoParams() 66 if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params 67 o.Context.Respond(rw, r, route.Produces, route, err) 68 return 69 } 70 71 res := o.Handler.Handle(Params) // actually handle the request 72 o.Context.Respond(rw, r, route.Produces, route, res) 73 74 } 75