resource

package
v0.0.0-...-30a0ae6 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2023 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Consts = map[string]reflect.Value{}
View Source
var EnableMQTTGateway = true

EnableMQTTGateway controls whether clients are informed about the MQTT gateway

View Source
var Functions = map[string]reflect.Value{
	"ClearMOTD":                     reflect.ValueOf(ClearMOTD),
	"RegisterPairConnectionHandler": reflect.ValueOf(RegisterPairConnectionHandler),
	"RenderData":                    reflect.ValueOf(RenderData),
	"RenderMsgpack":                 reflect.ValueOf(RenderMsgpack),
	"RenderUnauthorized":            reflect.ValueOf(RenderUnauthorized),
	"SetMOTDHTML":                   reflect.ValueOf(SetMOTDHTML),
	"SetMOTDHTMLForLocale":          reflect.ValueOf(SetMOTDHTMLForLocale),
	"SetMOTDMainLocale":             reflect.ValueOf(SetMOTDMainLocale),
	"SetMOTDPriority":               reflect.ValueOf(SetMOTDPriority),
}
View Source
var Types = map[string]reflect.Type{
	"Announcement":            reflect.TypeOf((*Announcement)(nil)).Elem(),
	"AuthTest":                reflect.TypeOf((*AuthTest)(nil)).Elem(),
	"Backers":                 reflect.TypeOf((*Backers)(nil)).Elem(),
	"Connection":              reflect.TypeOf((*Connection)(nil)).Elem(),
	"Dataset":                 reflect.TypeOf((*Dataset)(nil)).Elem(),
	"Disturbance":             reflect.TypeOf((*Disturbance)(nil)).Elem(),
	"DisturbanceReport":       reflect.TypeOf((*DisturbanceReport)(nil)).Elem(),
	"Feedback":                reflect.TypeOf((*Feedback)(nil)).Elem(),
	"Gateway":                 reflect.TypeOf((*Gateway)(nil)).Elem(),
	"Line":                    reflect.TypeOf((*Line)(nil)).Elem(),
	"LineCondition":           reflect.TypeOf((*LineCondition)(nil)).Elem(),
	"Lobby":                   reflect.TypeOf((*Lobby)(nil)).Elem(),
	"MQTTGatewayInfoProvider": reflect.TypeOf((*MQTTGatewayInfoProvider)(nil)).Elem(),
	"Map":                     reflect.TypeOf((*Map)(nil)).Elem(),
	"Meta":                    reflect.TypeOf((*Meta)(nil)).Elem(),
	"Network":                 reflect.TypeOf((*Network)(nil)).Elem(),
	"POI":                     reflect.TypeOf((*POI)(nil)).Elem(),
	"Pair":                    reflect.TypeOf((*Pair)(nil)).Elem(),
	"PairConnection":          reflect.TypeOf((*PairConnection)(nil)).Elem(),
	"PairConnectionHandler":   reflect.TypeOf((*PairConnectionHandler)(nil)).Elem(),
	"Realtime":                reflect.TypeOf((*Realtime)(nil)).Elem(),
	"RealtimeStatsHandler":    reflect.TypeOf((*RealtimeStatsHandler)(nil)).Elem(),
	"RealtimeVehicleHandler":  reflect.TypeOf((*RealtimeVehicleHandler)(nil)).Elem(),
	"ReportHandler":           reflect.TypeOf((*ReportHandler)(nil)).Elem(),
	"Station":                 reflect.TypeOf((*Station)(nil)).Elem(),
	"Stats":                   reflect.TypeOf((*Stats)(nil)).Elem(),
	"StatsCalculator":         reflect.TypeOf((*StatsCalculator)(nil)).Elem(),
	"Transfer":                reflect.TypeOf((*Transfer)(nil)).Elem(),
	"Trip":                    reflect.TypeOf((*Trip)(nil)).Elem(),
}
View Source
var Variables = map[string]reflect.Value{
	"EnableMQTTGateway": reflect.ValueOf(&EnableMQTTGateway),
}

