Documentation ¶
Index ¶
- type StatisticsResource
- func (r *StatisticsResource) Get(context smolder.APIContext, request *restful.Request, ...)
- func (r *StatisticsResource) GetAuthRequired() bool
- func (r *StatisticsResource) GetByIDsAuthRequired() bool
- func (r *StatisticsResource) GetDoc() string
- func (r *StatisticsResource) GetParams() []*restful.Parameter
- func (r *StatisticsResource) Register(container *restful.Container, config smolder.APIConfig, ...)
- func (r *StatisticsResource) Returns() interface{}
- type StatisticsResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StatisticsResource ¶
StatisticsResource is the resource responsible for /statistics
func (*StatisticsResource) Get ¶
func (r *StatisticsResource) Get(context smolder.APIContext, request *restful.Request, response *restful.Response, params map[string][]string)
Get sends out items matching the query parameters
func (*StatisticsResource) GetAuthRequired ¶
func (r *StatisticsResource) GetAuthRequired() bool
GetAuthRequired returns true because all requests need authentication
func (*StatisticsResource) GetByIDsAuthRequired ¶
func (r *StatisticsResource) GetByIDsAuthRequired() bool
GetByIDsAuthRequired returns true because all requests need authentication
func (*StatisticsResource) GetDoc ¶
func (r *StatisticsResource) GetDoc() string
GetDoc returns the description of this API endpoint
func (*StatisticsResource) GetParams ¶
func (r *StatisticsResource) GetParams() []*restful.Parameter
GetParams returns the parameters supported by this API endpoint
func (*StatisticsResource) Register ¶
func (r *StatisticsResource) Register(container *restful.Container, config smolder.APIConfig, context smolder.APIContextFactory)
Register this resource with the container to setup all the routes
func (*StatisticsResource) Returns ¶
func (r *StatisticsResource) Returns() interface{}
Returns returns the model that will be returned
type StatisticsResponse ¶
type StatisticsResponse struct { smolder.Response Statistics []statisticsInfoResponse `json:"statistics,omitempty"` // contains filtered or unexported fields }
StatisticsResponse is the common response to 'statistics' requests
func (*StatisticsResponse) AddStatistics ¶
func (r *StatisticsResponse) AddStatistics(statistics *db.Statistics)
AddStatistics adds a statistics to the response
func (*StatisticsResponse) EmptyResponse ¶
func (r *StatisticsResponse) EmptyResponse() interface{}
EmptyResponse returns an empty API response for this endpoint if there's no data to respond with
func (*StatisticsResponse) Init ¶
func (r *StatisticsResponse) Init(context smolder.APIContext)
Init a new response