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

package bees

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

Index

Package Files

bees.go bees_delete.go bees_get.go bees_post.go bees_put.go bees_response.go

type BeePostStruct Uses

type BeePostStruct struct {
    Bee struct {
        Name        string          `json:"name"`
        Namespace   string          `json:"namespace"`
        Description string          `json:"description"`
        Active      bool            `json:"active"`
        Options     bees.BeeOptions `json:"options"`
    } `json:"bee"`
}

BeePostStruct holds all values of an incoming POST request

type BeeResource Uses

type BeeResource struct {
    smolder.Resource
}

BeeResource is the resource responsible for /bees

func (*BeeResource) Delete Uses

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

Delete processes an incoming DELETE request

func (*BeeResource) DeleteAuthRequired Uses

func (r *BeeResource) DeleteAuthRequired() bool

DeleteAuthRequired returns true because all requests need authentication

func (*BeeResource) DeleteDoc Uses

func (r *BeeResource) DeleteDoc() string

DeleteDoc returns the description of this API endpoint

func (*BeeResource) DeleteParams Uses

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

DeleteParams returns the parameters supported by this API endpoint

func (*BeeResource) Get Uses

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

Get sends out items matching the query parameters

func (*BeeResource) GetAuthRequired Uses

func (r *BeeResource) GetAuthRequired() bool

GetAuthRequired returns true because all requests need authentication

func (*BeeResource) GetByIDs Uses

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

GetByIDs sends out all items matching a set of IDs

func (*BeeResource) GetByIDsAuthRequired Uses

func (r *BeeResource) GetByIDsAuthRequired() bool

GetByIDsAuthRequired returns true because all requests need authentication

func (*BeeResource) GetDoc Uses

func (r *BeeResource) GetDoc() string

GetDoc returns the description of this API endpoint

func (*BeeResource) GetParams Uses

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

GetParams returns the parameters supported by this API endpoint

func (*BeeResource) Post Uses

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

Post processes an incoming POST (create) request

func (*BeeResource) PostAuthRequired Uses

func (r *BeeResource) PostAuthRequired() bool

PostAuthRequired returns true because all requests need authentication

func (*BeeResource) PostDoc Uses

func (r *BeeResource) PostDoc() string

PostDoc returns the description of this API endpoint

func (*BeeResource) PostParams Uses

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

PostParams returns the parameters supported by this API endpoint

func (*BeeResource) Put Uses

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

Put processes an incoming PUT (update) request

func (*BeeResource) PutAuthRequired Uses

func (r *BeeResource) PutAuthRequired() bool

PutAuthRequired returns true because all requests need authentication

func (*BeeResource) PutDoc Uses

func (r *BeeResource) PutDoc() string

PutDoc returns the description of this API endpoint

func (*BeeResource) PutParams Uses

func (r *BeeResource) PutParams() []*restful.Parameter

PutParams returns the parameters supported by this API endpoint

func (*BeeResource) Reads Uses

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

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

func (*BeeResource) Register Uses

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

Register this resource with the container to setup all the routes

func (*BeeResource) Returns Uses

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

Returns returns the model that will be returned

func (*BeeResource) Validate Uses

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

Validate checks an incoming request for data errors

type BeeResponse Uses

type BeeResponse struct {
    smolder.Response

    Bees []beeInfoResponse `json:"bees,omitempty"`

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

BeeResponse is the common response to 'bee' requests

func (*BeeResponse) AddBee Uses

func (r *BeeResponse) AddBee(bee *bees.BeeInterface)

AddBee adds a bee to the response

func (*BeeResponse) EmptyResponse Uses

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

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

func (*BeeResponse) Init Uses

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

Init a new response

func (*BeeResponse) Send Uses

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

Send responds to a request with http.StatusOK

Package bees imports 6 packages (graph) and is imported by 12 packages. Updated 2019-04-29. Refresh now. Tools for package owners.