hives

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: 7 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HiveInfoResponse added in v0.3.2

type HiveInfoResponse struct {
	ID          string                     `json:"id"`
	Name        string                     `json:"name"`
	Description string                     `json:"description"`
	Image       string                     `json:"image"`
	LogoColor   string                     `json:"logocolor"`
	Options     []bees.BeeOptionDescriptor `json:"options"`
	States      []bees.StateDescriptor     `json:"states"`
	Events      []bees.EventDescriptor     `json:"events"`
	Actions     []bees.ActionDescriptor    `json:"actions"`
}

func PrepareHiveResponse added in v0.3.2

func PrepareHiveResponse(ctx smolder.APIContext, hive *bees.BeeFactoryInterface) HiveInfoResponse

type HiveResource

type HiveResource struct {
	smolder.Resource
}

HiveResource is the resource responsible for /hives

func (*HiveResource) Get

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

Get sends out items matching the query parameters

func (*HiveResource) GetAuthRequired

func (r *HiveResource) GetAuthRequired() bool

GetAuthRequired returns true because all requests need authentication

func (*HiveResource) GetByIDs

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

GetByIDs sends out all items matching a set of IDs

func (*HiveResource) GetByIDsAuthRequired

func (r *HiveResource) GetByIDsAuthRequired() bool

GetByIDsAuthRequired returns true because all requests need authentication

func (*HiveResource) GetDoc

func (r *HiveResource) GetDoc() string

GetDoc returns the description of this API endpoint

func (*HiveResource) GetParams

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

GetParams returns the parameters supported by this API endpoint

func (*HiveResource) Register

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

Register this resource with the container to setup all the routes

func (*HiveResource) Returns

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

Returns returns the model that will be returned

type HiveResponse

type HiveResponse struct {
	smolder.Response

	Hives []HiveInfoResponse `json:"hives,omitempty"`
	// contains filtered or unexported fields
}

HiveResponse is the common response to 'hive' requests

func (*HiveResponse) AddHive

func (r *HiveResponse) AddHive(hive *bees.BeeFactoryInterface)

AddHive adds a hive to the response

func (*HiveResponse) EmptyResponse

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

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

func (*HiveResponse) Init

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

Init a new response

func (*HiveResponse) Send

func (r *HiveResponse) 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