gateways

package
v0.5.8 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SmartCarVendor = "SmartCar"
)

Variables

This section is empty.

Functions

func ParseSmartCarYears

func ParseSmartCarYears(yearsPtr *string) ([]int, error)

ParseSmartCarYears parses out the years format in the smartcar document and returns an array of years

Types

type IntegrationCapabilities

type IntegrationCapabilities struct {
	Location          bool `json:"location"`
	Odometer          bool `json:"odometer"`
	LockUnlock        bool `json:"lock_unlock"`
	EVBattery         bool `json:"ev_battery"`
	EVChargingStatus  bool `json:"ev_charging_status"`
	EVStartStopCharge bool `json:"ev_start_stop_charge"`
	FuelTank          bool `json:"fuel_tank"`
	TirePressure      bool `json:"tire_pressure"`
	EngineOilLife     bool `json:"engine_oil_life"`
	VehicleAttributes bool `json:"vehicle_attributes"`
	VIN               bool `json:"vin"`
}

IntegrationCapabilities gets stored on the association table btw a device_definition and the integrations, device_integrations

type SmartCarCompatibilityData

type SmartCarCompatibilityData struct {
	ComponentChunkName string `json:"componentChunkName"`
	Path               string `json:"path"`
	Result             struct {
		Data struct {
			AllMakesTable struct {
				Edges []struct {
					Node struct {
						CompatibilityData map[string][]struct {
							Name    string `json:"name"`
							Headers []struct {
								Text    string  `json:"text"`
								Tooltip *string `json:"tooltip"`
							} `json:"headers"`
							Rows [][]struct {
								Color       *string `json:"color"`
								Subtext     *string `json:"subtext"`
								Text        *string `json:"text"`
								Type        *string `json:"type"`
								VehicleType *string `json:"vehicleType"`
							} `json:"rows"`
						} `json:"compatibilityData"`
					} `json:"node"`
				} `json:"edges"`
			} `json:"allMakesTable"`
		} `json:"data"`
	} `json:"result"`
}

type SmartCarService

type SmartCarService interface {
	GetOrCreateSmartCarIntegration(ctx context.Context) (string, error)
	GetSmartCarVehicleData() (*SmartCarCompatibilityData, error)
}

func NewSmartCarService

func NewSmartCarService(dbs func() *db.ReaderWriter, logger zerolog.Logger) SmartCarService

Directories

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

Jump to

Keyboard shortcuts

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