Documentation
¶
Overview ¶
Package convert provides a function to generate conversion functions for a vehicle struct.
Code generated by github.com/DIMO-Network/model-garage.
Code generated by github.com/DIMO-Network/model-garage DO NOT EDIT.
Code generated by github.com/DIMO-Network/model-garage DO NOT EDIT.
Index ¶
- Constants
- func ChassisAxleRow1WheelLeftTirePressureFromV1Data(jsonData []byte) (ret float64, err error)
- func ChassisAxleRow1WheelLeftTirePressureFromV2Data(originalDoc []byte, result gjson.Result) (ret float64, err error)
- func ChassisAxleRow1WheelRightTirePressureFromV1Data(jsonData []byte) (ret float64, err error)
- func ChassisAxleRow1WheelRightTirePressureFromV2Data(originalDoc []byte, result gjson.Result) (ret float64, err error)
- func ChassisAxleRow2WheelLeftTirePressureFromV1Data(jsonData []byte) (ret float64, err error)
- func ChassisAxleRow2WheelLeftTirePressureFromV2Data(originalDoc []byte, result gjson.Result) (ret float64, err error)
- func ChassisAxleRow2WheelRightTirePressureFromV1Data(jsonData []byte) (ret float64, err error)
- func ChassisAxleRow2WheelRightTirePressureFromV2Data(originalDoc []byte, result gjson.Result) (ret float64, err error)
- func CurrentLocationAltitudeFromV1Data(jsonData []byte) (ret float64, err error)
- func CurrentLocationAltitudeFromV2Data(originalDoc []byte, result gjson.Result) (ret float64, err error)
- func CurrentLocationIsRedactedFromV1Data(jsonData []byte) (ret float64, err error)
- func CurrentLocationIsRedactedFromV2Data(originalDoc []byte, result gjson.Result) (ret float64, err error)
- func CurrentLocationLatitudeFromV1Data(jsonData []byte) (ret float64, err error)
- func CurrentLocationLatitudeFromV2Data(originalDoc []byte, result gjson.Result) (ret float64, err error)
- func CurrentLocationLongitudeFromV1Data(jsonData []byte) (ret float64, err error)
- func CurrentLocationLongitudeFromV2Data(originalDoc []byte, result gjson.Result) (ret float64, err error)
- func DIMOAftermarketHDOPFromV1Data(jsonData []byte) (ret float64, err error)
- func DIMOAftermarketHDOPFromV2Data(originalDoc []byte, result gjson.Result) (ret float64, err error)
- func DIMOAftermarketNSATFromV1Data(jsonData []byte) (ret float64, err error)
- func DIMOAftermarketNSATFromV2Data(originalDoc []byte, result gjson.Result) (ret float64, err error)
- func DIMOAftermarketSSIDFromV1Data(jsonData []byte) (ret string, err error)
- func DIMOAftermarketSSIDFromV2Data(originalDoc []byte, result gjson.Result) (ret string, err error)
- func DIMOAftermarketWPAStateFromV1Data(jsonData []byte) (ret string, err error)
- func DIMOAftermarketWPAStateFromV2Data(originalDoc []byte, result gjson.Result) (ret string, err error)
- func ExteriorAirTemperatureFromV1Data(jsonData []byte) (ret float64, err error)
- func ExteriorAirTemperatureFromV2Data(originalDoc []byte, result gjson.Result) (ret float64, err error)
- func GetSchemaVersion(jsonData []byte) string
- func IsInvalidType(err error) bool
- func LowVoltageBatteryCurrentVoltageFromV1Data(jsonData []byte) (ret float64, err error)
- func LowVoltageBatteryCurrentVoltageFromV2Data(originalDoc []byte, result gjson.Result) (ret float64, err error)
- func NameFromV2Signal(sigResult gjson.Result) (string, error)
- func OBDBarometricPressureFromV1Data(jsonData []byte) (ret float64, err error)
- func OBDBarometricPressureFromV2Data(originalDoc []byte, result gjson.Result) (ret float64, err error)
- func OBDEngineLoadFromV1Data(jsonData []byte) (ret float64, err error)
- func OBDEngineLoadFromV2Data(originalDoc []byte, result gjson.Result) (ret float64, err error)
- func OBDIntakeTempFromV1Data(jsonData []byte) (ret float64, err error)
- func OBDIntakeTempFromV2Data(originalDoc []byte, result gjson.Result) (ret float64, err error)
- func OBDRunTimeFromV1Data(jsonData []byte) (ret float64, err error)
- func OBDRunTimeFromV2Data(originalDoc []byte, result gjson.Result) (ret float64, err error)
- func PowertrainCombustionEngineECTFromV1Data(jsonData []byte) (ret float64, err error)
- func PowertrainCombustionEngineECTFromV2Data(originalDoc []byte, result gjson.Result) (ret float64, err error)
- func PowertrainCombustionEngineEngineOilLevelFromV1Data(jsonData []byte) (ret string, err error)
- func PowertrainCombustionEngineEngineOilLevelFromV2Data(originalDoc []byte, result gjson.Result) (ret string, err error)
- func PowertrainCombustionEngineEngineOilRelativeLevelFromV1Data(jsonData []byte) (ret float64, err error)
- func PowertrainCombustionEngineEngineOilRelativeLevelFromV2Data(originalDoc []byte, result gjson.Result) (ret float64, err error)
- func PowertrainCombustionEngineMAFFromV1Data(jsonData []byte) (ret float64, err error)
- func PowertrainCombustionEngineMAFFromV2Data(originalDoc []byte, result gjson.Result) (ret float64, err error)
- func PowertrainCombustionEngineSpeedFromV1Data(jsonData []byte) (ret float64, err error)
- func PowertrainCombustionEngineSpeedFromV2Data(originalDoc []byte, result gjson.Result) (ret float64, err error)
- func PowertrainCombustionEngineTPSFromV1Data(jsonData []byte) (ret float64, err error)
- func PowertrainCombustionEngineTPSFromV2Data(originalDoc []byte, result gjson.Result) (ret float64, err error)
- func PowertrainFuelSystemRelativeLevelFromV1Data(jsonData []byte) (ret float64, err error)
- func PowertrainFuelSystemRelativeLevelFromV2Data(originalDoc []byte, result gjson.Result) (ret float64, err error)
- func PowertrainFuelSystemSupportedFuelTypesFromV1Data(jsonData []byte) (ret string, err error)
- func PowertrainFuelSystemSupportedFuelTypesFromV2Data(originalDoc []byte, result gjson.Result) (ret string, err error)
- func PowertrainRangeFromV1Data(jsonData []byte) (ret float64, err error)
- func PowertrainRangeFromV2Data(originalDoc []byte, result gjson.Result) (ret float64, err error)
- func PowertrainTractionBatteryChargingChargeLimitFromV1Data(jsonData []byte) (ret float64, err error)
- func PowertrainTractionBatteryChargingChargeLimitFromV2Data(originalDoc []byte, result gjson.Result) (ret float64, err error)
- func PowertrainTractionBatteryChargingIsChargingFromV1Data(jsonData []byte) (ret float64, err error)
- func PowertrainTractionBatteryChargingIsChargingFromV2Data(originalDoc []byte, result gjson.Result) (ret float64, err error)
- func PowertrainTractionBatteryCurrentPowerFromV1Data(jsonData []byte) (ret float64, err error)
- func PowertrainTractionBatteryCurrentPowerFromV2Data(originalDoc []byte, result gjson.Result) (ret float64, err error)
- func PowertrainTractionBatteryGrossCapacityFromV1Data(jsonData []byte) (ret float64, err error)
- func PowertrainTractionBatteryGrossCapacityFromV2Data(originalDoc []byte, result gjson.Result) (ret float64, err error)
- func PowertrainTractionBatteryStateOfChargeCurrentFromV1Data(jsonData []byte) (ret float64, err error)
- func PowertrainTractionBatteryStateOfChargeCurrentFromV2Data(originalDoc []byte, result gjson.Result) (ret float64, err error)
- func PowertrainTransmissionTravelledDistanceFromV1Data(jsonData []byte) (ret float64, err error)
- func PowertrainTransmissionTravelledDistanceFromV2Data(originalDoc []byte, result gjson.Result) (ret float64, err error)
- func PowertrainTypeFromV1Data(jsonData []byte) (ret string, err error)
- func PowertrainTypeFromV2Data(originalDoc []byte, result gjson.Result) (ret string, err error)
- func SignalsFromPayload(ctx context.Context, tokenGetter TokenIDGetter, jsonData []byte) ([]vss.Signal, error)
- func SignalsFromV1Data(baseSignal vss.Signal, jsonData []byte) ([]vss.Signal, error)
- func SignalsFromV1Payload(ctx context.Context, tokenGetter TokenIDGetter, jsonData []byte) ([]vss.Signal, error)
- func SignalsFromV2Data(originalDoc []byte, baseSignal vss.Signal, signalName string, ...) ([]vss.Signal, error)
- func SignalsFromV2Payload(jsonData []byte) ([]vss.Signal, error)
- func SourceFromV1Data(jsonData []byte) (string, error)
- func SourceFromV2Data(jsonData []byte) (string, error)
- func SpeedFromV1Data(jsonData []byte) (ret float64, err error)
- func SpeedFromV2Data(originalDoc []byte, result gjson.Result) (ret float64, err error)
- func SubjectFromV1Data(jsonData []byte) (string, error)
- func TimestampFromV1Data(jsonData []byte) (time.Time, error)
- func TimestampFromV2Signal(sigResult gjson.Result) (time.Time, error)
- func ToChassisAxleRow1WheelLeftTirePressure0(originalDoc []byte, val float64) (float64, error)
- func ToChassisAxleRow1WheelRightTirePressure0(originalDoc []byte, val float64) (float64, error)
- func ToChassisAxleRow2WheelLeftTirePressure0(originalDoc []byte, val float64) (float64, error)
- func ToChassisAxleRow2WheelRightTirePressure0(originalDoc []byte, val float64) (float64, error)
- func ToCurrentLocationAltitude0(originalDoc []byte, val float64) (float64, error)
- func ToCurrentLocationIsRedacted0(originalDoc []byte, val bool) (float64, error)
- func ToCurrentLocationLatitude0(originalDoc []byte, val float64) (float64, error)
- func ToCurrentLocationLongitude0(originalDoc []byte, val float64) (float64, error)
- func ToDIMOAftermarketHDOP0(originalDoc []byte, val float64) (float64, error)
- func ToDIMOAftermarketNSAT0(originalDoc []byte, val float64) (float64, error)
- func ToDIMOAftermarketSSID0(originalDoc []byte, val string) (string, error)
- func ToDIMOAftermarketSSID1(originalDoc []byte, val string) (string, error)
- func ToDIMOAftermarketWPAState0(originalDoc []byte, val string) (string, error)
- func ToDIMOAftermarketWPAState1(originalDoc []byte, val string) (string, error)
- func ToExteriorAirTemperature0(originalDoc []byte, val float64) (float64, error)
- func ToExteriorAirTemperature1(originalDoc []byte, val float64) (float64, error)
- func ToLowVoltageBatteryCurrentVoltage0(originalDoc []byte, val float64) (float64, error)
- func ToOBDBarometricPressure0(originalDoc []byte, val float64) (float64, error)
- func ToOBDEngineLoad0(originalDoc []byte, val float64) (float64, error)
- func ToOBDIntakeTemp0(originalDoc []byte, val float64) (float64, error)
- func ToOBDRunTime0(originalDoc []byte, val float64) (float64, error)
- func ToPowertrainCombustionEngineECT0(originalDoc []byte, val float64) (float64, error)
- func ToPowertrainCombustionEngineEngineOilLevel0(originalDoc []byte, val float64) (string, error)
- func ToPowertrainCombustionEngineEngineOilRelativeLevel0(originalDoc []byte, val float64) (float64, error)
- func ToPowertrainCombustionEngineMAF0(originalDoc []byte, val float64) (float64, error)
- func ToPowertrainCombustionEngineSpeed0(originalDoc []byte, val float64) (float64, error)
- func ToPowertrainCombustionEngineSpeed1(originalDoc []byte, val float64) (float64, error)
- func ToPowertrainCombustionEngineTPS0(originalDoc []byte, val float64) (float64, error)
- func ToPowertrainFuelSystemRelativeLevel0(originalDoc []byte, val float64) (float64, error)
- func ToPowertrainFuelSystemRelativeLevel1(originalDoc []byte, val float64) (float64, error)
- func ToPowertrainFuelSystemSupportedFuelTypes0(originalDoc []byte, val string) (string, error)
- func ToPowertrainRange0(originalDoc []byte, val float64) (float64, error)
- func ToPowertrainTractionBatteryChargingChargeLimit0(originalDoc []byte, val float64) (float64, error)
- func ToPowertrainTractionBatteryChargingIsCharging0(originalDoc []byte, val bool) (float64, error)
- func ToPowertrainTractionBatteryCurrentPower0(originalDoc []byte, val float64) (float64, error)
- func ToPowertrainTractionBatteryGrossCapacity0(originalDoc []byte, val float64) (float64, error)
- func ToPowertrainTractionBatteryStateOfChargeCurrent0(originalDoc []byte, val float64) (float64, error)
- func ToPowertrainTransmissionTravelledDistance0(originalDoc []byte, val float64) (float64, error)
- func ToPowertrainType0(originalDoc []byte, val string) (string, error)
- func ToSpeed0(originalDoc []byte, val float64) (float64, error)
- func ToSpeed1(originalDoc []byte, val float64) (float64, error)
- func TokenIDFromV2Data(jsonData []byte) (uint32, error)
- type FieldNotFoundError
- type TokenIDGetter
- type VersionError
Constants ¶
const ( // StatusV1 is the version string for payloads with the version 1.0 schema. StatusV1 = "v1.0.0" // StatusV1Converted is the version string for payloads that have been converted to the 1.0 schema. StatusV1Converted = "v1.1.0" // StatusV2 is the version string for payloads with the version 2.0 schema. StatusV2 = "v2.0.0" )
Variables ¶
This section is empty.
Functions ¶
func ChassisAxleRow1WheelLeftTirePressureFromV1Data ¶ added in v0.2.7
ChassisAxleRow1WheelLeftTirePressureFromV1Data converts the given JSON data to a float64.
func ChassisAxleRow1WheelLeftTirePressureFromV2Data ¶ added in v0.2.7
func ChassisAxleRow1WheelLeftTirePressureFromV2Data(originalDoc []byte, result gjson.Result) (ret float64, err error)
ChassisAxleRow1WheelLeftTirePressureFromData converts the given JSON data to a float64.
func ChassisAxleRow1WheelRightTirePressureFromV1Data ¶ added in v0.2.7
ChassisAxleRow1WheelRightTirePressureFromV1Data converts the given JSON data to a float64.
func ChassisAxleRow1WheelRightTirePressureFromV2Data ¶ added in v0.2.7
func ChassisAxleRow1WheelRightTirePressureFromV2Data(originalDoc []byte, result gjson.Result) (ret float64, err error)
ChassisAxleRow1WheelRightTirePressureFromData converts the given JSON data to a float64.
func ChassisAxleRow2WheelLeftTirePressureFromV1Data ¶ added in v0.2.7
ChassisAxleRow2WheelLeftTirePressureFromV1Data converts the given JSON data to a float64.
func ChassisAxleRow2WheelLeftTirePressureFromV2Data ¶ added in v0.2.7
func ChassisAxleRow2WheelLeftTirePressureFromV2Data(originalDoc []byte, result gjson.Result) (ret float64, err error)
ChassisAxleRow2WheelLeftTirePressureFromData converts the given JSON data to a float64.
func ChassisAxleRow2WheelRightTirePressureFromV1Data ¶ added in v0.2.7
ChassisAxleRow2WheelRightTirePressureFromV1Data converts the given JSON data to a float64.
func ChassisAxleRow2WheelRightTirePressureFromV2Data ¶ added in v0.2.7
func ChassisAxleRow2WheelRightTirePressureFromV2Data(originalDoc []byte, result gjson.Result) (ret float64, err error)
ChassisAxleRow2WheelRightTirePressureFromData converts the given JSON data to a float64.
func CurrentLocationAltitudeFromV1Data ¶ added in v0.2.7
CurrentLocationAltitudeFromV1Data converts the given JSON data to a float64.
func CurrentLocationAltitudeFromV2Data ¶ added in v0.2.7
func CurrentLocationAltitudeFromV2Data(originalDoc []byte, result gjson.Result) (ret float64, err error)
CurrentLocationAltitudeFromData converts the given JSON data to a float64.
func CurrentLocationIsRedactedFromV1Data ¶ added in v0.2.7
CurrentLocationIsRedactedFromV1Data converts the given JSON data to a float64.
func CurrentLocationIsRedactedFromV2Data ¶ added in v0.2.7
func CurrentLocationIsRedactedFromV2Data(originalDoc []byte, result gjson.Result) (ret float64, err error)
CurrentLocationIsRedactedFromData converts the given JSON data to a float64.
func CurrentLocationLatitudeFromV1Data ¶ added in v0.2.7
CurrentLocationLatitudeFromV1Data converts the given JSON data to a float64.
func CurrentLocationLatitudeFromV2Data ¶ added in v0.2.7
func CurrentLocationLatitudeFromV2Data(originalDoc []byte, result gjson.Result) (ret float64, err error)
CurrentLocationLatitudeFromData converts the given JSON data to a float64.
func CurrentLocationLongitudeFromV1Data ¶ added in v0.2.7
CurrentLocationLongitudeFromV1Data converts the given JSON data to a float64.
func CurrentLocationLongitudeFromV2Data ¶ added in v0.2.7
func CurrentLocationLongitudeFromV2Data(originalDoc []byte, result gjson.Result) (ret float64, err error)
CurrentLocationLongitudeFromData converts the given JSON data to a float64.
func DIMOAftermarketHDOPFromV1Data ¶ added in v0.2.7
DIMOAftermarketHDOPFromV1Data converts the given JSON data to a float64.
func DIMOAftermarketHDOPFromV2Data ¶ added in v0.2.7
func DIMOAftermarketHDOPFromV2Data(originalDoc []byte, result gjson.Result) (ret float64, err error)
DIMOAftermarketHDOPFromData converts the given JSON data to a float64.
func DIMOAftermarketNSATFromV1Data ¶ added in v0.2.7
DIMOAftermarketNSATFromV1Data converts the given JSON data to a float64.
func DIMOAftermarketNSATFromV2Data ¶ added in v0.2.7
func DIMOAftermarketNSATFromV2Data(originalDoc []byte, result gjson.Result) (ret float64, err error)
DIMOAftermarketNSATFromData converts the given JSON data to a float64.
func DIMOAftermarketSSIDFromV1Data ¶ added in v0.2.7
DIMOAftermarketSSIDFromV1Data converts the given JSON data to a string.
func DIMOAftermarketSSIDFromV2Data ¶ added in v0.2.7
DIMOAftermarketSSIDFromData converts the given JSON data to a string.
func DIMOAftermarketWPAStateFromV1Data ¶ added in v0.2.7
DIMOAftermarketWPAStateFromV1Data converts the given JSON data to a string.
func DIMOAftermarketWPAStateFromV2Data ¶ added in v0.2.7
func DIMOAftermarketWPAStateFromV2Data(originalDoc []byte, result gjson.Result) (ret string, err error)
DIMOAftermarketWPAStateFromData converts the given JSON data to a string.
func ExteriorAirTemperatureFromV1Data ¶ added in v0.2.7
ExteriorAirTemperatureFromV1Data converts the given JSON data to a float64.
func ExteriorAirTemperatureFromV2Data ¶ added in v0.2.7
func ExteriorAirTemperatureFromV2Data(originalDoc []byte, result gjson.Result) (ret float64, err error)
ExteriorAirTemperatureFromData converts the given JSON data to a float64.
func GetSchemaVersion ¶ added in v0.2.1
GetSchemaVersion returns the version string of the schema used in the payload.
func IsInvalidType ¶ added in v0.2.7
IsInvalidType returns true if the error is of type errInvalidType.
func LowVoltageBatteryCurrentVoltageFromV1Data ¶ added in v0.2.7
LowVoltageBatteryCurrentVoltageFromV1Data converts the given JSON data to a float64.
func LowVoltageBatteryCurrentVoltageFromV2Data ¶ added in v0.2.7
func LowVoltageBatteryCurrentVoltageFromV2Data(originalDoc []byte, result gjson.Result) (ret float64, err error)
LowVoltageBatteryCurrentVoltageFromData converts the given JSON data to a float64.
func NameFromV2Signal ¶ added in v0.2.1
NameFromV2Signal gets a name from a V2 signal.
func OBDBarometricPressureFromV1Data ¶ added in v0.2.7
OBDBarometricPressureFromV1Data converts the given JSON data to a float64.
func OBDBarometricPressureFromV2Data ¶ added in v0.2.7
func OBDBarometricPressureFromV2Data(originalDoc []byte, result gjson.Result) (ret float64, err error)
OBDBarometricPressureFromData converts the given JSON data to a float64.
func OBDEngineLoadFromV1Data ¶ added in v0.2.7
OBDEngineLoadFromV1Data converts the given JSON data to a float64.
func OBDEngineLoadFromV2Data ¶ added in v0.2.7
OBDEngineLoadFromData converts the given JSON data to a float64.
func OBDIntakeTempFromV1Data ¶ added in v0.2.7
OBDIntakeTempFromV1Data converts the given JSON data to a float64.
func OBDIntakeTempFromV2Data ¶ added in v0.2.7
OBDIntakeTempFromData converts the given JSON data to a float64.
func OBDRunTimeFromV1Data ¶ added in v0.2.7
OBDRunTimeFromV1Data converts the given JSON data to a float64.
func OBDRunTimeFromV2Data ¶ added in v0.2.7
OBDRunTimeFromData converts the given JSON data to a float64.
func PowertrainCombustionEngineECTFromV1Data ¶ added in v0.2.7
PowertrainCombustionEngineECTFromV1Data converts the given JSON data to a float64.
func PowertrainCombustionEngineECTFromV2Data ¶ added in v0.2.7
func PowertrainCombustionEngineECTFromV2Data(originalDoc []byte, result gjson.Result) (ret float64, err error)
PowertrainCombustionEngineECTFromData converts the given JSON data to a float64.
func PowertrainCombustionEngineEngineOilLevelFromV1Data ¶ added in v0.2.7
PowertrainCombustionEngineEngineOilLevelFromV1Data converts the given JSON data to a string.
func PowertrainCombustionEngineEngineOilLevelFromV2Data ¶ added in v0.2.7
func PowertrainCombustionEngineEngineOilLevelFromV2Data(originalDoc []byte, result gjson.Result) (ret string, err error)
PowertrainCombustionEngineEngineOilLevelFromData converts the given JSON data to a string.
func PowertrainCombustionEngineEngineOilRelativeLevelFromV1Data ¶ added in v0.2.7
func PowertrainCombustionEngineEngineOilRelativeLevelFromV1Data(jsonData []byte) (ret float64, err error)
PowertrainCombustionEngineEngineOilRelativeLevelFromV1Data converts the given JSON data to a float64.
func PowertrainCombustionEngineEngineOilRelativeLevelFromV2Data ¶ added in v0.2.7
func PowertrainCombustionEngineEngineOilRelativeLevelFromV2Data(originalDoc []byte, result gjson.Result) (ret float64, err error)
PowertrainCombustionEngineEngineOilRelativeLevelFromData converts the given JSON data to a float64.
func PowertrainCombustionEngineMAFFromV1Data ¶ added in v0.2.7
PowertrainCombustionEngineMAFFromV1Data converts the given JSON data to a float64.
func PowertrainCombustionEngineMAFFromV2Data ¶ added in v0.2.7
func PowertrainCombustionEngineMAFFromV2Data(originalDoc []byte, result gjson.Result) (ret float64, err error)
PowertrainCombustionEngineMAFFromData converts the given JSON data to a float64.
func PowertrainCombustionEngineSpeedFromV1Data ¶ added in v0.2.7
PowertrainCombustionEngineSpeedFromV1Data converts the given JSON data to a float64.
func PowertrainCombustionEngineSpeedFromV2Data ¶ added in v0.2.7
func PowertrainCombustionEngineSpeedFromV2Data(originalDoc []byte, result gjson.Result) (ret float64, err error)
PowertrainCombustionEngineSpeedFromData converts the given JSON data to a float64.
func PowertrainCombustionEngineTPSFromV1Data ¶ added in v0.2.7
PowertrainCombustionEngineTPSFromV1Data converts the given JSON data to a float64.
func PowertrainCombustionEngineTPSFromV2Data ¶ added in v0.2.7
func PowertrainCombustionEngineTPSFromV2Data(originalDoc []byte, result gjson.Result) (ret float64, err error)
PowertrainCombustionEngineTPSFromData converts the given JSON data to a float64.
func PowertrainFuelSystemRelativeLevelFromV1Data ¶ added in v0.2.7
PowertrainFuelSystemRelativeLevelFromV1Data converts the given JSON data to a float64.
func PowertrainFuelSystemRelativeLevelFromV2Data ¶ added in v0.2.7
func PowertrainFuelSystemRelativeLevelFromV2Data(originalDoc []byte, result gjson.Result) (ret float64, err error)
PowertrainFuelSystemRelativeLevelFromData converts the given JSON data to a float64.
func PowertrainFuelSystemSupportedFuelTypesFromV1Data ¶ added in v0.2.7
PowertrainFuelSystemSupportedFuelTypesFromV1Data converts the given JSON data to a string.
func PowertrainFuelSystemSupportedFuelTypesFromV2Data ¶ added in v0.2.7
func PowertrainFuelSystemSupportedFuelTypesFromV2Data(originalDoc []byte, result gjson.Result) (ret string, err error)
PowertrainFuelSystemSupportedFuelTypesFromData converts the given JSON data to a string.
func PowertrainRangeFromV1Data ¶ added in v0.2.7
PowertrainRangeFromV1Data converts the given JSON data to a float64.
func PowertrainRangeFromV2Data ¶ added in v0.2.7
PowertrainRangeFromData converts the given JSON data to a float64.
func PowertrainTractionBatteryChargingChargeLimitFromV1Data ¶ added in v0.2.7
func PowertrainTractionBatteryChargingChargeLimitFromV1Data(jsonData []byte) (ret float64, err error)
PowertrainTractionBatteryChargingChargeLimitFromV1Data converts the given JSON data to a float64.
func PowertrainTractionBatteryChargingChargeLimitFromV2Data ¶ added in v0.2.7
func PowertrainTractionBatteryChargingChargeLimitFromV2Data(originalDoc []byte, result gjson.Result) (ret float64, err error)
PowertrainTractionBatteryChargingChargeLimitFromData converts the given JSON data to a float64.
func PowertrainTractionBatteryChargingIsChargingFromV1Data ¶ added in v0.2.7
func PowertrainTractionBatteryChargingIsChargingFromV1Data(jsonData []byte) (ret float64, err error)
PowertrainTractionBatteryChargingIsChargingFromV1Data converts the given JSON data to a float64.
func PowertrainTractionBatteryChargingIsChargingFromV2Data ¶ added in v0.2.7
func PowertrainTractionBatteryChargingIsChargingFromV2Data(originalDoc []byte, result gjson.Result) (ret float64, err error)
PowertrainTractionBatteryChargingIsChargingFromData converts the given JSON data to a float64.
func PowertrainTractionBatteryCurrentPowerFromV1Data ¶ added in v0.2.7
PowertrainTractionBatteryCurrentPowerFromV1Data converts the given JSON data to a float64.
func PowertrainTractionBatteryCurrentPowerFromV2Data ¶ added in v0.2.7
func PowertrainTractionBatteryCurrentPowerFromV2Data(originalDoc []byte, result gjson.Result) (ret float64, err error)
PowertrainTractionBatteryCurrentPowerFromData converts the given JSON data to a float64.
func PowertrainTractionBatteryGrossCapacityFromV1Data ¶ added in v0.2.7
PowertrainTractionBatteryGrossCapacityFromV1Data converts the given JSON data to a float64.
func PowertrainTractionBatteryGrossCapacityFromV2Data ¶ added in v0.2.7
func PowertrainTractionBatteryGrossCapacityFromV2Data(originalDoc []byte, result gjson.Result) (ret float64, err error)
PowertrainTractionBatteryGrossCapacityFromData converts the given JSON data to a float64.
func PowertrainTractionBatteryStateOfChargeCurrentFromV1Data ¶ added in v0.2.7
func PowertrainTractionBatteryStateOfChargeCurrentFromV1Data(jsonData []byte) (ret float64, err error)
PowertrainTractionBatteryStateOfChargeCurrentFromV1Data converts the given JSON data to a float64.
func PowertrainTractionBatteryStateOfChargeCurrentFromV2Data ¶ added in v0.2.7
func PowertrainTractionBatteryStateOfChargeCurrentFromV2Data(originalDoc []byte, result gjson.Result) (ret float64, err error)
PowertrainTractionBatteryStateOfChargeCurrentFromData converts the given JSON data to a float64.
func PowertrainTransmissionTravelledDistanceFromV1Data ¶ added in v0.2.7
PowertrainTransmissionTravelledDistanceFromV1Data converts the given JSON data to a float64.
func PowertrainTransmissionTravelledDistanceFromV2Data ¶ added in v0.2.7
func PowertrainTransmissionTravelledDistanceFromV2Data(originalDoc []byte, result gjson.Result) (ret float64, err error)
PowertrainTransmissionTravelledDistanceFromData converts the given JSON data to a float64.
func PowertrainTypeFromV1Data ¶ added in v0.2.7
PowertrainTypeFromV1Data converts the given JSON data to a string.
func PowertrainTypeFromV2Data ¶ added in v0.2.7
PowertrainTypeFromData converts the given JSON data to a string.
func SignalsFromPayload ¶
func SignalsFromPayload(ctx context.Context, tokenGetter TokenIDGetter, jsonData []byte) ([]vss.Signal, error)
SignalsFromPayload extracts signals from a payload. It detects the payload version and calls the appropriate function.
func SignalsFromV1Data ¶ added in v0.2.7
SignalsFromV1Data creates a slice of vss.Signal from the given v1 status JSON data. On error, partial results may be returned.
func SignalsFromV1Payload ¶
func SignalsFromV1Payload(ctx context.Context, tokenGetter TokenIDGetter, jsonData []byte) ([]vss.Signal, error)
SignalsFromV1Payload gets a slice signals from a v1 payload.
func SignalsFromV2Data ¶ added in v0.2.7
func SignalsFromV2Data(originalDoc []byte, baseSignal vss.Signal, signalName string, sigResult gjson.Result) ([]vss.Signal, error)
SignalsFromData converts the given JSON data to a slice of signals.
func SignalsFromV2Payload ¶
SignalsFromV2Payload extracts signals from a V2 payload.
func SourceFromV1Data ¶ added in v0.2.1
SourceFromV1Data gets a source field from a v1 payload.
func SourceFromV2Data ¶ added in v0.2.1
SourceFromV2Data gets a source from a V2 payload.
func SpeedFromV1Data ¶ added in v0.2.7
SpeedFromV1Data converts the given JSON data to a float64.
func SpeedFromV2Data ¶ added in v0.2.7
SpeedFromData converts the given JSON data to a float64.
func SubjectFromV1Data ¶ added in v0.2.1
SubjectFromV1Data gets a subject from a v1 payload.
func TimestampFromV1Data ¶ added in v0.2.1
TimestampFromV1Data gets a timestamp from a v1 payload.
func TimestampFromV2Signal ¶ added in v0.2.1
TimestampFromV2Signal gets a timestamp from a V2 signal.
func ToChassisAxleRow1WheelLeftTirePressure0 ¶ added in v0.2.7
ToChassisAxleRow1WheelLeftTirePressure0 converts data from field 'tires.frontLeft' of type float64 to 'Vehicle.Chassis.Axle.Row1.Wheel.Left.Tire.Pressure' of type float64. Vehicle.Chassis.Axle.Row1.Wheel.Left.Tire.Pressure: Tire pressure in kilo-Pascal. Unit: 'kPa'
func ToChassisAxleRow1WheelRightTirePressure0 ¶ added in v0.2.7
ToChassisAxleRow1WheelRightTirePressure0 converts data from field 'tires.frontRight' of type float64 to 'Vehicle.Chassis.Axle.Row1.Wheel.Right.Tire.Pressure' of type float64. Vehicle.Chassis.Axle.Row1.Wheel.Right.Tire.Pressure: Tire pressure in kilo-Pascal. Unit: 'kPa'
func ToChassisAxleRow2WheelLeftTirePressure0 ¶ added in v0.2.7
ToChassisAxleRow2WheelLeftTirePressure0 converts data from field 'tires.backLeft' of type float64 to 'Vehicle.Chassis.Axle.Row2.Wheel.Left.Tire.Pressure' of type float64. Vehicle.Chassis.Axle.Row2.Wheel.Left.Tire.Pressure: Tire pressure in kilo-Pascal. Unit: 'kPa'
func ToChassisAxleRow2WheelRightTirePressure0 ¶ added in v0.2.7
ToChassisAxleRow2WheelRightTirePressure0 converts data from field 'tires.backRight' of type float64 to 'Vehicle.Chassis.Axle.Row2.Wheel.Right.Tire.Pressure' of type float64. Vehicle.Chassis.Axle.Row2.Wheel.Right.Tire.Pressure: Tire pressure in kilo-Pascal. Unit: 'kPa'
func ToCurrentLocationAltitude0 ¶ added in v0.2.7
ToCurrentLocationAltitude0 converts data from field 'altitude' of type float64 to 'Vehicle.CurrentLocation.Altitude' of type float64. Vehicle.CurrentLocation.Altitude: Current altitude relative to WGS 84 reference ellipsoid, as measured at the position of GNSS receiver antenna. Unit: 'm'
func ToCurrentLocationIsRedacted0 ¶ added in v0.2.7
ToCurrentLocationIsRedacted0 converts data from field 'isRedacted' of type bool to 'Vehicle.CurrentLocation.IsRedacted' of type float64. Vehicle.CurrentLocation.IsRedacted: Indicates if the latitude and longitude signals at the current timestamp have been redacted using a privacy zone.
func ToCurrentLocationLatitude0 ¶ added in v0.2.7
ToCurrentLocationLatitude0 converts data from field 'latitude' of type float64 to 'Vehicle.CurrentLocation.Latitude' of type float64. Vehicle.CurrentLocation.Latitude: Current latitude of vehicle in WGS 84 geodetic coordinates, as measured at the position of GNSS receiver antenna. Unit: 'degrees' Min: '-90' Max: '90'
func ToCurrentLocationLongitude0 ¶ added in v0.2.7
ToCurrentLocationLongitude0 converts data from field 'longitude' of type float64 to 'Vehicle.CurrentLocation.Longitude' of type float64. Vehicle.CurrentLocation.Longitude: Current longitude of vehicle in WGS 84 geodetic coordinates, as measured at the position of GNSS receiver antenna. Unit: 'degrees' Min: '-180' Max: '180'
func ToDIMOAftermarketHDOP0 ¶ added in v0.2.7
ToDIMOAftermarketHDOP0 converts data from field 'hdop' of type float64 to 'Vehicle.DIMO.Aftermarket.HDOP' of type float64. Vehicle.DIMO.Aftermarket.HDOP: Horizontal dilution of precision of GPS
func ToDIMOAftermarketNSAT0 ¶ added in v0.2.7
ToDIMOAftermarketNSAT0 converts data from field 'nsat' of type float64 to 'Vehicle.DIMO.Aftermarket.NSAT' of type float64. Vehicle.DIMO.Aftermarket.NSAT: Number of sync satellites for GPS
func ToDIMOAftermarketSSID0 ¶ added in v0.2.7
ToDIMOAftermarketSSID0 converts data from field 'ssid' of type string to 'Vehicle.DIMO.Aftermarket.SSID' of type string. Vehicle.DIMO.Aftermarket.SSID: Service Set Identifier for the wifi.
func ToDIMOAftermarketSSID1 ¶ added in v0.2.7
ToDIMOAftermarketSSID1 converts data from field 'wifi.ssid' of type string to 'Vehicle.DIMO.Aftermarket.SSID' of type string. Vehicle.DIMO.Aftermarket.SSID: Service Set Identifier for the wifi.
func ToDIMOAftermarketWPAState0 ¶ added in v0.2.7
ToDIMOAftermarketWPAState0 converts data from field 'wpa_state' of type string to 'Vehicle.DIMO.Aftermarket.WPAState' of type string. Vehicle.DIMO.Aftermarket.WPAState: Indicate the current WPA state for the device's wifi
func ToDIMOAftermarketWPAState1 ¶ added in v0.2.7
ToDIMOAftermarketWPAState1 converts data from field 'wifi.wpaState' of type string to 'Vehicle.DIMO.Aftermarket.WPAState' of type string. Vehicle.DIMO.Aftermarket.WPAState: Indicate the current WPA state for the device's wifi
func ToExteriorAirTemperature0 ¶ added in v0.2.7
ToExteriorAirTemperature0 converts data from field 'ambientAirTemp' of type float64 to 'Vehicle.Exterior.AirTemperature' of type float64. Vehicle.Exterior.AirTemperature: Air temperature outside the vehicle. Unit: 'celsius'
func ToExteriorAirTemperature1 ¶ added in v0.2.7
ToExteriorAirTemperature1 converts data from field 'ambientTemp' of type float64 to 'Vehicle.Exterior.AirTemperature' of type float64. Vehicle.Exterior.AirTemperature: Air temperature outside the vehicle. Unit: 'celsius'
func ToLowVoltageBatteryCurrentVoltage0 ¶ added in v0.2.7
ToLowVoltageBatteryCurrentVoltage0 converts data from field 'batteryVoltage' of type float64 to 'Vehicle.LowVoltageBattery.CurrentVoltage' of type float64. Vehicle.LowVoltageBattery.CurrentVoltage: Current Voltage of the low voltage battery. Unit: 'V'
func ToOBDBarometricPressure0 ¶ added in v0.2.7
ToOBDBarometricPressure0 converts data from field 'barometricPressure' of type float64 to 'Vehicle.OBD.BarometricPressure' of type float64. Vehicle.OBD.BarometricPressure: PID 33 - Barometric pressure Unit: 'kPa'
func ToOBDEngineLoad0 ¶ added in v0.2.7
ToOBDEngineLoad0 converts data from field 'engineLoad' of type float64 to 'Vehicle.OBD.EngineLoad' of type float64. Vehicle.OBD.EngineLoad: PID 04 - Engine load in percent - 0 = no load, 100 = full load Unit: 'percent'
func ToOBDIntakeTemp0 ¶ added in v0.2.7
ToOBDIntakeTemp0 converts data from field 'intakeTemp' of type float64 to 'Vehicle.OBD.IntakeTemp' of type float64. Vehicle.OBD.IntakeTemp: PID 0F - Intake temperature Unit: 'celsius'
func ToOBDRunTime0 ¶ added in v0.2.7
ToOBDRunTime0 converts data from field 'runTime' of type float64 to 'Vehicle.OBD.RunTime' of type float64. Vehicle.OBD.RunTime: PID 1F - Engine run time Unit: 's'
func ToPowertrainCombustionEngineECT0 ¶ added in v0.2.7
ToPowertrainCombustionEngineECT0 converts data from field 'coolantTemp' of type float64 to 'Vehicle.Powertrain.CombustionEngine.ECT' of type float64. Vehicle.Powertrain.CombustionEngine.ECT: Engine coolant temperature. Unit: 'celsius'
func ToPowertrainCombustionEngineEngineOilLevel0 ¶ added in v0.2.7
ToPowertrainCombustionEngineEngineOilLevel0 converts data from field 'oil' of type float64 to 'Vehicle.Powertrain.CombustionEngine.EngineOilLevel' of type string. Vehicle.Powertrain.CombustionEngine.EngineOilLevel: Engine oil level.
func ToPowertrainCombustionEngineEngineOilRelativeLevel0 ¶ added in v0.2.7
func ToPowertrainCombustionEngineEngineOilRelativeLevel0(originalDoc []byte, val float64) (float64, error)
ToPowertrainCombustionEngineEngineOilRelativeLevel0 converts data from field 'oil' of type float64 to 'Vehicle.Powertrain.CombustionEngine.EngineOilRelativeLevel' of type float64. Vehicle.Powertrain.CombustionEngine.EngineOilRelativeLevel: Engine oil level as a percentage. Unit: 'percent' Min: '0' Max: '100'
func ToPowertrainCombustionEngineMAF0 ¶ added in v0.2.7
ToPowertrainCombustionEngineMAF0 converts data from field 'maf' of type float64 to 'Vehicle.Powertrain.CombustionEngine.MAF' of type float64. Vehicle.Powertrain.CombustionEngine.MAF: Grams of air drawn into engine per second. Unit: 'g/s'
func ToPowertrainCombustionEngineSpeed0 ¶ added in v0.2.7
ToPowertrainCombustionEngineSpeed0 converts data from field 'rpm' of type float64 to 'Vehicle.Powertrain.CombustionEngine.Speed' of type float64. Vehicle.Powertrain.CombustionEngine.Speed: Engine speed measured as rotations per minute. Unit: 'rpm'
func ToPowertrainCombustionEngineSpeed1 ¶ added in v0.2.7
ToPowertrainCombustionEngineSpeed1 converts data from field 'engineSpeed' of type float64 to 'Vehicle.Powertrain.CombustionEngine.Speed' of type float64. Vehicle.Powertrain.CombustionEngine.Speed: Engine speed measured as rotations per minute. Unit: 'rpm'
func ToPowertrainCombustionEngineTPS0 ¶ added in v0.2.7
ToPowertrainCombustionEngineTPS0 converts data from field 'throttlePosition' of type float64 to 'Vehicle.Powertrain.CombustionEngine.TPS' of type float64. Vehicle.Powertrain.CombustionEngine.TPS: Current throttle position. Unit: 'percent' Max: '100'
func ToPowertrainFuelSystemRelativeLevel0 ¶ added in v0.2.7
ToPowertrainFuelSystemRelativeLevel0 converts data from field 'fuelLevel' of type float64 to 'Vehicle.Powertrain.FuelSystem.RelativeLevel' of type float64. Vehicle.Powertrain.FuelSystem.RelativeLevel: Level in fuel tank as percent of capacity. 0 = empty. 100 = full. Unit: 'percent' Min: '0' Max: '100'
func ToPowertrainFuelSystemRelativeLevel1 ¶ added in v0.2.7
ToPowertrainFuelSystemRelativeLevel1 converts data from field 'fuelPercentRemaining' of type float64 to 'Vehicle.Powertrain.FuelSystem.RelativeLevel' of type float64. Vehicle.Powertrain.FuelSystem.RelativeLevel: Level in fuel tank as percent of capacity. 0 = empty. 100 = full. Unit: 'percent' Min: '0' Max: '100'
func ToPowertrainFuelSystemSupportedFuelTypes0 ¶ added in v0.2.7
ToPowertrainFuelSystemSupportedFuelTypes0 converts data from field 'fuelType' of type string to 'Vehicle.Powertrain.FuelSystem.SupportedFuelTypes' of type string. Vehicle.Powertrain.FuelSystem.SupportedFuelTypes: High level information of fuel types supported
func ToPowertrainRange0 ¶ added in v0.2.7
ToPowertrainRange0 converts data from field 'range' of type float64 to 'Vehicle.Powertrain.Range' of type float64. Vehicle.Powertrain.Range: Remaining range in meters using all energy sources available in the vehicle. Unit: 'm'
func ToPowertrainTractionBatteryChargingChargeLimit0 ¶ added in v0.2.7
func ToPowertrainTractionBatteryChargingChargeLimit0(originalDoc []byte, val float64) (float64, error)
ToPowertrainTractionBatteryChargingChargeLimit0 converts data from field 'chargeLimit' of type float64 to 'Vehicle.Powertrain.TractionBattery.Charging.ChargeLimit' of type float64. Vehicle.Powertrain.TractionBattery.Charging.ChargeLimit: Target charge limit (state of charge) for battery. Unit: 'percent' Min: '0' Max: '100'
func ToPowertrainTractionBatteryChargingIsCharging0 ¶ added in v0.2.7
ToPowertrainTractionBatteryChargingIsCharging0 converts data from field 'charging' of type bool to 'Vehicle.Powertrain.TractionBattery.Charging.IsCharging' of type float64. Vehicle.Powertrain.TractionBattery.Charging.IsCharging: True if charging is ongoing. Charging is considered to be ongoing if energy is flowing from charger to vehicle.
func ToPowertrainTractionBatteryCurrentPower0 ¶ added in v0.2.7
ToPowertrainTractionBatteryCurrentPower0 converts data from field 'charger.power' of type float64 to 'Vehicle.Powertrain.TractionBattery.CurrentPower' of type float64. Vehicle.Powertrain.TractionBattery.CurrentPower: Current electrical energy flowing in/out of battery. Positive = Energy flowing in to battery, e.g. during charging. Negative = Energy flowing out of battery, e.g. during driving. Unit: 'W'
func ToPowertrainTractionBatteryGrossCapacity0 ¶ added in v0.2.7
ToPowertrainTractionBatteryGrossCapacity0 converts data from field 'batteryCapacity' of type float64 to 'Vehicle.Powertrain.TractionBattery.GrossCapacity' of type float64. Vehicle.Powertrain.TractionBattery.GrossCapacity: Gross capacity of the battery. Unit: 'kWh'
func ToPowertrainTractionBatteryStateOfChargeCurrent0 ¶ added in v0.2.7
func ToPowertrainTractionBatteryStateOfChargeCurrent0(originalDoc []byte, val float64) (float64, error)
ToPowertrainTractionBatteryStateOfChargeCurrent0 converts data from field 'soc' of type float64 to 'Vehicle.Powertrain.TractionBattery.StateOfCharge.Current' of type float64. Vehicle.Powertrain.TractionBattery.StateOfCharge.Current: Physical state of charge of the high voltage battery, relative to net capacity. This is not necessarily the state of charge being displayed to the customer. Unit: 'percent' Min: '0' Max: '100.0'
func ToPowertrainTransmissionTravelledDistance0 ¶ added in v0.2.7
ToPowertrainTransmissionTravelledDistance0 converts data from field 'odometer' of type float64 to 'Vehicle.Powertrain.Transmission.TravelledDistance' of type float64. Vehicle.Powertrain.Transmission.TravelledDistance: Odometer reading, total distance travelled during the lifetime of the transmission. Unit: 'km'
func ToPowertrainType0 ¶ added in v0.2.7
ToPowertrainType0 converts data from field 'fuelType' of type string to 'Vehicle.Powertrain.Type' of type string. Vehicle.Powertrain.Type: Defines the powertrain type of the vehicle.
func ToSpeed0 ¶ added in v0.2.7
ToSpeed0 converts data from field 'vehicleSpeed' of type float64 to 'Vehicle.Speed' of type float64. Vehicle.Speed: Vehicle speed. Unit: 'km/h'
func ToSpeed1 ¶ added in v0.2.7
ToSpeed1 converts data from field 'speed' of type float64 to 'Vehicle.Speed' of type float64. Vehicle.Speed: Vehicle speed. Unit: 'km/h'
func TokenIDFromV2Data ¶ added in v0.2.1
TokenIDFromV2Data gets a tokenID from a V2 payload.
Types ¶
type FieldNotFoundError ¶ added in v0.1.1
FieldNotFoundError is an error for missing fields.
func (FieldNotFoundError) Error ¶ added in v0.1.1
func (e FieldNotFoundError) Error() string
Error returns the error message.
type TokenIDGetter ¶
type TokenIDGetter interface {
TokenIDFromSubject(ctx context.Context, subject string) (uint32, error)
}
TokenIDGetter is an interface to get a tokenID from a subject.
type VersionError ¶ added in v0.1.1
type VersionError struct {
Version string
}
VersionError is an error for unsupported specversion.
func (VersionError) Error ¶ added in v0.1.1
func (e VersionError) Error() string
Error returns the error message.