gateways

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBadRequest = errors.New("bad request")
View Source
var ErrNotFound = errors.New("not found")

Functions

This section is empty.

Types

type DeviceByAddress added in v0.13.0

type DeviceByAddress struct {
	Vehicle             *VehicleInfo
	DefinitionID        string
	ManufacturerTokenID uint64
	CANProtocol         string
}

DeviceByAddress is the result of looking up an aftermarket device by its Ethereum address. It carries everything needed for config resolution and status (e.g. GetConfigStatusByEthAddr).

type DeviceDefinition added in v0.10.20

type DeviceDefinition struct {
	Model        string `json:"model"`
	Year         int    `json:"year"`
	Manufacturer struct {
		ID      string `json:"id"`
		TokenID int    `json:"tokenId"`
		Name    string `json:"name"`
		TableID int    `json:"tableId"`
	} `json:"manufacturer"`
	Attributes []struct {
		Name  string `json:"name"`
		Value string `json:"value"`
	} `json:"attributes"`
}

type GraphQLRequest

type GraphQLRequest struct {
	Query string `json:"query"`
}

type IdentityAPI

type IdentityAPI interface {
	GetVehicleByDeviceAddr(ethAddress common.Address) (*VehicleInfo, error)
	GetDeviceByAddress(ethAddress common.Address) (*DeviceByAddress, error)
	GetDefinitionByID(definitionID string) (*DeviceDefinition, error)
}

func NewIdentityAPIService

func NewIdentityAPIService(logger *zerolog.Logger, settings *config.Settings, httpClient http.ClientWrapper) IdentityAPI

NewIdentityAPIService creates a new instance of IdentityAPI, initializing it with the provided logger, settings, and HTTP client. httpClient is used for testing really

type VehicleDefinition

type VehicleDefinition struct {
	ID    string `json:"id"`
	Make  string `json:"make"`
	Model string `json:"model"`
	Year  int    `json:"year"`
}

type VehicleInfo

type VehicleInfo struct {
	TokenID    uint64            `json:"tokenId"`
	Definition VehicleDefinition `json:"definition"`
}

Directories

Path Synopsis
Package mock_gateways is a generated GoMock package.
Package mock_gateways is a generated GoMock package.

Jump to

Keyboard shortcuts

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