Documentation ¶
Index ¶
- type Attributes
- type Calendar
- type Client
- func (c *Client) CloseSession() error
- func (c *Client) CreateCalendar(calendar Calendar) (Calendar, error)
- func (c *Client) CreateCommand(command Command) (Command, error)
- func (c *Client) CreateComputedAttribute(attribute ComputedAttribute) (ComputedAttribute, error)
- func (c *Client) CreateDevice(device Device) (Device, error)
- func (c *Client) CreateDriver(driver Driver) (Driver, error)
- func (c *Client) CreateGeofence(geofence Geofence) (Geofence, error)
- func (c *Client) CreateGroup(group Group) (Group, error)
- func (c *Client) CreateMaintenance(maintenance Maintenance) (Maintenance, error)
- func (c *Client) CreateNotification(notification Notification) (Notification, error)
- func (c *Client) CreatePermission(request PermissionsRequest) error
- func (c *Client) CreateSession(email, password string) (user User, err error)
- func (c *Client) CreateUser(user User) (User, error)
- func (c *Client) DeleteCalendar(id int) error
- func (c *Client) DeleteCommand(id int) error
- func (c *Client) DeleteComputedAttribute(id int) error
- func (c *Client) DeleteDevice(id int) error
- func (c *Client) DeleteDriver(id int) error
- func (c *Client) DeleteGeofence(id int) error
- func (c *Client) DeleteGroup(id int) error
- func (c *Client) DeleteMaintenance(id int) error
- func (c *Client) DeleteNotification(id int) error
- func (c *Client) DeletePermission(request PermissionsRequest) error
- func (c *Client) DeleteUser(id int) error
- func (c *Client) FetchSession(token string) (user User, err error)
- func (c *Client) GetEvent(id int) (event Event, err error)
- func (c *Client) GetReportEvents(params ...QueryParameter) (events []Event, err error)
- func (c *Client) GetReportRoute(params ...QueryParameter) (route []Position, err error)
- func (c *Client) GetReportStops(params ...QueryParameter) (stops []ReportStops, err error)
- func (c *Client) GetReportSummary(params ...QueryParameter) (summary []ReportSummary, err error)
- func (c *Client) GetReportTrips(params ...QueryParameter) (trips []ReportTrips, err error)
- func (c *Client) GetServer() (server Server, err error)
- func (c *Client) GetStatistics(params ...QueryParameter) (statistics []Statistics, err error)
- func (c *Client) ListCalendars(params ...QueryParameter) (calendars []Calendar, err error)
- func (c Client) ListCommandTypes(params ...QueryParameter) (commandTypes []CommandType, err error)
- func (c *Client) ListCommands(params ...QueryParameter) (commands []Command, err error)
- func (c *Client) ListComputedAttributes(params ...QueryParameter) (attributeList []ComputedAttribute, err error)
- func (c Client) ListDeviceCommands(deviceID int) (commands []Command, err error)
- func (c *Client) ListDevices(params ...QueryParameter) (deviceList []Device, err error)
- func (c *Client) ListDrivers(params ...QueryParameter) (driverList []Driver, err error)
- func (c *Client) ListGeofences(params ...QueryParameter) (geofences []Geofence, err error)
- func (c *Client) ListGroups(params ...QueryParameter) (groups []Group, err error)
- func (c *Client) ListMaintenances(params ...QueryParameter) (maintenances []Maintenance, err error)
- func (c Client) ListNotificationTypes() (notificationTypes []NotificationType, err error)
- func (c *Client) ListNotifications(params ...QueryParameter) (notifications []Notification, err error)
- func (c *Client) ListPositions(params ...QueryParameter) (positions []Position, err error)
- func (c *Client) ListUsers(params ...QueryParameter) (users []User, err error)
- func (c *Client) SendCommand(command Command) (Command, error)
- func (c *Client) Stream(stop chan struct{}) (chan Message, error)
- func (c Client) TestNotification() error
- func (c *Client) UpdateCalendar(id int, calendar Calendar) (Calendar, error)
- func (c *Client) UpdateCommand(id int, command Command) (Command, error)
- func (c *Client) UpdateComputedAttribute(id int, attribute ComputedAttribute) (ComputedAttribute, error)
- func (c *Client) UpdateDevice(id int, device Device) (Device, error)
- func (c *Client) UpdateDeviceAccumulators(id int, accumulators DeviceAccumulators) error
- func (c *Client) UpdateDriver(id int, driver Driver) (Driver, error)
- func (c *Client) UpdateGeofence(id int, geofence Geofence) (Geofence, error)
- func (c *Client) UpdateGroup(id int, group Group) (Group, error)
- func (c *Client) UpdateMaintenance(id int, maintenance Maintenance) (Maintenance, error)
- func (c *Client) UpdateNotification(id int, notification Notification) (Notification, error)
- func (c *Client) UpdateServer(server Server) (Server, error)
- func (c *Client) UpdateUser(id int, user User) (User, error)
- type Command
- type CommandType
- type ComputedAttribute
- type ComputedAttributeType
- type Device
- type DeviceAccumulators
- type Driver
- type Event
- type Geofence
- type Group
- type Maintenance
- type Message
- type Notification
- type NotificationType
- type Option
- type PermissionsRequest
- type PermitDeviceID
- type PermitGroupID
- type PermitUserID
- func (p PermitUserID) AttributeID(id int) PermissionsRequest
- func (p PermitUserID) CalendarID(id int) PermissionsRequest
- func (p PermitUserID) DeviceID(id int) PermissionsRequest
- func (p PermitUserID) DriverID(id int) PermissionsRequest
- func (p PermitUserID) GeofenceID(id int) PermissionsRequest
- func (p PermitUserID) GroupID(id int) PermissionsRequest
- func (p PermitUserID) ManagedUserID(id int) PermissionsRequest
- type Position
- type QueryParameter
- func WithAll(val bool) QueryParameter
- func WithDeviceID(val ...int) QueryParameter
- func WithFrom(val time.Time) QueryParameter
- func WithGroupID(val ...int) QueryParameter
- func WithID(val ...int) QueryParameter
- func WithRefresh(val bool) QueryParameter
- func WithTextChannel(val bool) QueryParameter
- func WithTo(val time.Time) QueryParameter
- func WithUniqueID(val ...string) QueryParameter
- func WithUserID(val int) QueryParameter
- type ReportStops
- type ReportSummary
- type ReportTrips
- type Server
- type Statistics
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attributes ¶
type Attributes map[string]interface{}
Attributes used in a bunch of places as a metadata object
type Calendar ¶
type Calendar struct { ID int `json:"id"` Name string `json:"name"` Data string `json:"data"` Attributes Attributes `json:"attributes"` }
Calendar describes a calendar schema object
Data is the base64 encoded ical
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is an API client for Traccar
func (*Client) CreateCalendar ¶
CreateCalendar creates a Calendar
func (*Client) CreateCommand ¶
CreateCommand creates a Saved Command
func (*Client) CreateComputedAttribute ¶
func (c *Client) CreateComputedAttribute(attribute ComputedAttribute) (ComputedAttribute, error)
CreateComputedAttribute creates an Attribute
func (*Client) CreateDevice ¶
CreateDevice creates a Device
func (*Client) CreateDriver ¶
CreateDriver creates a Driver
func (*Client) CreateGeofence ¶
CreateGeofence creates a Geofence
func (*Client) CreateMaintenance ¶
func (c *Client) CreateMaintenance(maintenance Maintenance) (Maintenance, error)
CreateMaintenance creates a Maintenance
func (*Client) CreateNotification ¶
func (c *Client) CreateNotification(notification Notification) (Notification, error)
CreateNotification creates a Notification
func (*Client) CreatePermission ¶
func (c *Client) CreatePermission(request PermissionsRequest) error
CreatePermission links an Object to another Object
Eg:
CreatePermission(PermitUserID(5).DeviceID(30))
func (*Client) CreateSession ¶
CreateSession creates a new session from user credentials
Errors:
401 Unauthorized - Unauthorized
func (*Client) CreateUser ¶
CreateUser creates a User
func (*Client) DeleteCalendar ¶
DeleteCalendar deletes a Calendar
func (*Client) DeleteCommand ¶
DeleteCommand deletes a saved command
func (*Client) DeleteComputedAttribute ¶
DeleteComputedAttribute deletes an Attribute
func (*Client) DeleteDevice ¶
DeleteDevice deletes a Device
func (*Client) DeleteDriver ¶
DeleteDriver deletes a Driver
func (*Client) DeleteGeofence ¶
DeleteGeofence deletes a Geofence
func (*Client) DeleteMaintenance ¶
DeleteMaintenance deletes a Maintenance
func (*Client) DeleteNotification ¶
DeleteNotification deletes a notification
func (*Client) DeletePermission ¶
func (c *Client) DeletePermission(request PermissionsRequest) error
DeletePermission unlinks an Object from another Object
Eg:
DeletePermission(PermitUserID(5).DeviceID(30))
func (*Client) FetchSession ¶
FetchSession fetches session information from a token
Errors:
404 Not Found - Not Found
func (*Client) GetReportEvents ¶
func (c *Client) GetReportEvents(params ...QueryParameter) (events []Event, err error)
GetReportEvents Fetch a list of Events within the time period for the Devices or Groups At least one deviceId or one groupId must be passed
Params:
WithDeviceID - multiple parameters can be passed WithGroupID - multiple parameters can be passed
type not implemented
WithFrom WithTo
func (*Client) GetReportRoute ¶
func (c *Client) GetReportRoute(params ...QueryParameter) (route []Position, err error)
GetReportRoute Fetch a list of Positions within the time period for the Devices or Groups At least one deviceId or one groupId must be passed
Params:
WithDeviceID - multiple parameters can be passed WithGroupID - multiple parameters can be passed
type not implemented
WithFrom WithTo
func (*Client) GetReportStops ¶
func (c *Client) GetReportStops(params ...QueryParameter) (stops []ReportStops, err error)
GetReportStops Fetch a list of ReportStops within the time period for the Devices or Groups At least one deviceId or one groupId must be passed
Params:
WithDeviceID - multiple parameters can be passed WithGroupID - multiple parameters can be passed
type not implemented
WithFrom WithTo
func (*Client) GetReportSummary ¶
func (c *Client) GetReportSummary(params ...QueryParameter) (summary []ReportSummary, err error)
GetReportSummary Fetch a list of ReportSummary within the time period for the Devices or Groups At least one deviceId or one groupId must be passed
Params:
WithDeviceID - multiple parameters can be passed WithGroupID - multiple parameters can be passed
type not implemented
WithFrom WithTo
func (*Client) GetReportTrips ¶
func (c *Client) GetReportTrips(params ...QueryParameter) (trips []ReportTrips, err error)
GetReportTrips Fetch a list of ReportTrips within the time period for the Devices or Groups At least one deviceId or one groupId must be passed
Params:
WithDeviceID - multiple parameters can be passed WithGroupID - multiple parameters can be passed
type not implemented
WithFrom WithTo
func (*Client) GetStatistics ¶
func (c *Client) GetStatistics(params ...QueryParameter) (statistics []Statistics, err error)
GetStatistics fetches server statistics
Params:
WithFrom WithTo
func (*Client) ListCalendars ¶
func (c *Client) ListCalendars(params ...QueryParameter) (calendars []Calendar, err error)
ListCalendars fetches a list of Calendars Without params, it returns a list of Calendars the user has access to
Params:
WithAll - Can only be used by admins or managers to fetch all entities WithUserID - Standard users can use this only with their own userId
func (Client) ListCommandTypes ¶
func (c Client) ListCommandTypes(params ...QueryParameter) (commandTypes []CommandType, err error)
ListCommandTypes returns a list of available Commands for the Device or all possible Commands if Device omitted
Params:
WithDeviceID WithTextChannel
Errors:
400 Bad Request - Could happen when trying to fetch from a device the user does not have permission
func (*Client) ListCommands ¶
func (c *Client) ListCommands(params ...QueryParameter) (commands []Command, err error)
ListCommands fetches a list of Saved Commands Without params, it returns a list of Commands the user has access to
Params:
WithAll - Can only be used by admins or managers to fetch all entities WithUserID - Standard users can use this only with their own userId WithDeviceID - Standard users can use this only with _deviceId_s, they have access to WithGroupID - Standard users can use this only with _groupId_s, they have access to Refresh
func (*Client) ListComputedAttributes ¶
func (c *Client) ListComputedAttributes(params ...QueryParameter) (attributeList []ComputedAttribute, err error)
ListComputedAttributes fetches a list of Attributes Without params, it returns a list of Attributes the user has access to
Params:
WithAll - Can only be used by admins or managers to fetch all entities WithUserID - Standard users can use this only with their own userId WithDeviceID - Standard users can use this only with _deviceId_s, they have access to WithGroupID - Standard users can use this only with _groupId_s, they have access to Refresh
func (Client) ListDeviceCommands ¶
ListDeviceCommands fetches a list of Saved Commands supported by Device at the moment This api makes no sense
Errors:
400 Bad Request - Could happen when the user doesn't have permission for the device
func (*Client) ListDevices ¶
func (c *Client) ListDevices(params ...QueryParameter) (deviceList []Device, err error)
ListDevices fetches a list of Devices Without any params, returns a list of the user's devices
Params:
WithAll - Can only be used by admins or managers to fetch all entities WithUserID - Standard users can use this only with their own userId WithID - To fetch one or more devices. Multiple params can be passed WithUniqueID - To fetch one or more devices. Multiple params can be passed
Errors:
400 Bad Request - No permission
func (*Client) ListDrivers ¶
func (c *Client) ListDrivers(params ...QueryParameter) (driverList []Driver, err error)
ListDrivers fetches a list of Drivers Without params, it returns a list of Drivers the user has access to
Params:
WithAll - Can only be used by admins or managers to fetch all entities WithUserID - Standard users can use this only with their own userId WithDeviceID - Standard users can use this only with _deviceId_s, they have access to WithGroupID - Standard users can use this only with _groupId_s, they have access to Refresh
func (*Client) ListGeofences ¶
func (c *Client) ListGeofences(params ...QueryParameter) (geofences []Geofence, err error)
ListGeofences fetches a list of Geofences Without params, it returns a list of Geofences the user has access to
Params:
WithAll - Can only be used by admins or managers to fetch all entities WithUserID - Standard users can use this only with their own userId WithDeviceID - Standard users can use this only with _deviceId_s, they have access to WithGroupID - Standard users can use this only with _groupId_s, they have access to Refresh
func (*Client) ListGroups ¶
func (c *Client) ListGroups(params ...QueryParameter) (groups []Group, err error)
ListGroups fetches a list of Groups Without any params, returns a list of the Groups the user belongs to
Params:
WithAll - Can only be used by admins or managers to fetch all entities WithUserID - Standard users can use this only with their own userId
func (*Client) ListMaintenances ¶
func (c *Client) ListMaintenances(params ...QueryParameter) (maintenances []Maintenance, err error)
ListMaintenances fetches a list of Maintenance Without params, it returns a list of Maintenance the user has access to
Params:
WithAll - Can only be used by admins or managers to fetch all entities WithUserID - Standard users can use this only with their own userId WithDeviceID - Standard users can use this only with _deviceId_s, they have access to WithGroupID - Standard users can use this only with _groupId_s, they have access to Refresh
func (Client) ListNotificationTypes ¶
func (c Client) ListNotificationTypes() (notificationTypes []NotificationType, err error)
ListNotificationTypes fetches a list of available Notification types
func (*Client) ListNotifications ¶
func (c *Client) ListNotifications(params ...QueryParameter) (notifications []Notification, err error)
ListNotifications fetches a list of Notifications Without params, it returns a list of Notifications the user has access to
Params:
WithAll - Can only be used by admins or managers to fetch all entities WithUserID - Standard users can use this only with their own userId WithDeviceID - Standard users can use this only with _deviceId_s, they have access to WithGroupID - Standard users can use this only with _groupId_s, they have access to Refresh
func (*Client) ListPositions ¶
func (c *Client) ListPositions(params ...QueryParameter) (positions []Position, err error)
ListPositions fetches a list of Positions Without any params, it returns a list of last known positions for all the user's Devices. from and _to_ fields are not required with _id_
Params:
WithDeviceID - deviceId is optional, but requires the from and _to_ parameters when used WithFrom WithTo WithID - To fetch one or more positions. Multiple params can be passed
func (*Client) ListUsers ¶
func (c *Client) ListUsers(params ...QueryParameter) (users []User, err error)
ListUsers fetches a list of Users
Params:
WithUserId - Can only be used by admin or manager users
Errors:
400 Bad Request - No Permission
func (*Client) SendCommand ¶
SendCommand dispatches commands to device Dispatch a new command or Saved Command if Command.ID set
Errors:
400 Bad Request - Could happen when the user doesn't have permission or an incorrect command type for the device
func (Client) TestNotification ¶
TestNotification sends test notification to current user via Email and SMS
Errors: 400 Bad Request - Could happen if sending has failed
func (*Client) UpdateCalendar ¶
UpdateCalendar updates a Calendar
func (*Client) UpdateCommand ¶
UpdateCommand updates a saved command
func (*Client) UpdateComputedAttribute ¶
func (c *Client) UpdateComputedAttribute(id int, attribute ComputedAttribute) (ComputedAttribute, error)
UpdateComputedAttribute updates an Attribute
func (*Client) UpdateDevice ¶
UpdateDevice updates a Device
func (*Client) UpdateDeviceAccumulators ¶
func (c *Client) UpdateDeviceAccumulators(id int, accumulators DeviceAccumulators) error
UpdateDeviceAccumulators updates total distance and hours of the Device
func (*Client) UpdateDriver ¶
UpdateDriver updates a Driver
func (*Client) UpdateGeofence ¶
UpdateGeofence updates a Geofence
func (*Client) UpdateGroup ¶
UpdateGroup updates a group
func (*Client) UpdateMaintenance ¶
func (c *Client) UpdateMaintenance(id int, maintenance Maintenance) (Maintenance, error)
UpdateMaintenance updates a Maintenance
func (*Client) UpdateNotification ¶
func (c *Client) UpdateNotification(id int, notification Notification) (Notification, error)
UpdateNotification updates a notification
func (*Client) UpdateServer ¶
UpdateServer updates Server information
type Command ¶
type Command struct { ID int `json:"id"` DeviceID int `json:"deviceId"` Description string `json:"description"` Type string `json:"type"` SendSMS bool `json:"textChannel"` Attributes Attributes `json:"attributes"` }
Command describes a Command schema object
type CommandType ¶
type CommandType struct {
Type string `json:"type"`
}
CommandType describes a CommandType schema object
type ComputedAttribute ¶
type ComputedAttribute struct { ID int `json:"id"` Description string `json:"description"` Attribute string `json:"attribute"` Expression string `json:"expression"` Type ComputedAttributeType `json:"type"` }
ComputedAttribute describes a ComputedAttribute schema Object
type ComputedAttributeType ¶
type ComputedAttributeType string
ComputedAttributeType is a string type of ComputedAttribute Type
const ( StringComputedAttribute ComputedAttributeType = "String" NumberComputedAttribute ComputedAttributeType = "Number" BooleanComputedAttribute ComputedAttributeType = "Boolean" )
Computed attribute types
type Device ¶
type Device struct { ID int `json:"id"` Attributes Attributes `json:"attributes"` GroupID int `json:"groupId"` Name string `json:"name"` UniqueID string `json:"uniqueId"` Status string `json:"status"` LastUpdate string `json:"lastUpdate"` PositionID int `json:"positionId"` GeofenceIds []interface{} `json:"geofenceIds"` Phone string `json:"phone"` Model string `json:"model"` Contact string `json:"contact"` Category string `json:"category"` Disabled bool `json:"disabled"` }
Device describes a Device schema object
type DeviceAccumulators ¶
type DeviceAccumulators struct { DeviceID int `json:"deviceId"` TotalDistance int64 `json:"totalDistance"` Hours int64 `json:"hours"` }
DeviceAccumulators describes a DeviceAccumulators object
type Driver ¶
type Driver struct { ID int `json:"id"` Attributes Attributes `json:"attributes"` Name string `json:"name"` UniqueID string `json:"uniqueId"` }
Driver describes a Driver schema object
type Event ¶
type Event struct { ID int `json:"id"` Type string `json:"type"` ServerTime time.Time `json:"serverTime"` DeviceID int `json:"deviceId"` PositionID int `json:"positionId"` GeofenceID int `jsson:"geofenceId"` MaintenanceID int `json:"maintenanceId"` Attributes Attributes `json:"attributes"` }
Event describes an Event schema object
type Geofence ¶
type Geofence struct { ID int `json:"id"` Name string `json:"name"` Description string `json:"description"` Area string `json:"area"` CalendarID int `json:"calendarId"` Attributes Attributes `json:"attributes"` }
Geofence describes a Geofence schema object
type Group ¶
type Group struct { ID int `json:"id"` Name string `json:"name"` GroupID int `json:"groupId"` Attributes Attributes `json:"attributes"` }
Group describes a Group schema object
type Maintenance ¶
type Maintenance struct { ID int `json:"id"` Name string `json:"name"` Type string `json:"type"` Start int64 `json:"start"` Period int64 `json:"period"` Attributes Attributes `json:"attributes"` }
Maintenance describes a Maintenance schema object
type Message ¶
type Message struct { Devices []Device `json:"devices"` Positions []Position `json:"positions"` Events []Event `json:"events"` }
Message is what's received via streaming sockets
type Notification ¶
type Notification struct { ID int `json:"id"` Type string `json:"type"` Always bool `json:"always"` Web bool `json:"web"` Mail bool `json:"mail"` SMS bool `json:"sms"` CalendarID int `json:"calendarId"` Attributes Attributes `json:"attributes"` }
Notification describes a Notification schema object
type NotificationType ¶
type NotificationType struct {
Type string `json:"type"`
}
NotificationType describes a NotificationType schema object
type Option ¶
type Option func(c *Client)
Option is a function that operates on a Client object
func WithBaseURL ¶
WithBaseURL permits you to pass a base API url to the client consturctor
func WithCookieJar ¶
WithCookieJar permits you to pass a given cookie jar to the client constructor this is useful if you would prefer to save your cookies to disk Note that if you set this cookie jar and pass one WithHTTPClient than you will return an error if they're not the same jar
func WithHTTPClient ¶
WithHTTPClient permits you to pass a non-standard or otherwise tinkered with http.Client object to the client consturctor
type PermissionsRequest ¶
type PermissionsRequest [2]struct {
// contains filtered or unexported fields
}
PermissionsRequest is placeholder for the json object that's sent as apparently the order of the object fields is iportant.
func (PermissionsRequest) MarshalJSON ¶
func (p PermissionsRequest) MarshalJSON() (result []byte, err error)
MarshalJSON converts the placeholder into json notation for sending
type PermitDeviceID ¶
type PermitDeviceID int
PermitDeviceID will pair a DeviceID with whatever method you call on it
func (PermitDeviceID) AttributeID ¶
func (p PermitDeviceID) AttributeID(id int) PermissionsRequest
AttributeID pairs the given AttributeID with the DeviceID
func (PermitDeviceID) DriverID ¶
func (p PermitDeviceID) DriverID(id int) PermissionsRequest
DriverID pairs the given DriverID with the DeviceID
func (PermitDeviceID) GeofenceID ¶
func (p PermitDeviceID) GeofenceID(id int) PermissionsRequest
GeofenceID pairs the given GeofenceID with the DeviceID
type PermitGroupID ¶
type PermitGroupID int
PermitGroupID will pair a GroupID with whatever method you call on it
func (PermitGroupID) AttributeID ¶
func (p PermitGroupID) AttributeID(id int) PermissionsRequest
AttributeID pairs the given AttributeID with the GroupID
func (PermitGroupID) DriverID ¶
func (p PermitGroupID) DriverID(id int) PermissionsRequest
DriverID pairs the given DriverID with the GroupID
func (PermitGroupID) GeofenceID ¶
func (p PermitGroupID) GeofenceID(id int) PermissionsRequest
GeofenceID pairs the given GeofenceID with the GroupID
type PermitUserID ¶
type PermitUserID int
PermitUserID will pair a UserID with whatever method you call on it
func (PermitUserID) AttributeID ¶
func (p PermitUserID) AttributeID(id int) PermissionsRequest
AttributeID pairs the given AttributeID with the UserID
func (PermitUserID) CalendarID ¶
func (p PermitUserID) CalendarID(id int) PermissionsRequest
CalendarID pairs the given CalendarID with the UserID
func (PermitUserID) DeviceID ¶
func (p PermitUserID) DeviceID(id int) PermissionsRequest
DeviceID pairs the given DeviceID with the UserID
func (PermitUserID) DriverID ¶
func (p PermitUserID) DriverID(id int) PermissionsRequest
DriverID pairs the given DriverID with the UserID
func (PermitUserID) GeofenceID ¶
func (p PermitUserID) GeofenceID(id int) PermissionsRequest
GeofenceID pairs the given GeofenceID with the UserID
func (PermitUserID) GroupID ¶
func (p PermitUserID) GroupID(id int) PermissionsRequest
GroupID pairs the given GroupID with the UserID
func (PermitUserID) ManagedUserID ¶
func (p PermitUserID) ManagedUserID(id int) PermissionsRequest
ManagedUserID pairs the given ManagedUserID with the UserID
type Position ¶
type Position struct { ID int64 `json:"id"` Attributes Attributes `json:"attributes"` DeviceID int64 `json:"deviceId"` Protocol string `json:"protocol"` ServerTime time.Time `json:"serverTime"` DeviceTime time.Time `json:"deviceTime"` FixTime time.Time `json:"fixTime"` Outdated bool `json:"outdated"` Valid bool `json:"valid"` Latitude float64 `json:"latitude"` Longitude float64 `json:"longitude"` Altitude float64 `json:"altitude"` Speed float64 `json:"speed"` Course float64 `json:"course"` Address string `json:"address"` Accuracy float64 `json:"accuracy"` Network Attributes `json:"network"` }
Position describes a Position schema object
type QueryParameter ¶
QueryParameter is a function that sets a URl value
func WithAll ¶
func WithAll(val bool) QueryParameter
WithAll Can only be used by admins or managers to fetch all entities
func WithDeviceID ¶
func WithDeviceID(val ...int) QueryParameter
WithDeviceID Standard users can use this only with _deviceId_s, they have access to
func WithGroupID ¶
func WithGroupID(val ...int) QueryParameter
WithGroupID Standard users can use this only with _groupId_s, they have access to
func WithID ¶
func WithID(val ...int) QueryParameter
WithID to fetch one or more devices. Multiple params can be passed
func WithUniqueID ¶
func WithUniqueID(val ...string) QueryParameter
WithUniqueID to fetch one or more devices. Multiple params can be passed
func WithUserID ¶
func WithUserID(val int) QueryParameter
WithUserID Standard users can use this only with their own userId
type ReportStops ¶
type ReportStops struct { DeviceID int `json:"deviceId"` DeviceName string `json:"deviceName"` Duration int `json:"duration"` StartTime time.Time `json:"startTime"` Address string `json:"address"` Lat float64 `json:"lat"` Lon float64 `json:"lon"` EndTime time.Time `json:"end"` SpentFuel float64 `json:"spentFuel"` EngineHours int `json:"engineHours"` }
ReportStops describes a ReportStops schema object
type ReportSummary ¶
type ReportSummary struct { DeviceID int `json:"deviceId"` DeviceName string `json:"deviceName"` MaxSpeed float64 `json:"maxSpeed"` AverageSpeed float64 `json:"averageSpeed"` Distance float64 `json:"distance"` SpentFuel float64 `json:"spentFuel"` EngineHours int `json:"engineHours"` }
ReportSummary describes a ReportSummary schema object
type ReportTrips ¶
type ReportTrips struct { DeviceID int `json:"deviceId"` DeviceName string `json:"deviceName"` MaxSpeed float64 `json:"maxSpeed"` AverageSpeed float64 `json:"averageSpeed"` Distance float64 `json:"distance"` SpentFuel float64 `json:"spentFuel"` Duration int `json:"duration"` StartTime time.Time `json:"startTime"` StartAddress string `json:"startAddress"` StartLat float64 `json:"startLat"` StartLon float64 `json:"startLon"` EndTime time.Time `json:"endTime"` EndAddress string `json:"endAddress"` EndLat float64 `json:"endLat"` EndLon float64 `json:"endLon"` DriverUniqueID int `json:"driverUniqueId"` DriverName string `json:"driverName"` }
ReportTrips describes a ReportTrips schema object
type Server ¶
type Server struct { ID int `json:"id"` Registration bool `json:"registration"` Readonly bool `json:"readonly"` DeviceReadonly bool `json:"deviceReadonly"` LimitCommands bool `json:"limitCommands"` Map string `json:"map"` BingKey string `json:"bingKey"` MapURL string `json:"mapUrl"` PoiLayer string `json:"poiLayer"` Latitude float64 `json:"latitude"` Longitude float64 `json:"longitude"` Zoom int `json:"zoom"` TwelveHourFormat bool `json:"twelveHourFormat"` Version string `json:"version"` ForceSettings bool `json:"forceSettings"` CoordinateFormat string `json:"coordinateFormat"` Attributes Attributes `json:"attributes"` }
Server describes a Server schema object
type Statistics ¶
type Statistics struct { CaptureTime time.Time `json:"captureTime"` ActiveUsers int `json:"activeUsers"` ActiveDevices int `json:"activeDevices"` Requests int `json:"requests"` MessagesReceived int `json:"messagesReceived"` MessagesStored int `json:"messagesStored"` }
Statistics describes a Statistics schema object
type User ¶
type User struct { ID int `json:"id"` Name string `json:"name"` Email string `json:"email"` Readonly bool `json:"readonly"` Administrator bool `json:"administrator"` Map string `json:"map"` Latitude float64 `json:"latitude"` Longitude float64 `json:"longitude"` Zoom int `json:"zoom"` Password string `json:"password"` TwelveHourFormat bool `json:"twelveHourFormat"` CoordinateFormat string `json:"coordinateFormat"` Disabled bool `json:"disabled"` ExpirationTime time.Time `json:"expirationTime"` DeviceLimit int `json:"deviceLimit"` UserLimit int `json:"userLimit"` DeviceReadonly bool `json:"deviceReadonly"` LimitCommands bool `json:"limitCommands"` PoiLayer string `json:"poiLayer"` Token string `json:"token"` Attributes Attributes `json:"attributes"` }
User describes a User schema object