sub

package
v0.0.0-...-ae1d368 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

ValidConfidenceTypes is a list of valid movement types

View Source
var ValidMovementTypes = []MovementType{Entered, Inside, Exited, Outside}

ValidMovementTypes is a list of valid movement types

View Source
var ValidOutputTypes = []OutputType{SMS, Webhook, WebSocket}

ValidOutputTypes is a list of valid OutputTypes for the subscriptions

View Source
var ValidTrackableTypes = []TrackableType{Tracker, Collection}

ValidTrackableTypes is a list of valid trackable types

Functions

This section is empty.

Types

type ConfidenceList

type ConfidenceList []ConfidenceType

ConfidenceList is a list of movement types

func NewConfidenceListFromModel

func NewConfidenceListFromModel(confidenceList model.ConfidenceList) ConfidenceList

NewConfidenceListFromModel

func (*ConfidenceList) Contains

func (confidenceList *ConfidenceList) Contains(confidenceCandidate ConfidenceType) bool

func (*ConfidenceList) ToModel

func (confidenceList *ConfidenceList) ToModel() model.ConfidenceList

type ConfidenceType

type ConfidenceType string

ConfidenceType is the type of movement subscription

const (
	// ConfidenceLow is the low confidence of precision [0,.5]
	ConfidenceLow ConfidenceType = "low"
	// ConfidenceMedium is the medium confidence of precision (.5,.75)
	ConfidenceMedium ConfidenceType = "medium"
	// ConfidenceHigh is the high confidence of precision [.75, 1]
	ConfidenceHigh ConfidenceType = "high"
)

func NewConfidenceFromFloat

func NewConfidenceFromFloat(precision float64) (ConfidenceType, error)

type MovementList

type MovementList []MovementType

MovementList is a list of movement types

func NewMovementList

func NewMovementList(inside bool) MovementList

NewMovementList returns a list of movements based on an inside bool param

func NewMovementTypeFromModel

func NewMovementTypeFromModel(movements model.MovementList) MovementList

NewMovementTypeFromModel returns a MovementList from model

func (*MovementList) Contains

func (movementTypes *MovementList) Contains(movementCandidate MovementType) bool

Contains checks wheter a movementTypeCandidate is contained within MovementTypes

func (*MovementList) ContainsAny

func (movementTypes *MovementList) ContainsAny(movementCandidates MovementList) bool

ContainsAny checks wheter any of given movementTypeCandidates is contained within MovementTypes

func (*MovementList) ToModel

func (movementTypes *MovementList) ToModel() model.MovementList

ToModel returns a model representation of the movement list

func (*MovementList) ToStringSlice

func (movementTypes *MovementList) ToStringSlice() []string

ToStringSlice returns a list of strings based on the movementTypes

type MovementType

type MovementType string

MovementType is the type of movement subscription

const (
	// Entered is the state when a tracker has entered a subscribed shape
	Entered MovementType = "entered"
	// Inside is the state when a tracker is inside a subscribed shape
	Inside MovementType = "inside"
	// Exited is the state when a tracker has exited a subscribed shape
	Exited MovementType = "exited"
	// Outside is the state when a tracker has exited a subscribed shape
	Outside MovementType = "outside"
)

type OutputType

type OutputType string

OutputType Type of output for a subscription

const (
	// Console print console output. Debug only.
	Console OutputType = "console"
	// SMS sets up an SMS output type
	SMS OutputType = "sms"
	// Webhook sets up a webhook output type
	Webhook OutputType = "webhook"
	// WebSocket enables simple streaming through a subscription
	WebSocket OutputType = "websocket"
)

type TrackableType

type TrackableType string

TrackableType is a trackable type

const (
	// Tracker represent a tracker as a trackable type
	Tracker TrackableType = "tracker"
	// Collection represents a collection as a trackable type
	Collection TrackableType = "collection"
)

func (*TrackableType) Scan

func (trackableType *TrackableType) Scan(src interface{}) error

Scan implements SQL scan driver

func (TrackableType) Value

func (trackableType TrackableType) Value() (driver.Value, error)

Value implements SQL value driver

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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