Documentation
¶
Index ¶
- type AftermarketDeviceAddressResetData
- type AftermarketDeviceAttributeSetData
- type AftermarketDeviceClaimedData
- type AftermarketDeviceNodeMintedData
- type AftermarketDevicePairData
- type AftermarketDeviceUnclaimedData
- type BeneficiarySetData
- type CatalogDefinition
- type CatalogDefinitionAttribute
- type CatalogDefinitionMetadata
- type CatalogManufacturer
- type CatalogTrim
- type ContractsEventsConsumer
- type DCNNameChangedData
- type DCNVehicleIdChangedData
- type DefinitionsCatalogOption
- type DefinitionsCatalogService
- func (s *DefinitionsCatalogService) Close()
- func (s *DefinitionsCatalogService) DefinitionsByManufacturer(ctx context.Context, manufacturerTokenID int) ([]*CatalogDefinition, error)
- func (s *DefinitionsCatalogService) GetDefinitionByID(ctx context.Context, id string) (*CatalogDefinition, error)
- func (s *DefinitionsCatalogService) Start()
- type DeviceDefinition
- type DeviceDefinitionDoc
- type DeviceDefinitionIdSetData
- type DeviceDefinitionTableCreatedData
- type EventName
- type FetchAPIService
- type IssuedData
- type LicenseAliasSetData
- type ManufacturerContractService
- type ManufacturerNodeMintedData
- type ManufacturerSlugs
- type ManufacturerTableSetData
- type NewDCNExpirationData
- type NewDCNNodeData
- type PermissionsRenouncedData
- type PermissionsSetData
- type PermissionsSetWithTemplateData
- type PrivilegeSetData
- type RedirectUriDisabledData
- type RedirectUriEnabledData
- type SignerDisabledData
- type SignerEnabledData
- type SyntheticDeviceNodeBurnedData
- type SyntheticDeviceNodeMintedData
- type TemplateCreatedData
- type TokensTransferredForConnectionStreakData
- type TokensTransferredForDeviceData
- type TransferData
- type VehicleAttributeSetData
- type VehicleNodeMintedData
- type VehicleNodeMintedWithDeviceDefinitionData
- type VehicleStorageNodeIdSetData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AftermarketDeviceAddressResetData ¶ added in v0.1.11
type AftermarketDeviceUnclaimedData ¶ added in v0.5.2
type BeneficiarySetData ¶
type CatalogDefinition ¶ added in v0.6.8
type CatalogDefinition struct {
ID string `json:"id"`
KSUID string `json:"ksuid"`
Model string `json:"model"`
Year int `json:"year"`
DeviceType string `json:"devicetype"`
ImageURI string `json:"imageuri"`
Metadata CatalogDefinitionMetadata `json:"metadata"`
Manufacturer CatalogManufacturer `json:"manufacturer"`
// Trims carries the per-trim attributes a flattened definition cannot
// hold. Empty for a definition decoded from the legacy manifest, which has
// no trims at all -- so a reader must treat empty as "not published here",
// never as "this model-year has no trims".
Trims []CatalogTrim `json:"trims"`
}
CatalogDefinition is one device definition document from the R2 catalog. JSON keys match the documents the definitions-worker writes.
type CatalogDefinitionAttribute ¶ added in v0.6.8
CatalogDefinitionAttribute is a single device attribute name/value pair.
type CatalogDefinitionMetadata ¶ added in v0.6.8
type CatalogDefinitionMetadata struct {
DeviceAttributes []CatalogDefinitionAttribute `json:"device_attributes"`
}
CatalogDefinitionMetadata holds the device-specific attribute list. The zero value means the definition carries none.
func (*CatalogDefinitionMetadata) UnmarshalJSON ¶ added in v0.6.8
func (m *CatalogDefinitionMetadata) UnmarshalJSON(data []byte) error
UnmarshalJSON accepts null and "" as no metadata. Legacy Tableland rows carried "", and backfilled documents may still. The tolerance lives on this one field so the rest of a definition decodes in a single pass; it used to re-decode the whole definition to reach it.
type CatalogManufacturer ¶ added in v0.6.8
type CatalogManufacturer struct {
TokenID int `json:"tokenId"`
Slug string `json:"slug"`
Name string `json:"name"`
}
CatalogManufacturer identifies the manufacturer a definition belongs to.
type CatalogTrim ¶ added in v0.6.8
type CatalogTrim struct {
Name string `json:"name"`
HardwareTemplateID string `json:"hardwareTemplateId"`
Attributes []CatalogDefinitionAttribute `json:"attributes"`
}
CatalogTrim is one trim of a template. Only the fields this service serves are decoded: selectors are how device-definitions-api matches a decoded VIN to a trim, which is that service's job and not something identity answers.
type ContractsEventsConsumer ¶
type ContractsEventsConsumer struct {
// contains filtered or unexported fields
}
func (*ContractsEventsConsumer) Process ¶
func (c *ContractsEventsConsumer) Process(ctx context.Context, event *cloudevent.RawEvent) error
type DCNNameChangedData ¶
type DCNVehicleIdChangedData ¶
type DefinitionsCatalogOption ¶ added in v0.6.8
type DefinitionsCatalogOption func(*DefinitionsCatalogService)
DefinitionsCatalogOption configures the service at construction.
func WithManufacturerSlugs ¶ added in v0.6.8
func WithManufacturerSlugs(lookup ManufacturerSlugs) DefinitionsCatalogOption
WithManufacturerSlugs gives the service its chain check: a candidate catalog is compared with the manufacturers this deployment has before it is adopted.
type DefinitionsCatalogService ¶ added in v0.6.8
type DefinitionsCatalogService struct {
// contains filtered or unexported fields
}
DefinitionsCatalogService keeps the R2 device definitions catalog in memory. One goroutine refreshes it and swaps in an immutable snapshot; reads are served from that snapshot and never wait on network I/O. It replaces the per-query Tableland proxy.
func NewDefinitionsCatalogService ¶ added in v0.6.8
func NewDefinitionsCatalogService(log *zerolog.Logger, settings *config.Settings, opts ...DefinitionsCatalogOption) (*DefinitionsCatalogService, error)
NewDefinitionsCatalogService validates the DEFINITIONS_* settings and builds the service. A malformed catalog URL, floor or staleness bound fails construction, and with it startup, instead of starting a pod whose every device-definition query fails or whose floor is silently disabled.
It contacts nothing: call Start at process start so a pod warms before it takes traffic. A first read starts the refresh too, so a caller that never calls Start still works.
func (*DefinitionsCatalogService) Close ¶ added in v0.6.8
func (s *DefinitionsCatalogService) Close()
Close stops the refresh goroutine.
func (*DefinitionsCatalogService) DefinitionsByManufacturer ¶ added in v0.6.8
func (s *DefinitionsCatalogService) DefinitionsByManufacturer(ctx context.Context, manufacturerTokenID int) ([]*CatalogDefinition, error)
DefinitionsByManufacturer returns the manufacturer's definitions sorted by id. It answers from the snapshot alone, with no per-query fallback: a listing is a page of results, and going to the origin for it would put the catalog back in the request path, which is what this service exists to avoid. A definition published since the last build is reachable by id, and joins the listing at the next build.
func (*DefinitionsCatalogService) GetDefinitionByID ¶ added in v0.6.8
func (s *DefinitionsCatalogService) GetDefinitionByID(ctx context.Context, id string) (*CatalogDefinition, error)
GetDefinitionByID returns the definition with the given slug id, or nil.
In template mode the listing only changes when a build is published, so a definition created since that build is not in the snapshot. A miss falls back to the template document itself, which the worker writes as soon as the definition is created.
func (*DefinitionsCatalogService) Start ¶ added in v0.6.8
func (s *DefinitionsCatalogService) Start()
Start begins refreshing the catalog in the background.
type DeviceDefinition ¶
type DeviceDefinitionDoc ¶ added in v0.6.0
DeviceDefinitionDoc holds the device definition fields stored in the fetch-api.
type DeviceDefinitionIdSetData ¶ added in v0.2.7
type DeviceDefinitionTableCreatedData ¶ added in v0.1.24
type EventName ¶
type EventName string
const ( // All NFTs. Transfer EventName = "Transfer" PrivilegeSet EventName = "PrivilegeSet" BeneficiarySetEvent EventName = "BeneficiarySet" // SACD. PermissionsSetEvent EventName = "PermissionsSet" PermissionsRenouncedEvent EventName = "PermissionsRenounced" // Template. TemplateCreatedEvent EventName = "TemplateCreated" // Manufacturers. ManufacturerNodeMinted EventName = "ManufacturerNodeMinted" DeviceDefinitionTableCreated EventName = "DeviceDefinitionTableCreated" ManufacturerTableSet EventName = "ManufacturerTableSet" // Aftermarket devices. AftermarketDeviceNodeMinted EventName = "AftermarketDeviceNodeMinted" AftermarketDeviceAttributeSet EventName = "AftermarketDeviceAttributeSet" AftermarketDeviceClaimed EventName = "AftermarketDeviceClaimed" AftermarketDevicePaired EventName = "AftermarketDevicePaired" AftermarketDeviceUnclaimed EventName = "AftermarketDeviceUnclaimed" AftermarketDeviceUnpaired EventName = "AftermarketDeviceUnpaired" AftermarketDeviceAddressReset EventName = "AftermarketDeviceAddressReset" // Vehicles. VehicleNodeMinted EventName = "VehicleNodeMinted" VehicleAttributeSet EventName = "VehicleAttributeSet" VehicleNodeMintedWithDeviceDefinition EventName = "VehicleNodeMintedWithDeviceDefinition" DeviceDefinitionIdSet EventName = "DeviceDefinitionIdSet" VehicleStorageNodeIdSet EventName = "VehicleStorageNodeIdSet" // Synthetic devices. SyntheticDeviceNodeMinted EventName = "SyntheticDeviceNodeMinted" SyntheticDeviceNodeBurned EventName = "SyntheticDeviceNodeBurned" // DCNs. NewNode EventName = "NewNode" NewExpiration EventName = "NewExpiration" NameChanged EventName = "NameChanged" VehicleIdChanged EventName = "VehicleIdChanged" // Rewards. TokensTransferredForDevice EventName = "TokensTransferredForDevice" TokensTransferredForConnectionStreak EventName = "TokensTransferredForConnectionStreak" // Developer licenses. Issued EventName = "Issued" RedirectUriEnabled EventName = "RedirectUriEnabled" RedirectUriDisabled EventName = "RedirectUriDisabled" SignerEnabled EventName = "SignerEnabled" SignerDisabled EventName = "SignerDisabled" LicenseAliasSet EventName = "LicenseAliasSet" )
type FetchAPIService ¶ added in v0.6.0
type FetchAPIService struct {
// contains filtered or unexported fields
}
FetchAPIService wraps the fetch-api gRPC client.
func NewFetchAPIService ¶ added in v0.6.0
func NewFetchAPIService(addr string, log *zerolog.Logger) (*FetchAPIService, error)
NewFetchAPIService creates a new FetchAPIService connecting to the given gRPC address.
func (*FetchAPIService) GetVehicleDefinitionDoc ¶ added in v0.6.0
func (s *FetchAPIService) GetVehicleDefinitionDoc(ctx context.Context, vehicleDID string) (*DeviceDefinitionDoc, error)
GetVehicleDefinitionDoc queries the fetch-api for the latest dimo.document.devicedefinition cloud event for the given vehicle DID. Returns nil, nil when no document exists.
type IssuedData ¶ added in v0.3.0
type LicenseAliasSetData ¶ added in v0.3.1
type ManufacturerContractService ¶ added in v0.1.26
type ManufacturerContractService struct {
// contains filtered or unexported fields
}
func NewManufacturerContractService ¶ added in v0.1.26
func (*ManufacturerContractService) GetTableName ¶ added in v0.1.26
type ManufacturerSlugs ¶ added in v0.6.8
ManufacturerSlugs returns every manufacturer's slug keyed by token id, as this deployment's chain knows them.
type ManufacturerTableSetData ¶ added in v0.1.24
type NewDCNExpirationData ¶
type NewDCNNodeData ¶
type PermissionsRenouncedData ¶ added in v0.6.5
type PermissionsSetData ¶ added in v0.2.0
type PermissionsSetWithTemplateData ¶ added in v0.5.2
type PrivilegeSetData ¶
type RedirectUriDisabledData ¶ added in v0.3.0
type RedirectUriEnabledData ¶ added in v0.3.0
type SignerDisabledData ¶ added in v0.3.0
type SignerEnabledData ¶ added in v0.3.0
type SyntheticDeviceNodeMintedData ¶
type SyntheticDeviceNodeMintedData struct {
IntegrationNode *big.Int
ConnectionID *big.Int // Note that we've never had a Solidity event that has both this and IntegrationNode. This is purely for a smooth transition.
SyntheticDeviceNode *big.Int
VehicleNode *big.Int
SyntheticDeviceAddress common.Address
Owner common.Address
}
type TemplateCreatedData ¶ added in v0.5.2
type TokensTransferredForConnectionStreakData ¶ added in v0.1.5
type TokensTransferredForDeviceData ¶ added in v0.1.5
type TransferData ¶
TransferData describes the fields of an ERC-721 Transfer(address,address,uint256) event.
type VehicleAttributeSetData ¶
type VehicleNodeMintedData ¶
type VehicleNodeMintedWithDeviceDefinitionData ¶ added in v0.1.26
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Code generated by gitub.com/DIMO-Network/eventgen.
|
Code generated by gitub.com/DIMO-Network/eventgen. |
|
Code generated by gitub.com/DIMO-Network/eventgen.
|
Code generated by gitub.com/DIMO-Network/eventgen. |
|
Code generated by gitub.com/DIMO-Network/eventgen.
|
Code generated by gitub.com/DIMO-Network/eventgen. |