56 lines
1.8 KiB
Go
56 lines
1.8 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"
|
|
)
|
|
|
|
// GetSourcesIDRolesHandlerFunc turns a function with the right signature into a get sources ID roles handler
|
|
type GetSourcesIDRolesHandlerFunc func(context.Context, GetSourcesIDRolesParams) middleware.Responder
|
|
|
|
// Handle executing the request and returning a response
|
|
func (fn GetSourcesIDRolesHandlerFunc) Handle(ctx context.Context, params GetSourcesIDRolesParams) middleware.Responder {
|
|
return fn(ctx, params)
|
|
}
|
|
|
|
// GetSourcesIDRolesHandler interface for that can handle valid get sources ID roles params
|
|
type GetSourcesIDRolesHandler interface {
|
|
Handle(context.Context, GetSourcesIDRolesParams) middleware.Responder
|
|
}
|
|
|
|
// NewGetSourcesIDRoles creates a new http.Handler for the get sources ID roles operation
|
|
func NewGetSourcesIDRoles(ctx *middleware.Context, handler GetSourcesIDRolesHandler) *GetSourcesIDRoles {
|
|
return &GetSourcesIDRoles{Context: ctx, Handler: handler}
|
|
}
|
|
|
|
/*GetSourcesIDRoles swagger:route GET /sources/{id}/roles getSourcesIdRoles
|
|
|
|
List of all roles on this data source
|
|
|
|
*/
|
|
type GetSourcesIDRoles struct {
|
|
Context *middleware.Context
|
|
Handler GetSourcesIDRolesHandler
|
|
}
|
|
|
|
func (o *GetSourcesIDRoles) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
|
|
route, _ := o.Context.RouteInfo(r)
|
|
var Params = NewGetSourcesIDRolesParams()
|
|
|
|
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)
|
|
|
|
}
|