Functions

func ClearMOTD

func ClearMOTD()

ClearMOTD resets motd

func RegisterPairConnectionHandler

func RegisterPairConnectionHandler(handler PairConnectionHandler)

RegisterPairConnectionHandler registers a pair connection handler

func RenderData

func RenderData(c *yarf.Context, data interface{}, cacheControl string)

RenderData takes a interface{} object and writes the encoded representation of it. Encoding used will be idented JSON, non-idented JSON, Msgpack or XML

func RenderMsgpack

func RenderMsgpack(c *yarf.Context, data interface{})

RenderMsgpack takes a interface{} object and writes the Msgpack encoded string of it.

func RenderUnauthorized

func RenderUnauthorized(c *yarf.Context)

RenderUnauthorized writes a 401 unauthorized to the response and requests authentication

func SetMOTDHTML

func SetMOTDHTML(v map[string]string)

SetMOTDHTML sets motd.HTML

func SetMOTDHTMLForLocale

func SetMOTDHTMLForLocale(locale, message string)

SetMOTDHTMLForLocale sets motd.HTML for locale

func SetMOTDMainLocale

func SetMOTDMainLocale(v string)

SetMOTDMainLocale sets motd.MainLocale

func SetMOTDPriority

func SetMOTDPriority(v int)

SetMOTDPriority sets motd.Priority

Types

type AndroidClientConfig

type AndroidClientConfig struct {
	// contains filtered or unexported fields
}

AndroidClientConfig composites resource

func (*AndroidClientConfig) AuthenticateClient

func (r *AndroidClientConfig) AuthenticateClient(c *yarf.Context) (pair *types.APIPair, err error)

AuthenticateClient authenticates a API client

func (*AndroidClientConfig) Beginx

func (r *AndroidClientConfig) Beginx() (sqalx.Node, error)

Beginx is shorthand for resource.node.Beginx()

func (*AndroidClientConfig) DecodeRequest

func (r *AndroidClientConfig) DecodeRequest(c *yarf.Context, v interface{}) error

DecodeRequest decodes a request according to its headers and places the result in v

func (*AndroidClientConfig) Get

Get serves HTTP GET requests on this resource

func (*AndroidClientConfig) WithNode

WithNode associates a sqalx Node with this resource

type Announcement

type Announcement struct {
	// contains filtered or unexported fields
}

Announcement composites resource

func (*Announcement) AuthenticateClient

func (r *Announcement) AuthenticateClient(c *yarf.Context) (pair *types.APIPair, err error)

AuthenticateClient authenticates a API client

func (*Announcement) Beginx

func (r *Announcement) Beginx() (sqalx.Node, error)

Beginx is shorthand for resource.node.Beginx()

func (*Announcement) DecodeRequest

func (r *Announcement) DecodeRequest(c *yarf.Context, v interface{}) error

DecodeRequest decodes a request according to its headers and places the result in v

func (*Announcement) Get

func (r *Announcement) Get(c *yarf.Context) error

Get serves HTTP GET requests on this resource

func (*Announcement) WithAnnouncementStore

func (r *Announcement) WithAnnouncementStore(store types.AnnouncementStore) *Announcement

WithAnnouncementStore associates an AnnouncementStore with this resource

type AuthTest

type AuthTest struct {
	// contains filtered or unexported fields
}

AuthTest composites resource

func (*AuthTest) AuthenticateClient

func (r *AuthTest) AuthenticateClient(c *yarf.Context) (pair *types.APIPair, err error)

AuthenticateClient authenticates a API client

func (*AuthTest) Beginx

func (r *AuthTest) Beginx() (sqalx.Node, error)

Beginx is shorthand for resource.node.Beginx()

func (*AuthTest) DecodeRequest

func (r *AuthTest) DecodeRequest(c *yarf.Context, v interface{}) error

DecodeRequest decodes a request according to its headers and places the result in v

func (*AuthTest) Get

func (r *AuthTest) Get(c *yarf.Context) error

