chains

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2020 License: AGPL-3.0 Imports: 5 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChainPostStruct

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

type ChainResource struct {
	smolder.Resource
}

ChainResource is the resource responsible for /chains

func (*ChainResource) Delete

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

Delete processes an incoming DELETE request

func (*ChainResource) DeleteAuthRequired

func (r *ChainResource) DeleteAuthRequired() bool

DeleteAuthRequired returns true because all requests need authentication

func (*ChainResource) DeleteDoc

func (r *ChainResource) DeleteDoc() string

DeleteDoc returns the description of this API endpoint

func (*ChainResource) DeleteParams

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

DeleteParams returns the parameters supported by this API endpoint

func (*ChainResource) Get

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

func (r *ChainResource) GetAuthRequired() bool

GetAuthRequired returns true because all requests need authentication

func (*ChainResource) GetByIDs

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

func (r *ChainResource) GetByIDsAuthRequired() bool

GetByIDsAuthRequired returns true because all requests need authentication

func (*ChainResource) GetDoc

func (r *ChainResource) GetDoc() string

GetDoc returns the description of this API endpoint

func (*ChainResource) GetParams

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

GetParams returns the parameters supported by this API endpoint

func (*ChainResource) Post

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

func (r *ChainResource) PostAuthRequired() bool

PostAuthRequired returns true because all requests need authentication

func (*ChainResource) PostDoc

func (r *ChainResource) PostDoc() string

PostDoc returns the description of this API endpoint

func (*ChainResource) PostParams

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

PostParams returns the parameters supported by this API endpoint

func (*ChainResource) Reads

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

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

func (*ChainResource) Register

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

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

Returns returns the model that will be returned

func (*ChainResource) Validate

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

Validate checks an incoming request for data errors

type ChainResponse

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

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

AddChain adds a chain to the response

func (*ChainResponse) EmptyResponse

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

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

Init a new response

func (*ChainResponse) Send

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

Send responds to a request with http.StatusOK

Jump to

Keyboard shortcuts

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