searches

package
v0.0.0-...-1ad76dd Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2021 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

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

type SearchesResource struct {
	smolder.Resource
}

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

Jump to

Keyboard shortcuts

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