beehive: github.com/muesli/beehive/api/resources/actions Index | Files

package actions

import "github.com/muesli/beehive/api/resources/actions"

Index

Package Files

actions.go actions_get.go actions_post.go actions_response.go

type ActionPostStruct Uses

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 Uses

type ActionResource struct {
    smolder.Resource
}

ActionResource is the resource responsible for /actions

func (*ActionResource) Get Uses

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 Uses

func (r *ActionResource) GetAuthRequired() bool

GetAuthRequired returns true because all requests need authentication

func (*ActionResource) GetByIDs Uses

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 Uses

func (r *ActionResource) GetByIDsAuthRequired() bool

GetByIDsAuthRequired returns true because all requests need authentication

func (*ActionResource) GetDoc Uses

func (r *ActionResource) GetDoc() string

GetDoc returns the description of this API endpoint

func (*ActionResource) GetParams Uses

func (r *ActionResource) GetParams() []*restful.Parameter

GetParams returns the parameters supported by this API endpoint

func (*ActionResource) Post Uses

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 Uses

func (r *ActionResource) PostAuthRequired() bool

PostAuthRequired returns true because all requests need authentication

func (*ActionResource) PostDoc Uses

func (r *ActionResource) PostDoc() string

PostDoc returns the description of this API endpoint

func (*ActionResource) PostParams Uses

func (r *ActionResource) PostParams() []*restful.Parameter

PostParams returns the parameters supported by this API endpoint

func (*ActionResource) Reads Uses

func (r *ActionResource) Reads() interface{}

Reads returns the model that will be read by POST, PUT & PATCH operations

func (*ActionResource) Register Uses

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 Uses

func (r *ActionResource) Returns() interface{}

Returns returns the model that will be returned

func (*ActionResource) Validate Uses

func (r *ActionResource) Validate(context smolder.APIContext, data interface{}, request *restful.Request) error

Validate checks an incoming request for data errors

type ActionResponse Uses

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 Uses

func (r *ActionResponse) AddAction(action *bees.Action)

AddAction adds a action to the response

func (*ActionResponse) EmptyResponse Uses

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 Uses

func (r *ActionResponse) Init(context smolder.APIContext)

Init a new response

Package actions imports 3 packages (graph) and is imported by 12 packages. Updated 2017-10-16. Refresh now. Tools for package owners.