trusttrack

package module
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2025 License: MIT Imports: 19 Imported by: 1

README

TrustTrack Go

PkgGoDev GoReportCard CI

A Go SDK and CLI tool for the TrustTrack API.

SDK

Features
  • TODO
Installing
$ go get github.com/way-platform/trusttrack-go
Using
// TODO
Developing

See AGENTS.md.

CLI tool

The trusttrack CLI tool enables interaction with the APIs from the command line.

Installing
go install github.com/way-platform/trusttrack-go/cmd/trusttrack@latest

Prebuilt binaries for Linux, Windows, and Mac are available from the Releases.

Documentation

Overview

Package trusttrack provides a client for the TrustTrack API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client for the LogiApp BI API.

func NewClient

func NewClient(opts ...ClientOption) (*Client, error)

NewClient creates a new Client with the given options.

func (*Client) GetObjectGroup added in v0.2.0

func (c *Client) GetObjectGroup(
	ctx context.Context,
	request *GetObjectGroupRequest,
	opts ...ClientOption,
) (_ *GetObjectGroupResponse, err error)

GetObjectGroup gets a specific object group by external ID.

func (*Client) ListDrivers added in v0.10.0

func (c *Client) ListDrivers(
	ctx context.Context,
	request *ListDriversRequest,
	opts ...ClientOption,
) (_ *ListDriversResponse, err error)

ListDrivers lists all drivers.

func (*Client) ListFuelEvents added in v0.4.0

func (c *Client) ListFuelEvents(
	ctx context.Context,
	request *ListFuelEventsRequest,
	opts ...ClientOption,
) (_ *ListFuelEventsResponse, err error)

ListFuelEvents lists fuel events for an object.

func (*Client) ListObjectCoordinates added in v0.5.0

func (c *Client) ListObjectCoordinates(
	ctx context.Context,
	request *ListObjectCoordinatesRequest,
	opts ...ClientOption,
) (_ *ListObjectCoordinatesResponse, err error)

ListObjectCoordinates lists object coordinates for a specified time period.

func (*Client) ListObjectGroups added in v0.2.0

func (c *Client) ListObjectGroups(
	ctx context.Context,
	request *ListObjectGroupsRequest,
	opts ...ClientOption,
) (_ *ListObjectGroupsResponse, err error)

ListObjectGroups lists all object groups.

func (*Client) ListObjects

func (c *Client) ListObjects(
	ctx context.Context,
	request *ListObjectsRequest,
	opts ...ClientOption,
) (_ *ListObjectsResponse, err error)

ListObjects lists all objects.

func (*Client) ListObjectsLastPosition added in v0.5.0

func (c *Client) ListObjectsLastPosition(
	ctx context.Context,
	request *ListObjectsLastPositionRequest,
	opts ...ClientOption,
) (_ *ListObjectsLastPositionResponse, err error)

ListObjectsLastPosition lists all objects with their last position.

func (*Client) ListTrips added in v0.3.0

func (c *Client) ListTrips(
	ctx context.Context,
	request *ListTripsRequest,
	opts ...ClientOption,
) (_ *ListTripsResponse, err error)

ListTrips lists trips for an object.

type ClientOption

type ClientOption func(*clientConfig)

ClientOption is a function that configures the [clientConfig].

func WithAPIKey

func WithAPIKey(apiKey string) ClientOption

WithAPIKey sets the API key for API requests.

func WithBaseURL added in v0.7.0

func WithBaseURL(baseURL string) ClientOption

WithBaseURL sets the base URL for API requests.

func WithDebug

func WithDebug(debug bool) ClientOption

WithDebug toggles debug mode (request/response dumps to stderr)..

func WithInterceptor added in v0.9.0

func WithInterceptor(interceptor func(http.RoundTripper) http.RoundTripper) ClientOption

WithInterceptor adds a request interceptor for the Client.

func WithRetryCount added in v0.7.0

func WithRetryCount(retryCount int) ClientOption

WithRetryCount sets the number of retries for API requests.

func WithTimeout added in v0.7.0

func WithTimeout(timeout time.Duration) ClientOption

WithTimeout sets the timeout for API requests.

type Error

