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

package chains

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

Index

Package Files

chains.go chains_delete.go chains_get.go chains_post.go chains_response.go

type ChainPostStruct Uses

type ChainPostStruct struct {
    Chain struct {
        Name        string     `json:"name"`
        Description string     `json:"description"`
        Event       bees.Event `json:"event"`
        Filters     []string   `json:"filters"`
        Actions     []string   `json:"actions"`
    } `json:"chain"`
}

ChainPostStruct holds all values of an incoming POST request

type ChainResource Uses

type ChainResource struct {
    smolder.Resource
}

ChainResource is the resource responsible for /chains

func (*ChainResource) Delete Uses

func (r *ChainResource) Delete(context smolder.APIContext, request *restful.Request, response *restful.Response)

Delete processes an incoming DELETE request

func (*ChainResource) DeleteAuthRequired Uses

func (r *ChainResource) DeleteAuthRequired() bool

DeleteAuthRequired returns true because all requests need authentication

func (*ChainResource) DeleteDoc Uses

func (r *ChainResource) DeleteDoc() string

DeleteDoc returns the description of this API endpoint

func (*ChainResource) DeleteParams Uses

func (r *ChainResource) DeleteParams() []*restful.Parameter

DeleteParams returns the parameters supported by this API endpoint

func (*ChainResource) Get Uses

func (r *ChainResource) Get(ctx smolder.APIContext, request *restful.Request, response *restful.Response, params map[string][]string)

Get sends out items matching the query parameters

func (*ChainResource) GetAuthRequired Uses

func (r *ChainResource) GetAuthRequired() bool

GetAuthRequired returns true because all requests need authentication

func (*ChainResource) GetByIDs Uses

func (r *ChainResource) GetByIDs(ctx smolder.APIContext, request *restful.Request, response *restful.Response, ids []string)

GetByIDs sends out all items matching a set of IDs

func (*ChainResource) GetByIDsAuthRequired Uses

func (r *ChainResource) GetByIDsAuthRequired() bool

GetByIDsAuthRequired returns true because all requests need authentication

func (*ChainResource) GetDoc Uses

func (r *ChainResource) GetDoc() string

GetDoc returns the description of this API endpoint

func (*ChainResource) GetParams Uses

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

GetParams returns the parameters supported by this API endpoint

func (*ChainResource) Post Uses

func (r *ChainResource) Post(context smolder.APIContext, data interface{}, request *restful.Request, response *restful.Response)

Post processes an incoming POST (create) request

func (*ChainResource) PostAuthRequired Uses

func (r *ChainResource) PostAuthRequired() bool

PostAuthRequired returns true because all requests need authentication

func (*ChainResource) PostDoc Uses

func (r *ChainResource) PostDoc() string

PostDoc returns the description of this API endpoint

func (*ChainResource) PostParams Uses

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

PostParams returns the parameters supported by this API endpoint

func (*ChainResource) Reads Uses

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

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

func (*ChainResource) Register Uses

func (r *ChainResource) Register(container *restful.Container, config smolder.APIConfig, context smolder.APIContextFactory)

Register this resource with the container to setup all the routes

func (*ChainResource) Returns Uses

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

Returns returns the model that will be returned

func (*ChainResource) Validate Uses

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

Validate checks an incoming request for data errors

type ChainResponse Uses

type ChainResponse struct {
    smolder.Response

    Chains []chainInfoResponse `json:"chains,omitempty"`
    // contains filtered or unexported fields
}

ChainResponse is the common response to 'chain' requests

func (*ChainResponse) AddChain Uses

func (r *ChainResponse) AddChain(chain bees.Chain)

AddChain adds a chain to the response

func (*ChainResponse) EmptyResponse Uses

func (r *ChainResponse) EmptyResponse() interface{}

EmptyResponse returns an empty API response for this endpoint if there's no data to respond with

func (*ChainResponse) Init Uses

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

Init a new response

func (*ChainResponse) Send Uses

func (r *ChainResponse) Send(response *restful.Response)

Send responds to a request with http.StatusOK

Package chains imports 5 packages (graph) and is imported by 12 packages. Updated 2019-04-26. Refresh now. Tools for package owners.