Documentation
¶
Overview ¶
Package demo seeds and identifies the public read-only demo account (B7). It is PREVIEW ONLY: Enabled requires RIVOLT_DEMO=true and RIVIAN_CLIENT=replay and RIVOLT_REPLAY_SOURCE=sample, so a production install (live client) never turns it on even if the variable leaks into its environment.
Index ¶
Constants ¶
const ( HomeLat = 34.1613 HomeLon = -118.1676 HomeLabel = "Rose Bowl parking (sample)" // HomeRate is the demo's home $/kWh, USD. HomeRate = 0.16 )
The demo truck's "home": the sample generator's public, non- residential stadium parking lot (never anyone's address).
const Username = "rivolt-public-demo"
Username is the demo account's username. It has no @, so it can't collide with a real (email-derived) sign-in, and nobody holds a credential for it: it is only ever reached through the anonymous, read-only allowlist.
Variables ¶
This section is empty.
Functions ¶
func Enabled ¶
func Enabled() bool
Enabled reports whether the demo is on: RIVOLT_DEMO=true on an install running the replay client over the GENERATED sample corpus (RIVOLT_REPLAY_SOURCE=sample). Replaying a recorded vehicle would publish a real person's history anonymously, so anything else fails closed.
func Seed ¶
Seed creates (or refreshes) the demo user, its settings, its replay session and a few older charges. Idempotent; safe at every boot. It does nothing unless Enabled.
func SeedCharges ¶
SeedCharges are the hand-written older sessions that complete the cost-source set (the replay stream supplies home_rate and network_estimate): Rivian-billed DC fast, user-entered AC, a pending (unpriced) AC session and a home-rate home session. They sit 50-60 days back, before the 45-day replay corpus, so they never overlap a replayed session. Times are day-aligned, so reseeding is stable.