Documentation ¶
Index ¶
- Constants
- Variables
- type Traccargo
- func (t *Traccargo) Close()
- func (t *Traccargo) Position(deviceId int64) (position models.Position, err error)
- func (t *Traccargo) Positions() (positions []*models.Position, err error)
- func (t *Traccargo) Session() (user models.User, err error)
- func (t *Traccargo) SubscribeUpdates(handler func(m *WsMessage)) (err error)
- func (t *Traccargo) UnsubscribeUpdates()
- type WsMessage
Constants ¶
View Source
const ( ENC_URI encoding = 1 ENC_JSON encoding = 2 )
Variables ¶
View Source
var ( TRACCAR_ERROR_UNREACHABLE = errors.New("server is unreachable") TRACCAR_ERROR_AUTH = errors.New("server auth is failed") TRACCAR_ERROR_FAILED = errors.New("operation can't be performed") TRACCAR_ERROR_UNKNOWN = errors.New("unknown error") TRACCAR_ERROR_NOTFOUND = errors.New("object not found") )
Functions ¶
This section is empty.
Types ¶
type Traccargo ¶
type Traccargo struct { LogWriter io.Writer //for debug purpose. All significant operation and error events is written to this io.Writer if defined LogCommunicationWriter io.Writer //for debug purpose. All JSON responses will be written to this io.Writer if defined // contains filtered or unexported fields }
func NewTraccar ¶
creates a traccar instance
func (*Traccargo) SubscribeUpdates ¶
subscribes to live traccar updates WebSocket connection to the traccar api endpoint will be established and keeps alive the callback function calls on every update
func (*Traccargo) UnsubscribeUpdates ¶
func (t *Traccargo) UnsubscribeUpdates()
finish websocket connection and live updates subscription
Click to show internal directories.
Click to hide internal directories.