Get serves HTTP GET requests on this resource

func (*AuthTest) WithHashKey

func (r *AuthTest) WithHashKey(key []byte) *AuthTest

WithHashKey associates a HMAC key with this resource so it can participate in authentication processes

func (*AuthTest) WithNode

func (r *AuthTest) WithNode(node sqalx.Node) *AuthTest

WithNode associates a sqalx Node with this resource

type Backers

type Backers struct {
	// contains filtered or unexported fields
}

Backers composites resource

func (*Backers) AuthenticateClient

func (r *Backers) AuthenticateClient(c *yarf.Context) (pair *types.APIPair, err error)

AuthenticateClient authenticates a API client

func (*Backers) Beginx

func (r *Backers) Beginx() (sqalx.Node, error)

Beginx is shorthand for resource.node.Beginx()

func (*Backers) DecodeRequest

func (r *Backers) DecodeRequest(c *yarf.Context, v interface{}) error

DecodeRequest decodes a request according to its headers and places the result in v

func (*Backers) Get

func (r *Backers) Get(c *yarf.Context) error

Get serves HTTP GET requests on this resource

func (*Backers) Head

func (r *Backers) Head(c *yarf.Context) error

Head serves HTTP HEAD requests on this resource

type Connection

type Connection struct {
	// contains filtered or unexported fields
}

Connection composites resource

func (*Connection) AuthenticateClient

func (r *Connection) AuthenticateClient(c *yarf.Context) (pair *types.APIPair, err error)

AuthenticateClient authenticates a API client

func (*Connection) Beginx

func (r *Connection) Beginx() (sqalx.Node, error)

Beginx is shorthand for resource.node.Beginx()

func (*Connection) DecodeRequest

func (r *Connection) DecodeRequest(c *yarf.Context, v interface{}) error

DecodeRequest decodes a request according to its headers and places the result in v

func (*Connection) Get

func (r *Connection) Get(c *yarf.Context) error

Get serves HTTP GET requests on this resource

func (*Connection) WithNode

func (r *Connection) WithNode(node sqalx.Node) *Connection

WithNode associates a sqalx Node with this resource

type Dataset

type Dataset struct {
	// contains filtered or unexported fields
}

Dataset composites resource

func (*Dataset) AuthenticateClient

func (r *Dataset) AuthenticateClient(c *yarf.Context) (pair *types.APIPair, err error)

AuthenticateClient authenticates a API client

func (*Dataset) Beginx

func (r *Dataset) Beginx() (sqalx.Node, error)

Beginx is shorthand for resource.node.Beginx()

func (*Dataset) DecodeRequest

func (r *Dataset) DecodeRequest(c *yarf.Context, v interface{}) error

DecodeRequest decodes a request according to its headers and places the result in v

func (*Dataset) Get

func (r *Dataset) Get(c *yarf.Context) error

Get serves HTTP GET requests on this resource

func (*Dataset) WithNode

func (r *Dataset) WithNode(node sqalx.Node) *Dataset

WithNode associates a sqalx Node with this resource

func (*Dataset) WithSquirrel

func (r *Dataset) WithSquirrel(sdb *sq.StatementBuilderType) *Dataset

WithSquirrel associates a statement builder with this resource

type Disturbance

type Disturbance struct {
	// contains filtered or unexported fields
}

Disturbance composites resource

func (*Disturbance) AuthenticateClient

func (r *Disturbance) AuthenticateClient(c *yarf.Context) (pair *types.APIPair, err error)

AuthenticateClient authenticates a API client

func (*Disturbance) Beginx

func (r *Disturbance) Beginx() (sqalx.Node, error)

Beginx is shorthand for resource.node.Beginx()

func (*Disturbance) DecodeRequest

func (r *Disturbance) DecodeRequest(c *yarf.Context, v interface{}) error

DecodeRequest decodes a request according to its headers and places the result in v

func (*Disturbance) Get

func (r *Disturbance) Get(c *yarf.Context) error

