Documentation ¶
Index ¶
- type BeePostStruct
- type BeeResource
- func (r *BeeResource) Delete(context smolder.APIContext, request *restful.Request, ...)
- func (r *BeeResource) DeleteAuthRequired() bool
- func (r *BeeResource) DeleteDoc() string
- func (r *BeeResource) DeleteParams() []*restful.Parameter
- func (r *BeeResource) Get(ctx smolder.APIContext, request *restful.Request, response *restful.Response, ...)
- func (r *BeeResource) GetAuthRequired() bool
- func (r *BeeResource) GetByIDs(ctx smolder.APIContext, request *restful.Request, response *restful.Response, ...)
- func (r *BeeResource) GetByIDsAuthRequired() bool
- func (r *BeeResource) GetDoc() string
- func (r *BeeResource) GetParams() []*restful.Parameter
- func (r *BeeResource) Post(context smolder.APIContext, data interface{}, request *restful.Request, ...)
- func (r *BeeResource) PostAuthRequired() bool
- func (r *BeeResource) PostDoc() string
- func (r *BeeResource) PostParams() []*restful.Parameter
- func (r *BeeResource) Put(context smolder.APIContext, data interface{}, request *restful.Request, ...)
- func (r *BeeResource) PutAuthRequired() bool
- func (r *BeeResource) PutDoc() string
- func (r *BeeResource) PutParams() []*restful.Parameter
- func (r *BeeResource) Reads() interface{}
- func (r *BeeResource) Register(container *restful.Container, config smolder.APIConfig, ...)
- func (r *BeeResource) Returns() interface{}
- func (r *BeeResource) Validate(context smolder.APIContext, data interface{}, request *restful.Request) error
- type BeeResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BeePostStruct ¶
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 ¶
BeeResource is the resource responsible for /bees
func (*BeeResource) Delete ¶
func (r *BeeResource) Delete(context smolder.APIContext, request *restful.Request, response *restful.Response)
Delete processes an incoming DELETE request
func (*BeeResource) DeleteAuthRequired ¶
func (r *BeeResource) DeleteAuthRequired() bool
DeleteAuthRequired returns true because all requests need authentication
func (*BeeResource) DeleteDoc ¶
func (r *BeeResource) DeleteDoc() string
DeleteDoc returns the description of this API endpoint
func (*BeeResource) DeleteParams ¶
func (r *BeeResource) DeleteParams() []*restful.Parameter
DeleteParams returns the parameters supported by this API endpoint
func (*BeeResource) Get ¶
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 ¶
func (r *BeeResource) GetAuthRequired() bool
GetAuthRequired returns true because all requests need authentication
func (*BeeResource) GetByIDs ¶
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 ¶
func (r *BeeResource) GetByIDsAuthRequired() bool
GetByIDsAuthRequired returns true because all requests need authentication
func (*BeeResource) GetDoc ¶
func (r *BeeResource) GetDoc() string
GetDoc returns the description of this API endpoint
func (*BeeResource) GetParams ¶
func (r *BeeResource) GetParams() []*restful.Parameter
GetParams returns the parameters supported by this API endpoint
func (*BeeResource) Post ¶
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 ¶
func (r *BeeResource) PostAuthRequired() bool
PostAuthRequired returns true because all requests need authentication
func (*BeeResource) PostDoc ¶
func (r *BeeResource) PostDoc() string
PostDoc returns the description of this API endpoint
func (*BeeResource) PostParams ¶
func (r *BeeResource) PostParams() []*restful.Parameter
PostParams returns the parameters supported by this API endpoint
func (*BeeResource) Put ¶
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 ¶
func (r *BeeResource) PutAuthRequired() bool
PutAuthRequired returns true because all requests need authentication
func (*BeeResource) PutDoc ¶
func (r *BeeResource) PutDoc() string
PutDoc returns the description of this API endpoint
func (*BeeResource) PutParams ¶
func (r *BeeResource) PutParams() []*restful.Parameter
PutParams returns the parameters supported by this API endpoint
func (*BeeResource) Reads ¶
func (r *BeeResource) Reads() interface{}
Reads returns the model that will be read by POST, PUT & PATCH operations
func (*BeeResource) Register ¶
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 ¶
func (r *BeeResource) Returns() interface{}
Returns returns the model that will be returned
func (*BeeResource) Validate ¶
func (r *BeeResource) Validate(context smolder.APIContext, data interface{}, request *restful.Request) error
Validate checks an incoming request for data errors
type BeeResponse ¶
type BeeResponse struct { smolder.Response Bees []beeInfoResponse `json:"bees,omitempty"` // contains filtered or unexported fields }
BeeResponse is the common response to 'bee' requests
func (*BeeResponse) AddBee ¶
func (r *BeeResponse) AddBee(bee *bees.BeeInterface)
AddBee adds a bee to the response
func (*BeeResponse) EmptyResponse ¶
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 ¶
func (r *BeeResponse) Init(context smolder.APIContext)
Init a new response
func (*BeeResponse) Send ¶
func (r *BeeResponse) Send(response *restful.Response)
Send responds to a request with http.StatusOK