Documentation
¶
Overview ¶
Package otadetails keeps each vehicle's OTA release details (current and available software version, release-notes link) fresh from Rivian's getOTAUpdateDetails: once a day per vehicle and when a monitor connects, never per request. The API reads what is stored.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Notifier ¶ added in v0.36.10
type Notifier func(Update)
Notifier delivers an Update (web push). It must not block.
type Syncer ¶
type Syncer struct {
// contains filtered or unexported fields
}
Syncer fetches OTA details for the vehicles of users with a Rivian session.
func New ¶
func New(pool *sql.DB, accounts rivian.AccountRegistry, users func(context.Context) ([]uuid.UUID, error), logger *slog.Logger) *Syncer
New wires a Syncer over a pool.
func (*Syncer) OnConnect ¶
OnConnect fetches for a user whose monitor just connected (boot or login), in the background. The claim keeps it to once a day per vehicle.
func (*Syncer) Run ¶
Run sweeps until ctx ends: every sweepEvery each user with a Rivian session, users userPace apart. Which vehicles are fetched is decided by the per-vehicle claim, so a sweep that finds nothing due costs no Rivian calls.
func (*Syncer) SetFence ¶ added in v0.40.13
SetFence makes the sync fetch only the vehicles whose group this pod owns, each write carrying that lease (lead mode); with lead mode off the source says Off and nothing changes.
func (*Syncer) SetNotifier ¶ added in v0.36.10
SetNotifier makes the syncer announce new and installed versions. Call before Run.