Get serves HTTP GET requests on this resource

func (*Disturbance) WithNode

func (r *Disturbance) WithNode(node sqalx.Node) *Disturbance

WithNode associates a sqalx Node with this resource

type DisturbanceReport

type DisturbanceReport struct {
	// contains filtered or unexported fields
}

DisturbanceReport composites resource

func (*DisturbanceReport) AuthenticateClient

func (r *DisturbanceReport) AuthenticateClient(c *yarf.Context) (pair *types.APIPair, err error)

AuthenticateClient authenticates a API client

func (*DisturbanceReport) Beginx

func (r *DisturbanceReport) Beginx() (sqalx.Node, error)

Beginx is shorthand for resource.node.Beginx()

func (*DisturbanceReport) DecodeRequest

func (r *DisturbanceReport) DecodeRequest(c *yarf.Context, v interface{}) error

DecodeRequest decodes a request according to its headers and places the result in v

func (*DisturbanceReport) Post

func (r *DisturbanceReport) Post(c *yarf.Context) error

Post serves HTTP POST requests on this resource

func (*DisturbanceReport) WithHashKey

func (r *DisturbanceReport) WithHashKey(key []byte) *DisturbanceReport

WithHashKey associates a HMAC key with this resource so it can participate in authentication processes

func (*DisturbanceReport) WithNode

func (r *DisturbanceReport) WithNode(node sqalx.Node) *DisturbanceReport

WithNode associates a sqalx Node with this resource

func (*DisturbanceReport) WithReportHandler

func (r *DisturbanceReport) WithReportHandler(handler ReportHandler) *DisturbanceReport

WithReportHandler associates a ReportsHandler with this resource

type Feedback

type Feedback struct {
	// contains filtered or unexported fields
}

Feedback composites resource

func (*Feedback) AuthenticateClient

func (r *Feedback) AuthenticateClient(c *yarf.Context) (pair *types.APIPair, err error)

AuthenticateClient authenticates a API client

func (*Feedback) Beginx

func (r *Feedback) Beginx() (sqalx.Node, error)

Beginx is shorthand for resource.node.Beginx()

func (*Feedback) DecodeRequest

func (r *Feedback) DecodeRequest(c *yarf.Context, v interface{}) error

DecodeRequest decodes a request according to its headers and places the result in v

func (*Feedback) Post

func (r *Feedback) Post(c *yarf.Context) error

Post serves HTTP POST requests on this resource

func (*Feedback) WithHashKey

func (r *Feedback) WithHashKey(key []byte) *Feedback

WithHashKey associates a HMAC key with this resource so it can participate in authentication processes

func (*Feedback) WithNode

func (r *Feedback) WithNode(node sqalx.Node) *Feedback

WithNode associates a sqalx Node with this resource

type Gateway

type Gateway struct {
	// contains filtered or unexported fields
}

Gateway composites resource Gateways are the UnderLX's form of real-time communication between server and clients They are used to support communication paradigms that are poorly supported by conventional HTTP, such as publish-subscribe or unreliable connections (as in UDP)

func (*Gateway) AuthenticateClient

func (r *Gateway) AuthenticateClient(c *yarf.Context) (pair *types.APIPair, err error)

AuthenticateClient authenticates a API client

func (*Gateway) Beginx

func (r *Gateway) Beginx() (sqalx.Node, error)

Beginx is shorthand for resource.node.Beginx()

func (*Gateway) DecodeRequest

func (r *Gateway) DecodeRequest(c *yarf.Context, v interface{}) error

DecodeRequest decodes a request according to its headers and places the result in v

func (*Gateway) Get

func (r *Gateway) Get(c *yarf.Context) error

Get serves HTTP GET requests on this resource

func (*Gateway) RegisterMQTTGateway

func (r *Gateway) RegisterMQTTGateway(mqtt MQTTGatewayInfoProvider) *Gateway

RegisterMQTTGateway associates another MQTTGateway with this resource

type Line

type Line struct {
	// contains filtered or unexported fields
}

