Documentation ¶
Index ¶
- type ActionPostStruct
- type ActionResource
- func (r *ActionResource) Get(ctx smolder.APIContext, request *restful.Request, response *restful.Response, ...)
- func (r *ActionResource) GetAuthRequired() bool
- func (r *ActionResource) GetByIDs(ctx smolder.APIContext, request *restful.Request, response *restful.Response, ...)
- func (r *ActionResource) GetByIDsAuthRequired() bool
- func (r *ActionResource) GetDoc() string
- func (r *ActionResource) GetParams() []*restful.Parameter
- func (r *ActionResource) Post(context smolder.APIContext, data interface{}, request *restful.Request, ...)
- func (r *ActionResource) PostAuthRequired() bool
- func (r *ActionResource) PostDoc() string
- func (r *ActionResource) PostParams() []*restful.Parameter
- func (r *ActionResource) Reads() interface{}
- func (r *ActionResource) Register(container *restful.Container, config smolder.APIConfig, ...)
- func (r *ActionResource) Returns() interface{}
- func (r *ActionResource) Validate(context smolder.APIContext, data interface{}, request *restful.Request) error
- type ActionResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionPostStruct ¶
type ActionPostStruct struct { Action struct { Bee string `json:"bee"` Name string `json:"name"` Options bees.Placeholders `json:"options"` } `json:"action"` }
ActionPostStruct holds all values of an incoming POST request
type ActionResource ¶
ActionResource is the resource responsible for /actions
func (*ActionResource) Get ¶
func (r *ActionResource) Get(ctx smolder.APIContext, request *restful.Request, response *restful.Response, params map[string][]string)
Get sends out items matching the query parameters
func (*ActionResource) GetAuthRequired ¶
func (r *ActionResource) GetAuthRequired() bool
GetAuthRequired returns true because all requests need authentication
func (*ActionResource) GetByIDs ¶
func (r *ActionResource) GetByIDs(ctx smolder.APIContext, request *restful.Request, response *restful.Response, ids []string)
GetByIDs sends out all items matching a set of IDs
func (*ActionResource) GetByIDsAuthRequired ¶
func (r *ActionResource) GetByIDsAuthRequired() bool
GetByIDsAuthRequired returns true because all requests need authentication
func (*ActionResource) GetDoc ¶
func (r *ActionResource) GetDoc() string
GetDoc returns the description of this API endpoint
func (*ActionResource) GetParams ¶
func (r *ActionResource) GetParams() []*restful.Parameter
GetParams returns the parameters supported by this API endpoint
func (*ActionResource) Post ¶
func (r *ActionResource) Post(context smolder.APIContext, data interface{}, request *restful.Request, response *restful.Response)
Post processes an incoming POST (create) request
func (*ActionResource) PostAuthRequired ¶
func (r *ActionResource) PostAuthRequired() bool
PostAuthRequired returns true because all requests need authentication
func (*ActionResource) PostDoc ¶
func (r *ActionResource) PostDoc() string
PostDoc returns the description of this API endpoint
func (*ActionResource) PostParams ¶
func (r *ActionResource) PostParams() []*restful.Parameter
PostParams returns the parameters supported by this API endpoint
func (*ActionResource) Reads ¶
func (r *ActionResource) Reads() interface{}
Reads returns the model that will be read by POST, PUT & PATCH operations
func (*ActionResource) Register ¶
func (r *ActionResource) Register(container *restful.Container, config smolder.APIConfig, context smolder.APIContextFactory)
Register this resource with the container to setup all the routes
func (*ActionResource) Returns ¶
func (r *ActionResource) Returns() interface{}
Returns returns the model that will be returned
func (*ActionResource) Validate ¶
func (r *ActionResource) Validate(context smolder.APIContext, data interface{}, request *restful.Request) error
Validate checks an incoming request for data errors
type ActionResponse ¶
type ActionResponse struct { smolder.Response Actions []actionInfoResponse `json:"actions,omitempty"` // contains filtered or unexported fields }
ActionResponse is the common response to 'action' requests
func (*ActionResponse) AddAction ¶
func (r *ActionResponse) AddAction(action *bees.Action)
AddAction adds a action to the response
func (*ActionResponse) EmptyResponse ¶
func (r *ActionResponse) EmptyResponse() interface{}
EmptyResponse returns an empty API response for this endpoint if there's no data to respond with
func (*ActionResponse) Init ¶
func (r *ActionResponse) Init(context smolder.APIContext)
Init a new response