56 lines
2.1 KiB
Go
56 lines
2.1 KiB
Go
package operations
|
|
|
|
// This file was generated by the swagger tool.
|
|
// Editing this file might prove futile when you re-run the generate command
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
context "golang.org/x/net/context"
|
|
|
|
middleware "github.com/go-openapi/runtime/middleware"
|
|
)
|
|
|
|
// DeleteSourcesIDKapacitorsKapaIDHandlerFunc turns a function with the right signature into a delete sources ID kapacitors kapa ID handler
|
|
type DeleteSourcesIDKapacitorsKapaIDHandlerFunc func(context.Context, DeleteSourcesIDKapacitorsKapaIDParams) middleware.Responder
|
|
|
|
// Handle executing the request and returning a response
|
|
func (fn DeleteSourcesIDKapacitorsKapaIDHandlerFunc) Handle(ctx context.Context, params DeleteSourcesIDKapacitorsKapaIDParams) middleware.Responder {
|
|
return fn(ctx, params)
|
|
}
|
|
|
|
// DeleteSourcesIDKapacitorsKapaIDHandler interface for that can handle valid delete sources ID kapacitors kapa ID params
|
|
type DeleteSourcesIDKapacitorsKapaIDHandler interface {
|
|
Handle(context.Context, DeleteSourcesIDKapacitorsKapaIDParams) middleware.Responder
|
|
}
|
|
|
|
// NewDeleteSourcesIDKapacitorsKapaID creates a new http.Handler for the delete sources ID kapacitors kapa ID operation
|
|
func NewDeleteSourcesIDKapacitorsKapaID(ctx *middleware.Context, handler DeleteSourcesIDKapacitorsKapaIDHandler) *DeleteSourcesIDKapacitorsKapaID {
|
|
return &DeleteSourcesIDKapacitorsKapaID{Context: ctx, Handler: handler}
|
|
}
|
|
|
|
/*DeleteSourcesIDKapacitorsKapaID swagger:route DELETE /sources/{id}/kapacitors/{kapa_id} deleteSourcesIdKapacitorsKapaId
|
|
|
|
This specific kapacitor will be removed.
|
|
|
|
*/
|
|
type DeleteSourcesIDKapacitorsKapaID struct {
|
|
Context *middleware.Context
|
|
Handler DeleteSourcesIDKapacitorsKapaIDHandler
|
|
}
|
|
|
|
func (o *DeleteSourcesIDKapacitorsKapaID) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
|
|
route, _ := o.Context.RouteInfo(r)
|
|
var Params = NewDeleteSourcesIDKapacitorsKapaIDParams()
|
|
|
|
if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params
|
|
o.Context.Respond(rw, r, route.Produces, route, err)
|
|
return
|
|
}
|
|
|
|
res := o.Handler.Handle(context.Background(), Params) // actually handle the request
|
|
|
|
o.Context.Respond(rw, r, route.Produces, route, res)
|
|
|
|
}
|