Line composites resource

func (*Line) AuthenticateClient

func (r *Line) AuthenticateClient(c *yarf.Context) (pair *types.APIPair, err error)

AuthenticateClient authenticates a API client

func (*Line) Beginx

func (r *Line) Beginx() (sqalx.Node, error)

Beginx is shorthand for resource.node.Beginx()

func (*Line) DecodeRequest

func (r *Line) DecodeRequest(c *yarf.Context, v interface{}) error

DecodeRequest decodes a request according to its headers and places the result in v

func (*Line) Get

func (r *Line) Get(c *yarf.Context) error

Get serves HTTP GET requests on this resource

func (*Line) WithNode

func (r *Line) WithNode(node sqalx.Node) *Line

WithNode associates a sqalx Node with this resource

type LineCondition

type LineCondition struct {
	// contains filtered or unexported fields
}

LineCondition composites resource

func (*LineCondition) AuthenticateClient

func (r *LineCondition) AuthenticateClient(c *yarf.Context) (pair *types.APIPair, err error)

AuthenticateClient authenticates a API client

func (*LineCondition) Beginx

func (r *LineCondition) Beginx() (sqalx.Node, error)

Beginx is shorthand for resource.node.Beginx()

func (*LineCondition) DecodeRequest

func (r *LineCondition) DecodeRequest(c *yarf.Context, v interface{}) error

DecodeRequest decodes a request according to its headers and places the result in v

func (*LineCondition) Get

func (r *LineCondition) Get(c *yarf.Context) error

Get serves HTTP GET requests on this resource

func (*LineCondition) WithNode

func (r *LineCondition) WithNode(node sqalx.Node) *LineCondition

WithNode associates a sqalx Node with this resource

type Lobby

type Lobby struct {
	// contains filtered or unexported fields
}

Lobby composites resource

func (*Lobby) AuthenticateClient

func (r *Lobby) AuthenticateClient(c *yarf.Context) (pair *types.APIPair, err error)

AuthenticateClient authenticates a API client

func (*Lobby) Beginx

func (r *Lobby) Beginx() (sqalx.Node, error)

Beginx is shorthand for resource.node.Beginx()

func (*Lobby) DecodeRequest

func (r *Lobby) DecodeRequest(c *yarf.Context, v interface{}) error

DecodeRequest decodes a request according to its headers and places the result in v

func (*Lobby) Get

func (r *Lobby) Get(c *yarf.Context) error

Get serves HTTP GET requests on this resource

func (*Lobby) WithNode

func (r *Lobby) WithNode(node sqalx.Node) *Lobby

WithNode associates a sqalx Node with this resource

type MQTTGatewayInfoProvider

type MQTTGatewayInfoProvider interface {
	Hostname() string
	Port() uint16
	IsTLS() bool
	MQTTVersion() string
}

MQTTGatewayInfoProvider contains the methods the Gateway resource uses to provide information about a MQTTGateway

type Map

type Map struct {
	// contains filtered or unexported fields
}

Map composites resource

func (*Map) AuthenticateClient

func (r *Map) AuthenticateClient(c *yarf.Context) (pair *types.APIPair, err error)

AuthenticateClient authenticates a API client

func (*Map) Beginx

func (r *Map) Beginx() (sqalx.Node, error)

Beginx is shorthand for resource.node.Beginx()

func (*Map) DecodeRequest

func (r *Map) DecodeRequest(c *yarf.Context, v interface{}) error

DecodeRequest decodes a request according to its headers and places the result in v

func (*Map) Get

func (r *Map) Get(c *yarf.Context) error

Get serves HTTP GET requests on this resource

func (*Map) WithNode

func (r *Map) WithNode(node sqalx.Node) *Map

WithNode associates a sqalx Node with this resource

type Meta

type Meta struct {
	// contains filtered or unexported fields
}

Meta composites resource

func (*Meta) AuthenticateClient

func (r *Meta) AuthenticateClient(c *yarf.Context) (pair *types.APIPair, err error)

