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