domain

package
v0.0.0-...-ab7c8e9 Latest Latest
Warning

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

Go to latest
Published: May 28, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetErrorMessageBytes

func GetErrorMessageBytes(message string, err error) []byte

GetErrorMessageBytes returns the bytes of the error message

Types

type ErrorMessage

type ErrorMessage struct {
	Message string
}

ErrorMessage is a wrapper type to return a JSON object with an error message

func (*ErrorMessage) Bytes

func (errorMessage *ErrorMessage) Bytes() []byte

Bytes returns the ErrorMessage JSON bytes

type Position

type Position struct {
	Lat float32 `bson:"lat" json:"lat"`

	Lng float32 `bson:"lng" json:"lng"`
}

Position contains the combined Latitude and Longitude

type PositionChangeNotification

type PositionChangeNotification struct {
	Title    string    `json:"title"`
	Position *Position `json:"position"`
}

func PositionChangeNotificationFromTransport

func PositionChangeNotificationFromTransport(transport *Transport) *PositionChangeNotification

type Transport

type Transport struct {
	ID string `bson:"_id" json:"id"`

	Description string `bson:"description" json:"description"`

	Category string `bson:"category" json:"category,omitempty"`

	LastPositionReportedAt time.Time `bson:"lastPositionReportedAt" json:"lastPositionReportedAt,omitempty"`

	CurrentPosition *Position `bson:"currentPosition" json:"currentPosition"`
}

Transport represents a Transport object

Jump to

Keyboard shortcuts

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