AuthenticateClient authenticates a API client

func (*Meta) Beginx

func (r *Meta) Beginx() (sqalx.Node, error)

Beginx is shorthand for resource.node.Beginx()

func (*Meta) DecodeRequest

func (r *Meta) DecodeRequest(c *yarf.Context, v interface{}) error

DecodeRequest decodes a request according to its headers and places the result in v

func (*Meta) Get

func (r *Meta) Get(c *yarf.Context) error

Get serves HTTP GET requests on this resource

func (*Meta) WithNode

func (r *Meta) WithNode(node sqalx.Node) *Meta

WithNode associates a sqalx Node with this resource

type Network

type Network struct {
	// contains filtered or unexported fields
}

Network composites resource

func (*Network) AuthenticateClient

func (r *Network) AuthenticateClient(c *yarf.Context) (pair *types.APIPair, err error)

AuthenticateClient authenticates a API client

func (*Network) Beginx

func (r *Network) Beginx() (sqalx.Node, error)

Beginx is shorthand for resource.node.Beginx()

func (*Network) DecodeRequest

func (r *Network) DecodeRequest(c *yarf.Context, v interface{}) error

DecodeRequest decodes a request according to its headers and places the result in v

func (*Network) Get

func (r *Network) Get(c *yarf.Context) error

Get serves HTTP GET requests on this resource

func (*Network) WithNode

func (r *Network) WithNode(node sqalx.Node) *Network

WithNode associates a sqalx Node with this resource

type POI

type POI struct {
	// contains filtered or unexported fields
}

POI composites resource

func (*POI) AuthenticateClient

func (r *POI) AuthenticateClient(c *yarf.Context) (pair *types.APIPair, err error)

AuthenticateClient authenticates a API client

func (*POI) Beginx

func (r *POI) Beginx() (sqalx.Node, error)

Beginx is shorthand for resource.node.Beginx()

func (*POI) DecodeRequest

func (r *POI) DecodeRequest(c *yarf.Context, v interface{}) error

DecodeRequest decodes a request according to its headers and places the result in v

func (*POI) Get

func (r *POI) Get(c *yarf.Context) error

Get serves HTTP GET requests on this resource

func (*POI) WithNode

func (r *POI) WithNode(node sqalx.Node) *POI

WithNode associates a sqalx Node with this resource

type Pair

type Pair struct {
	// contains filtered or unexported fields
}

Pair composites resource

func (*Pair) AuthenticateClient

func (r *Pair) AuthenticateClient(c *yarf.Context) (pair *types.APIPair, err error)

AuthenticateClient authenticates a API client

func (*Pair) Beginx

func (r *Pair) Beginx() (sqalx.Node, error)

Beginx is shorthand for resource.node.Beginx()

func (*Pair) DecodeRequest

func (r *Pair) DecodeRequest(c *yarf.Context, v interface{}) error

DecodeRequest decodes a request according to its headers and places the result in v

func (*Pair) Post

func (r *Pair) Post(c *yarf.Context) (err error)

Post serves HTTP POST requests on this resource

func (*Pair) WithHashKey

func (r *Pair) WithHashKey(key []byte) *Pair

WithHashKey associates a HMAC key with this resource so it can participate in authentication processes

func (*Pair) WithNode

func (r *Pair) WithNode(node sqalx.Node) *Pair

WithNode associates a sqalx Node with this resource

func (*Pair) WithPublicKey

func (r *Pair) WithPublicKey(key *ecdsa.PublicKey) *Pair

WithPublicKey associates a trusted client public key with this resource

func (*Pair) WithTelemetryChannel

func (r *Pair) WithTelemetryChannel(c chan bool) *Pair

WithTelemetryChannel associates a telemetry channel with this resource

type PairConnection

type PairConnection struct {
	// contains filtered or unexported fields
}

PairConnection composites resource

func (*PairConnection) AuthenticateClient

func (r *PairConnection) AuthenticateClient(c *yarf.Context) (pair *types.APIPair, err error)

