influxdb/restapi/operations/delete_sources_id_users_use...

56 lines
2.0 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"
)
// DeleteSourcesIDUsersUserIDHandlerFunc turns a function with the right signature into a delete sources ID users user ID handler
type DeleteSourcesIDUsersUserIDHandlerFunc func(context.Context, DeleteSourcesIDUsersUserIDParams) middleware.Responder
// Handle executing the request and returning a response
func (fn DeleteSourcesIDUsersUserIDHandlerFunc) Handle(ctx context.Context, params DeleteSourcesIDUsersUserIDParams) middleware.Responder {
return fn(ctx, params)
}
// DeleteSourcesIDUsersUserIDHandler interface for that can handle valid delete sources ID users user ID params
type DeleteSourcesIDUsersUserIDHandler interface {
Handle(context.Context, DeleteSourcesIDUsersUserIDParams) middleware.Responder
}
// NewDeleteSourcesIDUsersUserID creates a new http.Handler for the delete sources ID users user ID operation
func NewDeleteSourcesIDUsersUserID(ctx *middleware.Context, handler DeleteSourcesIDUsersUserIDHandler) *DeleteSourcesIDUsersUserID {
return &DeleteSourcesIDUsersUserID{Context: ctx, Handler: handler}
}
/*DeleteSourcesIDUsersUserID swagger:route DELETE /sources/{id}/users/{user_id} deleteSourcesIdUsersUserId
This specific user will be removed from the data store
*/
type DeleteSourcesIDUsersUserID struct {
Context *middleware.Context
Handler DeleteSourcesIDUsersUserIDHandler
}
func (o *DeleteSourcesIDUsersUserID) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
route, _ := o.Context.RouteInfo(r)
var Params = NewDeleteSourcesIDUsersUserIDParams()
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)
}