type Error struct {
	// StatusCode is the HTTP status code of the response.
	StatusCode int
	// Message is the error message from the response.
	Message string
}

Error represents a LogiApp BI API error.

func (Error) Error

func (e Error) Error() string

Error implements the error interface.

type GetObjectGroupRequest added in v0.2.0

type GetObjectGroupRequest struct {
	// The external ID of the object group.
	ExternalID string `json:"externalId"`
}

GetObjectGroupRequest is the request for the Client.GetObjectGroup method.

func (*GetObjectGroupRequest) Query added in v0.2.0

func (r *GetObjectGroupRequest) Query() url.Values

Query returns the query parameters for the request.

type GetObjectGroupResponse added in v0.2.0

type GetObjectGroupResponse struct {
	// The object group.
	ObjectGroup *trusttrackv1.ObjectGroup `json:"objectGroup"`
}

GetObjectGroupResponse is the response for the Client.GetObjectGroup method.

type ListDriversRequest added in v0.10.0

type ListDriversRequest struct {
	// The limit of the number of drivers to return.
	// Default: 100.
	// Maximum: 1000.
	Limit int `json:"limit"`
	// The continuation token to use to get the next page of results.
	ContinuationToken string `json:"continuationToken"`
	// The identifier type to filter by.
	IdentifierType string `json:"identifierType"`
	// The identifier to filter by.
	Identifier string `json:"identifier"`
}

ListDriversRequest is the request for the Client.ListDrivers method.

func (*ListDriversRequest) Query added in v0.10.0

func (r *ListDriversRequest) Query() url.Values

Query returns the query parameters for the request.

type ListDriversResponse added in v0.10.0

type ListDriversResponse struct {
	// The drivers.
	Drivers []*trusttrackv1.Driver `json:"drivers"`
	// The continuation token to use to get the next page of results.
	ContinuationToken string `json:"continuationToken"`
}

ListDriversResponse is the response for the Client.ListDrivers method.

type ListFuelEventsRequest added in v0.4.0

type ListFuelEventsRequest struct {
	// The ID of the object to get fuel events for.
	ObjectID string `json:"objectId"`
	// The start time for the fuel events search.
	FromTime time.Time `json:"fromDatetime"`
	// The end time for the fuel events search (optional).
	ToTime time.Time `json:"toDatetime,omitzero"`
	// The limit of the number of fuel events to return.
	// Default: 100.
	Limit int `json:"limit"`
	// The continuation token to use to get the next page of results.
	ContinuationToken string `json:"continuationToken,omitempty"`
}

ListFuelEventsRequest is the request for the Client.ListFuelEvents method.

func (*ListFuelEventsRequest) Query added in v0.4.0

func (r *ListFuelEventsRequest) Query() url.Values

Query returns the query parameters for the request.

type ListFuelEventsResponse added in v0.4.0

type ListFuelEventsResponse struct {
	// The fuel events for the object.
	FuelEvents []*trusttrackv1.FuelEvent `json:"fuelEvents"`
	// The continuation token to use to get the next page of results.
	ContinuationToken string `json:"continuationToken,omitempty"`
}

ListFuelEventsResponse is the response for the Client.ListFuelEvents method.

type ListObjectCoordinatesRequest added in v0.5.0

type ListObjectCoordinatesRequest struct {
	// ObjectID is the external object ID.
	ObjectID string `json:"objectId"`

	// FromTime finds records starting from the specified date and time.
	FromTime time.Time `json:"fromTime"`

	// ToTime finds records ending at the specified date and time. Optional.
	ToTime time.Time `json:"toTime,omitzero"`

	// ContinuationToken displays from what date and time the data is shown if the record limit was reached.
	ContinuationToken string `json:"continuationToken"`

	// Limit specifies how many records will be included in the response (default 100, max 1000).
	Limit int `json:"limit"`

	// IncludeGeozones indicates whether to include geozone information in the response.
	IncludeGeozones bool `json:"includeGeozones"`

	// IncludeTireParameters indicates whether to include tire pressure information in the response.
	IncludeTireParameters bool `json:"includeTireParameters"`
}

ListObjectCoordinatesRequest is the request for the Client.ListObjectCoordinates method.

