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" ) // GetSourcesIDPermissionsHandlerFunc turns a function with the right signature into a get sources ID permissions handler type GetSourcesIDPermissionsHandlerFunc func(context.Context, GetSourcesIDPermissionsParams) middleware.Responder // Handle executing the request and returning a response func (fn GetSourcesIDPermissionsHandlerFunc) Handle(ctx context.Context, params GetSourcesIDPermissionsParams) middleware.Responder { return fn(ctx, params) } // GetSourcesIDPermissionsHandler interface for that can handle valid get sources ID permissions params type GetSourcesIDPermissionsHandler interface { Handle(context.Context, GetSourcesIDPermissionsParams) middleware.Responder } // NewGetSourcesIDPermissions creates a new http.Handler for the get sources ID permissions operation func NewGetSourcesIDPermissions(ctx *middleware.Context, handler GetSourcesIDPermissionsHandler) *GetSourcesIDPermissions { return &GetSourcesIDPermissions{Context: ctx, Handler: handler} } /*GetSourcesIDPermissions swagger:route GET /sources/{id}/permissions getSourcesIdPermissions Returns the list of possible permissions supported by the backend time series data source. */ type GetSourcesIDPermissions struct { Context *middleware.Context Handler GetSourcesIDPermissionsHandler } func (o *GetSourcesIDPermissions) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, _ := o.Context.RouteInfo(r) var Params = NewGetSourcesIDPermissionsParams() 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) }