endpoint

package
v0.0.0-...-6cd7eb2 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2020 License: MIT Imports: 4 Imported by: 2

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) GetName

func (e *Endpoint) GetName() string

GetName returns the endpoint name

func (*Endpoint) GetOperations

func (e *Endpoint) GetOperations() []models.EndpointOperation

GetOperations returns all operations for this endpoint such as GET, POST

func (*Endpoint) GetSupportedExpandParams

func (e *Endpoint) GetSupportedExpandParams() []string

GetSupportedExpandParams returns which entities can be expanded

func (*Endpoint) GetSupportedSelectParams

func (e *Endpoint) GetSupportedSelectParams() []string

GetSupportedSelectParams returns the supported select parameters for this endpoint

func (*Endpoint) GetURL

func (e *Endpoint) GetURL() string

GetURL returns the external url

func (*Endpoint) ShowOutputInfo

func (e *Endpoint) ShowOutputInfo() bool

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

func (SortedEndpoints) Swap

func (a SortedEndpoints) Swap(i, j int)

Swap swaps the elements

Jump to

Keyboard shortcuts

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