Documentation
¶
Index ¶
- type Collection
- type LifeCycleEvent
- type LifecycleEvent
- type LifecycleEventDetails
- type OutputEntry
- type Position
- type PositionEvent
- type PositionEventDetails
- type Shape
- type ShapeCollection
- type Subscription
- type SubscriptionEvent
- type SubscriptionEventDetails
- type Team
- type Token
- type TrackableEntry
- type Tracker
- type TriggerCriteria
- type TriggerDetails
- type User
- type WebsocketKeepAlive
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collection ¶
type Collection struct { ID int64 `json:"id"` TeamID int64 `json:"teamId"` Name string `json:"name"` Description string `json:"description"` }
Collection is the API representation of a collection
func NewCollectionFromModel ¶
func NewCollectionFromModel(collectionModel *model.Collection) *Collection
NewCollectionFromModel creates a HTTP representation of a model collection
func (*Collection) MarshalJSON ¶
func (collection *Collection) MarshalJSON() ([]byte, error)
MarshalJSON marshals a JSON string from the API representation
func (*Collection) ToModel ¶
func (collection *Collection) ToModel() *model.Collection
ToModel creates a storage model from the API representation
type LifeCycleEvent ¶
type LifeCycleEvent struct { Type event.EventType `json:"type"` Data LifecycleEventDetails `json:"data"` }
LifeCycleEvent wraps an event with a type identifier to help distinguish the event from other events
type LifecycleEvent ¶
type LifecycleEvent struct { Type event.EventType `json:"type"` Data LifecycleEventDetails `json:"data"` }
LifecycleEvent wraps an event with a type to help distinguish the event
func NewLifecycleEventFromModel ¶
func NewLifecycleEventFromModel(lifecycleEventModel *event.LifeCycleEvent) *LifecycleEvent
NewLifecycleEventFromModel returns a new service LifecycleEvent from a model
type LifecycleEventDetails ¶
type LifecycleEventDetails struct { Type event.LifeCycleEventType `json:"type"` EntityType event.EntityType `json:"entityType"` EntityID int64 `json:"entityId"` }
LifecycleEventDetails is a struct to be used for events triggered by a lifecycle change
type OutputEntry ¶
type OutputEntry struct { Type sub.OutputType `json:"type"` Config output.Config `json:"config"` }
OutputEntry contains information about the subscriptions output
type Position ¶
type Position struct { ID int64 `json:"id"` TrackerID int64 `json:"trackerId"` Timestamp *int64 `json:"timestamp"` Lat *float64 `json:"lat"` Long *float64 `json:"lng"` Alt *float64 `json:"alt"` Heading *float64 `json:"heading"` Speed *float64 `json:"speed"` Payload []byte `json:"payload"` Precision *float64 `json:"precision"` }
Position is the API representation of a position
func NewPositionFromModel ¶
NewPositionFromModel creates a HTTP representation of a model collection
func (*Position) MarshalJSON ¶
MarshalJSON marshals a JSON string from the API representation
type PositionEvent ¶
type PositionEvent struct { Type event.EventType `json:"type"` Data PositionEventDetails `json:"data"` }
PositionEvent wraps an event with a type to help distinguish the event
func NewPositionEventFromModel ¶
func NewPositionEventFromModel(positionEventModel *event.PositionEvent) *PositionEvent
NewPositionEventFromModel returns a new service PositionEvent from a model
func (*PositionEvent) EventType ¶
func (positionEvent *PositionEvent) EventType() event.EventType
EventType returns the Position event type
type PositionEventDetails ¶
type PositionEventDetails struct { CollectionID int64 `json:"collectionId"` TrackerID int64 `json:"trackerId"` Position *Position `json:"position"` }
PositionEventDetails is a struct to be used for events triggered by a new position
type Shape ¶
type Shape struct { ID int64 `json:"id"` ShapeCollectionID int64 `json:"shapeCollectionId"` Name string `json:"name"` Properties geometry.ShapeProperties `json:"properties"` }
Shape is the API representation of a shape
func NewShapeFromModel ¶
NewShapeFromModel creates a HTTP representation of a model shape
func (*Shape) MarshalJSON ¶
MarshalJSON marshals a JSON string from the API representation
type ShapeCollection ¶
type ShapeCollection struct { ID int64 `json:"id"` TeamID int64 `json:"teamId"` Name string `json:"name"` Description string `json:"description"` }
ShapeCollection is the API representation of a shape collection
func NewShapeCollectionFromModel ¶
func NewShapeCollectionFromModel(shapeCollectionModel *model.ShapeCollection) *ShapeCollection
NewShapeCollectionFromModel creates a HTTP representation of a model shape collection
func (*ShapeCollection) MarshalJSON ¶
func (shapeCollection *ShapeCollection) MarshalJSON() ([]byte, error)
MarshalJSON marshals a JSON string from the API representation
func (*ShapeCollection) ToModel ¶
func (shapeCollection *ShapeCollection) ToModel() *model.ShapeCollection
ToModel creates a storage model from the API representation
type Subscription ¶
type Subscription struct { ID int64 `json:"id"` TeamID *int64 `json:"teamId"` Name string `json:"name"` Description string `json:"description"` Active bool `json:"active"` Output OutputEntry `json:"output"` TriggerCriteria TriggerCriteria `json:"triggerCriteria"` ShapeCollectionID *int64 `json:"shapeCollectionId"` Trackable TrackableEntry `json:"trackable"` }
Subscription is a representation of subscription for a collection or tracker towards a output
func NewSubscription ¶
func NewSubscription() Subscription
NewSubscription returns a new instance of Subscription
func NewSubscriptionFromModel ¶
func NewSubscriptionFromModel(subscriptionModel *model.Subscription) *Subscription
NewSubscriptionFromModel creates a HTTP representation of a model subscription
func (*Subscription) MarshalJSON ¶
func (subscription *Subscription) MarshalJSON() ([]byte, error)
MarshalJSON marshals a JSON string from the API representation
func (*Subscription) ToModel ¶
func (subscription *Subscription) ToModel() *model.Subscription
ToModel creates a storage model from the API representation
type SubscriptionEvent ¶
type SubscriptionEvent struct { Type event.EventType `json:"type"` Data SubscriptionEventDetails `json:"data"` }
SubscriptionEvent wraps an event with a type to help distinguish the event
func NewSubscriptionEventFromModel ¶
func NewSubscriptionEventFromModel(subscriptionEvent *event.SubscriptionEvent) *SubscriptionEvent
NewSubscriptionEventFromModel returns a new service SubscriptionEvent from a model
func (*SubscriptionEvent) EventType ¶
func (subscriptionEvent *SubscriptionEvent) EventType() event.EventType
EventType returns the Position event type
type SubscriptionEventDetails ¶
type SubscriptionEventDetails struct { SubscriptionID int64 `json:"subscriptionId"` Position *Position `json:"position"` Details TriggerDetails `json:"details"` }
SubscriptionEventDetails is a struct to be used for events triggered by a new position
type Team ¶
type Team struct { ID int64 `json:"id"` Name string `json:"name"` Description string `json:"description"` }
Team is the API representation of a team
func NewTeamFromModel ¶
NewTeamFromModel creates a HTTP representation of a model team
func (*Team) MarshalJSON ¶
MarshalJSON marshals a JSON string from the API representation
type Token ¶
type Token struct { Token string `json:"token"` Created time.Time `json:"created"` Resource string `json:"resource"` PermWrite bool `json:"permWrite"` UserID int64 `json:"-"` }
Token is the API representation of a token
func NewTokenFromModel ¶
NewTokenFromModel creates a HTTP representation of a model token
func (*Token) GenerateToken ¶
GenerateToken overwrites the current token value with a random generated hex string
func (*Token) MarshalJSON ¶
MarshalJSON marshals a JSON string from the API representation
type TrackableEntry ¶
type TrackableEntry struct { Type sub.TrackableType `json:"type"` ID *int64 `json:"id"` }
TrackableEntry contains information about the subscriptions trackable
type Tracker ¶
type Tracker struct { ID int64 `json:"id"` CollectionID int64 `json:"collectionId"` Name string `json:"name"` Description string `json:"description"` }
Tracker is the API representation of a tracker
func NewTrackerFromModel ¶
NewTrackerFromModel creates a HTTP representation of a model tracker
func (*Tracker) MarshalJSON ¶
MarshalJSON marshals a JSON string from the API representation
type TriggerCriteria ¶
type TriggerCriteria struct { TriggerTypes sub.MovementList `json:"triggerTypes"` Confidence sub.ConfidenceList `json:"confidence"` }
TriggerCriteria contains information about the
type TriggerDetails ¶
type TriggerDetails struct { Movements []string `json:"movements"` ShapecollectionID int64 `json:"shapeCollectionId"` ShapeID int64 `json:"shapeId"` }
TriggerDetails contains information about why the subscription triggered along with IDs to shapecollection and shape
type User ¶
type User struct { ID int64 `json:"id"` Name string `json:"name"` Email string `json:"email"` EmailVerified bool `json:"emailVerified"` Phone string `json:"phone"` PhoneVerified bool `json:"phoneVerified"` Created time.Time `json:"created"` }
User is the API representation of a user
func NewUserFromModel ¶
NewUserFromModel creates a HTTP representation of a model user
func (*User) MarshalJSON ¶
MarshalJSON marshals a JSON string from the API representation
type WebsocketKeepAlive ¶
type WebsocketKeepAlive struct {
Type string `json:"type"`
}
WebsocketKeepAlive is a simple keepAlive heartbeat to be used to keep a long lived websocket connection going
func NewWebsocketKeepAlive ¶
func NewWebsocketKeepAlive() *WebsocketKeepAlive
NewWebsocketKeepAlive returns a default heartbeat websocket keepAlive struct