actions

package
v0.0.0-...-e08ef68 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 2, 2018 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

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

type ActionResource struct {
	smolder.Resource
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL