statistics

package
v0.0.0-...-678ecff Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2019 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StatisticsResource

type StatisticsResource struct {
	smolder.Resource
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL