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