func (*ListObjectCoordinatesRequest) Query added in v0.5.0

Query returns the query parameters for the request.

type ListObjectCoordinatesResponse added in v0.5.0

type ListObjectCoordinatesResponse struct {
	Coordinates       []*trusttrackv1.Coordinate `json:"coordinates"`
	ContinuationToken string                     `json:"continuation_token"`
}

ListObjectCoordinatesResponse is the response for the Client.ListObjectCoordinates method.

type ListObjectGroupsRequest added in v0.2.0

type ListObjectGroupsRequest struct {
	// The limit of the number of object groups to return.
	// Default: 100.
	// Maximum: 1000.
	Limit int `json:"limit"`
	// The continuation token to use to get the next page of results.
	ContinuationToken string `json:"continuationToken"`
}

ListObjectGroupsRequest is the request for the Client.ListObjectGroups method.

func (*ListObjectGroupsRequest) Query added in v0.2.0

func (r *ListObjectGroupsRequest) Query() url.Values

Query returns the query parameters for the request.

type ListObjectGroupsResponse added in v0.2.0

type ListObjectGroupsResponse struct {
	// The object groups.
	ObjectGroups []*trusttrackv1.ObjectGroup `json:"objectGroups"`
	// The continuation token to use to get the next page of results.
	ContinuationToken string `json:"continuationToken"`
}

ListObjectGroupsResponse is the response for the Client.ListObjectGroups method.

type ListObjectsLastPositionRequest added in v0.5.0

type ListObjectsLastPositionRequest struct {
	// The limit of the number of objects to return.
	// Default: 100.
	// Maximum: 1000.
	Limit int `json:"limit"`
	// The continuation token to use to get the next page of results.
	ContinuationToken string `json:"continuationToken"`
}

ListObjectsLastPositionRequest is the request for the Client.ListObjectsLastPosition method.

func (*ListObjectsLastPositionRequest) Query added in v0.5.0

Query returns the query parameters for the request.

type ListObjectsLastPositionResponse added in v0.5.0

type ListObjectsLastPositionResponse struct {
	// The objects with their last position.
	Objects []*trusttrackv1.Object `json:"objects"`
	// The continuation token to use to get the next page of results.
	ContinuationToken string `json:"continuationToken"`
}

ListObjectsLastPositionResponse is the response for the Client.ListObjectsLastPosition method.

type ListObjectsRequest

type ListObjectsRequest struct{}

ListObjectsRequest is the request for the Client.ListObjects method.

func (*ListObjectsRequest) Query added in v0.2.0

func (r *ListObjectsRequest) Query() url.Values

Query returns the query parameters for the request.

type ListObjectsResponse

type ListObjectsResponse struct {
	Objects []*trusttrackv1.Object `json:"objects"`
}

ListObjectsResponse is the response for the Client.ListObjects method.

type ListTripsRequest added in v0.3.0

type ListTripsRequest struct {
	// The ID of the object to get trips for.
	ObjectID string `json:"objectId"`
	// The start time for the trip search.
	FromTime time.Time `json:"fromDatetime"`
	// The end time for the trip search (optional).
	ToTime time.Time `json:"toDatetime,omitzero"`
	// The limit of the number of trips to return.
	// Default: 100.
	Limit int `json:"limit"`
	// The continuation token to use to get the next page of results.
	ContinuationToken string `json:"continuationToken,omitempty"`
}

ListTripsRequest is the request for the Client.ListTrips method.

func (*ListTripsRequest) Query added in v0.3.0

func (r *ListTripsRequest) Query() url.Values

Query returns the query parameters for the request.

type ListTripsResponse added in v0.3.0

type ListTripsResponse struct {
	// The trips for the object.
	Trips []*trusttrackv1.Trip `json:"trips"`
	// The continuation token to use to get the next page of results.
	ContinuationToken string `json:"continuationToken,omitempty"`
}

ListTripsResponse is the response for the Client.ListTrips method.

Directories

Path Synopsis
cmd
trusttrack module
internal
oapi/ttoapi
Package ttoapi provides primitives to interact with the openapi HTTP API.
Package ttoapi provides primitives to interact with the openapi HTTP API.

Jump to

Keyboard shortcuts

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