Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Endpoint ¶
type Endpoint struct { Name string `json:"name"` // Name of the endpoint URL string `json:"url"` // External URL to the endpoint EntityType entities.EntityType `json:"-"` OutputInfo bool `json:"-"` //Output when BasePathInfo is requested by the user Operations []models.EndpointOperation `json:"-"` SupportedExpandParams []string `json:"-"` SupportedSelectParams []string `json:"-"` }
Endpoint contains all information for creating and handling a main SensorThings endpoint. A SensorThings endpoint contains multiple EndpointOperations Endpoint can be marshalled to JSON for returning endpoint information requested by the user: http://www.sensorup.com/docs/#resource-path
func (*Endpoint) GetOperations ¶
func (e *Endpoint) GetOperations() []models.EndpointOperation
GetOperations returns all operations for this endpoint such as GET, POST
func (*Endpoint) GetSupportedExpandParams ¶
GetSupportedExpandParams returns which entities can be expanded
func (*Endpoint) GetSupportedSelectParams ¶
GetSupportedSelectParams returns the supported select parameters for this endpoint
func (*Endpoint) ShowOutputInfo ¶
ShowOutputInfo returns true if the endpoint should output his info when BasePathInfo is requested
type EndpointWrapper ¶
type EndpointWrapper struct { Endpoint models.Endpoint Operation models.EndpointOperation }
EndpointWrapper combines a SensorThings endpoint and operation in preparation to add it to the router
type SortedEndpoints ¶
type SortedEndpoints []*EndpointWrapper
SortedEndpoints is a slice of *EndpointWrapper's, it implements some functions to be able to sort the slice
func EndpointsToSortedList ¶
func EndpointsToSortedList(endpoints *map[entities.EntityType]models.Endpoint) SortedEndpoints
EndpointsToSortedList sorts all the endpoints so they can be added to the routes in the right order else requests will be picked up by the wrong handlers
func (SortedEndpoints) Len ¶
func (a SortedEndpoints) Len() int
Len returns the number of elements in the collection
func (SortedEndpoints) Less ¶
func (a SortedEndpoints) Less(i, j int) bool
Less holds the custom sorting logic