...

Source file src/github.com/sigstore/rekor/pkg/generated/restapi/operations/entries/search_log_query.go

Documentation: github.com/sigstore/rekor/pkg/generated/restapi/operations/entries

     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 entries
    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  // SearchLogQueryHandlerFunc turns a function with the right signature into a search log query handler
    31  type SearchLogQueryHandlerFunc func(SearchLogQueryParams) middleware.Responder
    32  
    33  // Handle executing the request and returning a response
    34  func (fn SearchLogQueryHandlerFunc) Handle(params SearchLogQueryParams) middleware.Responder {
    35  	return fn(params)
    36  }
    37  
    38  // SearchLogQueryHandler interface for that can handle valid search log query params
    39  type SearchLogQueryHandler interface {
    40  	Handle(SearchLogQueryParams) middleware.Responder
    41  }
    42  
    43  // NewSearchLogQuery creates a new http.Handler for the search log query operation
    44  func NewSearchLogQuery(ctx *middleware.Context, handler SearchLogQueryHandler) *SearchLogQuery {
    45  	return &SearchLogQuery{Context: ctx, Handler: handler}
    46  }
    47  
    48  /*
    49  	SearchLogQuery swagger:route POST /api/v1/log/entries/retrieve entries searchLogQuery
    50  
    51  Searches transparency log for one or more log entries
    52  */
    53  type SearchLogQuery struct {
    54  	Context *middleware.Context
    55  	Handler SearchLogQueryHandler
    56  }
    57  
    58  func (o *SearchLogQuery) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
    59  	route, rCtx, _ := o.Context.RouteInfo(r)
    60  	if rCtx != nil {
    61  		*r = *rCtx
    62  	}
    63  	var Params = NewSearchLogQueryParams()
    64  	if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params
    65  		o.Context.Respond(rw, r, route.Produces, route, err)
    66  		return
    67  	}
    68  
    69  	res := o.Handler.Handle(Params) // actually handle the request
    70  	o.Context.Respond(rw, r, route.Produces, route, res)
    71  
    72  }
    73  

View as plain text