github.com/cilium/cilium@v1.16.2/api/v1/health/server/restapi/connectivity/put_status_probe.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 // Copyright Authors of Cilium 4 // SPDX-License-Identifier: Apache-2.0 5 6 package connectivity 7 8 // This file was generated by the swagger tool. 9 // Editing this file might prove futile when you re-run the generate command 10 11 import ( 12 "net/http" 13 14 "github.com/go-openapi/runtime/middleware" 15 ) 16 17 // PutStatusProbeHandlerFunc turns a function with the right signature into a put status probe handler 18 type PutStatusProbeHandlerFunc func(PutStatusProbeParams) middleware.Responder 19 20 // Handle executing the request and returning a response 21 func (fn PutStatusProbeHandlerFunc) Handle(params PutStatusProbeParams) middleware.Responder { 22 return fn(params) 23 } 24 25 // PutStatusProbeHandler interface for that can handle valid put status probe params 26 type PutStatusProbeHandler interface { 27 Handle(PutStatusProbeParams) middleware.Responder 28 } 29 30 // NewPutStatusProbe creates a new http.Handler for the put status probe operation 31 func NewPutStatusProbe(ctx *middleware.Context, handler PutStatusProbeHandler) *PutStatusProbe { 32 return &PutStatusProbe{Context: ctx, Handler: handler} 33 } 34 35 /* 36 PutStatusProbe swagger:route PUT /status/probe connectivity putStatusProbe 37 38 # Run synchronous connectivity probe to determine status of the Cilium cluster 39 40 Runs a synchronous probe to all other cilium-health instances and 41 returns the connectivity status. 42 */ 43 type PutStatusProbe struct { 44 Context *middleware.Context 45 Handler PutStatusProbeHandler 46 } 47 48 func (o *PutStatusProbe) ServeHTTP(rw http.ResponseWriter, r *http.Request) { 49 route, rCtx, _ := o.Context.RouteInfo(r) 50 if rCtx != nil { 51 *r = *rCtx 52 } 53 var Params = NewPutStatusProbeParams() 54 if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params 55 o.Context.Respond(rw, r, route.Produces, route, err) 56 return 57 } 58 59 res := o.Handler.Handle(Params) // actually handle the request 60 o.Context.Respond(rw, r, route.Produces, route, res) 61 62 }