Documentation
¶
Index ¶
- Constants
- type CellID
- type Credential
- type DiagnosticTroubleCode
- type GatewayID
- type H3Cell
- type Location
- type LocationValue
- type OdometerReading
- type OdometerStatementVCSubject
- type POMSubject
- type TimeRange
- type TirePressureStatus
- type VINSubject
- type VehicleHealthStatus
- type VehicleHealthVCSubject
- type VehiclePositionVCSubject
Constants ¶
const ( // LocationTypeCellID represents the cell ID location type. LocationTypeCellID = "cellId" // LocationTypeH3Cell represents the latitude/longitude location type. LocationTypeH3Cell = "h3Cell" // LocationTypeGatewayID represents the gateway ID location type. LocationTypeGatewayID = "gatewayId" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CellID ¶
type CellID struct {
CellID string `json:"cellId"`
}
CellID represents a cell ID location value.
type Credential ¶
type Credential struct {
ValidFrom time.Time `json:"validFrom,omitempty"`
ValidTo time.Time `json:"validTo,omitempty"`
CredentialSubject json.RawMessage `json:"credentialSubject,omitempty"`
}
Credential represents a verifiable credential.
type DiagnosticTroubleCode ¶ added in v0.1.8
type DiagnosticTroubleCode struct {
Code string `json:"code"`
Description string `json:"description,omitempty"`
Severity string `json:"severity"` // "info", "warning", "critical"
Timestamp time.Time `json:"timestamp"`
}
DiagnosticTroubleCode represents a DTC.
type GatewayID ¶
type GatewayID struct {
GatewayID string `json:"gatewayId"`
}
GatewayID represents a gateway ID location value.
type H3Cell ¶
type H3Cell struct {
CellID string `json:"h3CellId"`
}
H3Cell represents a latitude/longitude location value.
type Location ¶
type Location struct {
LocationType string `json:"locationType"`
LocationValue LocationValue `json:"locationValue"`
Timestamp time.Time `json:"timestamp"`
}
Location represents a single location event with type, value, and timestamp.
func (*Location) UnmarshalJSON ¶
UnmarshalJSON custom unmarshals a Location to handle the polymorphic LocationValue.
type LocationValue ¶
type LocationValue interface {
// contains filtered or unexported methods
}
LocationValue represents a generic interface for location values.
type OdometerReading ¶ added in v0.1.8
type OdometerReading struct {
Value float64 `json:"value"`
Unit string `json:"unit"` // "km" or "miles"
Timestamp time.Time `json:"timestamp"`
}
OdometerReading represents an odometer reading with metadata.
type OdometerStatementVCSubject ¶ added in v0.1.8
type OdometerStatementVCSubject struct {
// VehicleDID is the DID of the vehicle.
VehicleDID cloudevent.ERC721DID `json:"vehicleDID,omitempty"`
// Source is the connections source of the odometer reading.
Source string `json:"source,omitempty"`
// OdometerReading is the odometer value.
OdometerReading OdometerReading `json:"odometerReading"`
// RequestedTimestamp is the timestamp that was requested (if any).
RequestedTimestamp *time.Time `json:"requestedTimestamp,omitempty"`
}
OdometerStatementVCSubject represents the subject of the OdometerStatementVC.
type POMSubject ¶
type POMSubject struct {
ID string `json:"id,omitempty"`
// VehicleTokenID is the token ID of the vehicle NFT.
VehicleTokenID uint32 `json:"vehicleTokenId,omitempty"`
// VehicleContractAddress is the address of the vehicle contract.
VehicleContractAddress string `json:"vehicleContractAddress,omitempty"`
// RecordedBy is the entity that recorded the event.
RecordedBy string `json:"recordedBy,omitempty"`
Locations []Location `json:"locations"`
}
POMSubject represents the subject of the Proof of Movement VC.
type TirePressureStatus ¶ added in v0.1.8
type TirePressureStatus struct {
FrontLeft *float64 `json:"frontLeft,omitempty"`
FrontRight *float64 `json:"frontRight,omitempty"`
RearLeft *float64 `json:"rearLeft,omitempty"`
RearRight *float64 `json:"rearRight,omitempty"`
Unit string `json:"unit"` // "psi" or "kpa"
IsNormal bool `json:"isNormal"`
Timestamp time.Time `json:"timestamp"`
}
TirePressureStatus represents tire pressure readings.
type VINSubject ¶
type VINSubject struct {
VehicleDID string `json:"id,omitempty"`
// VehicleTokenID is the token ID of the vehicle NFT.
VehicleTokenID uint32 `json:"vehicleTokenId,omitempty"`
// VehicleContractAddress is the address of the vehicle contract.
VehicleContractAddress string `json:"vehicleContractAddress,omitempty"`
// VehicleIdentificationNumber is the VIN of the vehicle.
VehicleIdentificationNumber string `json:"vehicleIdentificationNumber,omitempty"`
// RecordedBy is the entity that recorded the VIN.
RecordedBy string `json:"recordedBy,omitempty"`
// RecordedAt is the time the VIN was recorded.
RecordedAt time.Time `json:"recordedAt,omitempty"`
// CountryCode that VIN belongs to.
CountryCode string `json:"countryCode,omitempty"`
}
VINSubject represents the subject of the VIN verifiable credential.
type VehicleHealthStatus ¶ added in v0.1.8
type VehicleHealthStatus struct {
// DTCs contains diagnostic trouble codes found.
DTCs []DiagnosticTroubleCode `json:"dtcs"`
// TirePressure contains tire pressure readings.
TirePressure *TirePressureStatus `json:"tirePressure,omitempty"`
// HealthScore is an overall health score (0-100).
HealthScore int `json:"healthScore"`
// IsHealthy indicates if the vehicle is considered healthy.
IsHealthy bool `json:"isHealthy"`
// LastUpdated is when this health status was last updated.
LastUpdated time.Time `json:"lastUpdated"`
}
VehicleHealthStatus represents the health status of a vehicle.
type VehicleHealthVCSubject ¶ added in v0.1.8
type VehicleHealthVCSubject struct {
VehicleDID cloudevent.ERC721DID `json:"vehicleDID,omitempty"`
// HealthStatus contains the vehicle health information.
HealthStatus VehicleHealthStatus `json:"healthStatus"`
// SearchedTimeRange is the time range that was searched.
SearchedTimeRange TimeRange `json:"searchedTimeRange"`
}
VehicleHealthVCSubject represents the subject of the VehicleHealthVC.
type VehiclePositionVCSubject ¶ added in v0.1.8
type VehiclePositionVCSubject struct {
// VehicleDID is the DID of the vehicle.
VehicleDID string `json:"vehicleDID,omitempty"`
// Location is the location data.
Location Location `json:"location"`
// RequestedTimestamp is the timestamp that was requested.
RequestedTimestamp time.Time `json:"requestedTimestamp"`
}
VehiclePositionVCSubject represents the subject of the VehiclePositionVC.