AuthenticateClient authenticates a API client

func (*PairConnection) Beginx

func (r *PairConnection) Beginx() (sqalx.Node, error)

Beginx is shorthand for resource.node.Beginx()

func (*PairConnection) DecodeRequest

func (r *PairConnection) DecodeRequest(c *yarf.Context, v interface{}) error

DecodeRequest decodes a request according to its headers and places the result in v

func (*PairConnection) Get

func (r *PairConnection) Get(c *yarf.Context) error

Get serves HTTP GET requests on this resource

func (*PairConnection) Post

func (r *PairConnection) Post(c *yarf.Context) error

Post serves HTTP POST requests on this resource

func (*PairConnection) WithHashKey

func (r *PairConnection) WithHashKey(key []byte) *PairConnection

WithHashKey associates a HMAC key with this resource so it can participate in authentication processes

func (*PairConnection) WithNode

func (r *PairConnection) WithNode(node sqalx.Node) *PairConnection

WithNode associates a sqalx Node with this resource

type PairConnectionHandler

type PairConnectionHandler interface {
	ID() string
	TryCreateConnection(node sqalx.Node, code, deviceName string, pair *types.APIPair) bool
	GetConnectionsForPair(node sqalx.Node, pair *types.APIPair) ([]types.PairConnection, error)
	DisplayName() string
}

PairConnectionHandler handles connections of APIPairs with external first-party services and subsystems

type Realtime

type Realtime struct {
	// contains filtered or unexported fields
}

Realtime composites resource, handles real-time location submissions

func (*Realtime) AuthenticateClient

func (r *Realtime) AuthenticateClient(c *yarf.Context) (pair *types.APIPair, err error)

AuthenticateClient authenticates a API client

func (*Realtime) Beginx

func (r *Realtime) Beginx() (sqalx.Node, error)

Beginx is shorthand for resource.node.Beginx()

func (*Realtime) DecodeRequest

func (r *Realtime) DecodeRequest(c *yarf.Context, v interface{}) error

DecodeRequest decodes a request according to its headers and places the result in v

func (*Realtime) Post

func (r *Realtime) Post(c *yarf.Context) error

Post serves HTTP POST requests on this resource

func (*Realtime) WithHashKey

func (r *Realtime) WithHashKey(key []byte) *Realtime

WithHashKey associates a HMAC key with this resource so it can participate in authentication processes

func (*Realtime) WithNode

func (r *Realtime) WithNode(node sqalx.Node) *Realtime

WithNode associates a sqalx Node with this resource

func (*Realtime) WithStatsHandler

func (r *Realtime) WithStatsHandler(handler RealtimeStatsHandler) *Realtime

WithStatsHandler associates a RealtimeStatsHandler with this resource

func (*Realtime) WithVehicleHandler

func (r *Realtime) WithVehicleHandler(handler RealtimeVehicleHandler) *Realtime

WithVehicleHandler associates a RealtimeVehicleHandler with this resource

type RealtimeStatsHandler

type RealtimeStatsHandler interface {
	RegisterActivity(lines []*types.Line, user *types.APIPair, justEntered bool)
}

RealtimeStatsHandler handles real-time network statistics such as the number of users in transit

type RealtimeVehicleHandler

type RealtimeVehicleHandler interface {
	RegisterTrainPassenger(currentStation *types.Station, direction *types.Station)
}

RealtimeVehicleHandler handles real-time vehicle information such as the position of trains in a network

type ReportHandler

type ReportHandler interface {
	HandleLineDisturbanceReport(report *types.LineDisturbanceReport) error
}

ReportHandler handles user reports such as service disturbances

type Station

type Station struct {
	// contains filtered or unexported fields
}

Station composites resource

func (*Station) AuthenticateClient

func (r *Station) AuthenticateClient(c *yarf.Context) (pair *types.APIPair, err error)

AuthenticateClient authenticates a API client

func (*Station) Beginx

func (r *Station) Beginx() (sqalx.Node, error)

