beehive: Index | Files

package hives

import ""


Package Files

hives.go hives_get.go hives_response.go

type HiveInfoResponse Uses

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 Uses

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

type HiveResource Uses

type HiveResource struct {

HiveResource is the resource responsible for /hives

func (*HiveResource) Get Uses

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 Uses

func (r *HiveResource) GetAuthRequired() bool

GetAuthRequired returns true because all requests need authentication

func (*HiveResource) GetByIDs Uses

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 Uses

func (r *HiveResource) GetByIDsAuthRequired() bool

GetByIDsAuthRequired returns true because all requests need authentication

func (*HiveResource) GetDoc Uses

func (r *HiveResource) GetDoc() string

GetDoc returns the description of this API endpoint

func (*HiveResource) GetParams Uses

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

GetParams returns the parameters supported by this API endpoint

func (*HiveResource) Register Uses

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 Uses

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

Returns returns the model that will be returned

type HiveResponse Uses

type HiveResponse struct {

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

HiveResponse is the common response to 'hive' requests

func (*HiveResponse) AddHive Uses

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

AddHive adds a hive to the response

func (*HiveResponse) EmptyResponse Uses

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 Uses

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

Init a new response

func (*HiveResponse) Send Uses

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

Send responds to a request with http.StatusOK

Package hives imports 7 packages (graph) and is imported by 15 packages. Updated 2019-04-29. Refresh now. Tools for package owners.