Beginx is shorthand for resource.node.Beginx()

func (*Station) DecodeRequest

func (r *Station) DecodeRequest(c *yarf.Context, v interface{}) error

DecodeRequest decodes a request according to its headers and places the result in v

func (*Station) Get

func (r *Station) Get(c *yarf.Context) error

Get serves HTTP GET requests on this resource

func (*Station) WithNode

func (r *Station) WithNode(node sqalx.Node) *Station

WithNode associates a sqalx Node with this resource

type Stats

type Stats struct {
	// contains filtered or unexported fields
}

Stats composites resource

func (*Stats) AuthenticateClient

func (r *Stats) AuthenticateClient(c *yarf.Context) (pair *types.APIPair, err error)

AuthenticateClient authenticates a API client

func (*Stats) Beginx

func (r *Stats) Beginx() (sqalx.Node, error)

Beginx is shorthand for resource.node.Beginx()

func (*Stats) DecodeRequest

func (r *Stats) DecodeRequest(c *yarf.Context, v interface{}) error

DecodeRequest decodes a request according to its headers and places the result in v

func (*Stats) Get

func (r *Stats) Get(c *yarf.Context) error

Get serves HTTP GET requests on this resource

func (*Stats) WithNode

func (r *Stats) WithNode(node sqalx.Node) *Stats

WithNode associates a sqalx Node with this resource

func (*Stats) WithStats

func (r *Stats) WithStats(calculator StatsCalculator) *Stats

WithStats associates a StatsCalculator with this resource

type StatsCalculator

type StatsCalculator interface {
	OITInNetwork(network *types.Network, approximateTo int) int
	OITInLine(line *types.Line, approximateTo int) int
}

StatsCalculator calculates general statistics about a network or part of a network

type Transfer

type Transfer struct {
	// contains filtered or unexported fields
}

Transfer composites resource

func (*Transfer) AuthenticateClient

func (r *Transfer) AuthenticateClient(c *yarf.Context) (pair *types.APIPair, err error)

AuthenticateClient authenticates a API client

func (*Transfer) Beginx

func (r *Transfer) Beginx() (sqalx.Node, error)

Beginx is shorthand for resource.node.Beginx()

func (*Transfer) DecodeRequest

func (r *Transfer) DecodeRequest(c *yarf.Context, v interface{}) error

DecodeRequest decodes a request according to its headers and places the result in v

func (*Transfer) Get

func (r *Transfer) Get(c *yarf.Context) error

Get serves HTTP GET requests on this resource

func (*Transfer) WithNode

func (r *Transfer) WithNode(node sqalx.Node) *Transfer

WithNode associates a sqalx Node with this resource

type Trip

type Trip struct {
	// contains filtered or unexported fields
}

Trip composites resource

func (*Trip) AuthenticateClient

func (r *Trip) AuthenticateClient(c *yarf.Context) (pair *types.APIPair, err error)

AuthenticateClient authenticates a API client

func (*Trip) Beginx

func (r *Trip) Beginx() (sqalx.Node, error)

Beginx is shorthand for resource.node.Beginx()

func (*Trip) DecodeRequest

func (r *Trip) DecodeRequest(c *yarf.Context, v interface{}) error

DecodeRequest decodes a request according to its headers and places the result in v

func (*Trip) Get

func (r *Trip) Get(c *yarf.Context) error

Get serves HTTP GET requests on this resource

func (*Trip) Post

func (r *Trip) Post(c *yarf.Context) error

Post serves HTTP POST requests on this resource

func (*Trip) Put

func (r *Trip) Put(c *yarf.Context) error

Put serves HTTP PUT requests on this resource

func (*Trip) WithHashKey

func (r *Trip) WithHashKey(key []byte) *Trip

WithHashKey associates a HMAC key with this resource so it can participate in authentication processes

func (*Trip) WithNode

func (r *Trip) WithNode(node sqalx.Node) *Trip

WithNode associates a sqalx Node with this resource

Jump to

Keyboard shortcuts

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