Help us shape the future of Go! Take the 2026 Go Developer Survey

internal/

directory
v0.40.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2026 License: MIT

Directories

Path Synopsis
Package adminaudit records admin actions: who did what to whom, when and from where.
Package adminaudit records admin actions: who did what to whom, when and from where.
Package adminhealth builds the read-only "is everything OK?" summary for the admin home: firing alerts (Alertmanager), the kill switch, Rivian call health over the last 24 h, streaming vs leased vehicles, disk, backup age and version.
Package adminhealth builds the read-only "is everything OK?" summary for the admin home: firing alerts (Alertmanager), the kill switch, Rivian call health over the last 24 h, streaming vs leased vehicles, disk, backup age and version.
Package adminonly is the startup contract of the admin deployment (RIVOLT_ADMIN_ONLY=true, admin.rivolt.dev): the same image as the public site, serving only the admin surface behind Cloudflare Access, and running no background work.
Package adminonly is the startup contract of the admin deployment (RIVOLT_ADMIN_ONLY=true, admin.rivolt.dev): the same image as the public site, serving only the admin surface behind Cloudflare Access, and running no background work.
Package ai hosts the hot-swappable LLM provider adapters (OpenAI, Anthropic, Google Gemini) used across Rivolt: weekly digest, trip planning, charging strategy, and anomaly explanations.
Package ai hosts the hot-swappable LLM provider adapters (OpenAI, Anthropic, Google Gemini) used across Rivolt: weekly digest, trip planning, charging strategy, and anomaly explanations.
Package aibudget enforces a per-user daily cap on LLM-backed calls (trip advice, drive efficiency).
Package aibudget enforces a per-user daily cap on LLM-backed calls (trip advice, drive efficiency).
Package analytics hosts local, deterministic analyses over the user's driving and charging history.
Package analytics hosts local, deterministic analyses over the user's driving and charging history.
Package api wires the HTTP surface for Rivolt.
Package api wires the HTTP surface for Rivolt.
Package appauth is the server side of the native app's sign-in (iOS design §2): the app never handles a password or an IdP token.
Package appauth is the server side of the native app's sign-in (iOS design §2): the app never handles a password or an IdP token.
Package appleid keeps the link between a Rivolt account and its Sign in with Apple identity (App Store 4.8; architect's design, DA-approved Oct 24): the identity's stable `sub`, which Apple's server-to-server notifications use to name the user, and the refresh token, kept only so deleting the account can revoke it.
Package appleid keeps the link between a Rivolt account and its Sign in with Apple identity (App Store 4.8; architect's design, DA-approved Oct 24): the identity's stable `sub`, which Apple's server-to-server notifications use to name the user, and the refresh token, kept only so deleting the account can revoke it.
Package appsettings is the install-wide key/value store backing the AI provider configuration (and any future install-scoped setting).
Package appsettings is the install-wide key/value store backing the AI provider configuration (and any future install-scoped setting).
Package archive holds the telemetry archive's building blocks (N19, telemetry-archive-design.md): per-user data keys and the encrypted stream every archive object is written in.
Package archive holds the telemetry archive's building blocks (N19, telemetry-archive-design.md): per-user data keys and the encrypted stream every archive object is written in.
s3
Package s3 is a minimal S3 client for the telemetry archive: put, get, delete and list objects in one bucket, path-style, signed with AWS Signature Version 4 over the real payload hash (never UNSIGNED-PAYLOAD).
Package s3 is a minimal S3 client for the telemetry archive: put, get, delete and list objects in one bucket, path-style, signed with AWS Signature Version 4 over the real payload hash (never UNSIGNED-PAYLOAD).
Package auth owns Rivolt's session-level authentication: the /api/auth/* endpoints, the cookie format, and the middleware that resolves an authenticated user into request context.
Package auth owns Rivolt's session-level authentication: the /api/auth/* endpoints, the cookie format, and the middleware that resolves an authenticated user into request context.
Package bg tracks the process's fire-and-forget goroutines (a re-auth email, a close hook's push, a detached write) so shutdown can wait for them, bounded, instead of closing the database under them.
Package bg tracks the process's fire-and-forget goroutines (a re-auth email, a close hook's push, a detached write) so shutdown can wait for them, bounded, instead of closing the database under them.
Package cfaccess verifies the Cloudflare Access JWT that fronts the admin deployment (RIVOLT_ADMIN_ONLY).
Package cfaccess verifies the Cloudflare Access JWT that fronts the admin deployment (RIVOLT_ADMIN_ONLY).
Package changelog serves Rivolt's release notes: the hand-written notes of each release, as published on its GitHub Release, for the /changelog page and the Atom feed.
Package changelog serves Rivolt's release notes: the hand-written notes of each release, as published on its GitHub Release, for the /changelog page and the Atom feed.
Package chargers serves the chargers.pmtiles archive from the rivolt API: the entire ~10 MB file is fetched once at startup (or first request), parsed in-memory, and queries against it run fully server-side.
Package chargers serves the chargers.pmtiles archive from the rivolt API: the entire ~10 MB file is fetched once at startup (or first request), parsed in-memory, and queries against it run fully server-side.
Package charges persists derived charge sessions.
Package charges persists derived charge sessions.
Package clientip decides which address a request really came from.
Package clientip decides which address a request really came from.
Package config holds runtime configuration for rivolt.
Package config holds runtime configuration for rivolt.
Package crypto is Rivolt's in-process key-wrapping layer.
Package crypto is Rivolt's in-process key-wrapping layer.
Package db owns the Rivolt Postgres connection pool, the shared migration runner, and a handful of identity helpers used by every store.
Package db owns the Rivolt Postgres connection pool, the shared migration runner, and a handful of identity helpers used by every store.
Package dcfcrates owns the DCFC network table used by trip planning.
Package dcfcrates owns the DCFC network table used by trip planning.
Package demo seeds and identifies the public read-only demo account (B7).
Package demo seeds and identifies the public read-only demo account (B7).
Package drain computes the fleet's parked-drain metrics from the persisted vehicle_state history and exposes them to Prometheus (D1, the instrument for the battery-drain experiment's Gate A).
Package drain computes the fleet's parked-drain metrics from the persisted vehicle_state history and exposes them to Prometheus (D1, the instrument for the battery-drain experiment's Gate A).
Package drives persists derived drive sessions.
Package drives persists derived drive sessions.
Package electrafi imports TeslaFi / ElectraFi polling-dump CSV files into Rivolt's drives and charges stores.
Package electrafi imports TeslaFi / ElectraFi polling-dump CSV files into Rivolt's drives and charges stores.
Package elevation looks up altitude (meters above sea level) for arbitrary lat/lon coordinates against the Mapzen Terrarium DEM (https://github.com/tilezen/joerd/blob/master/docs/formats.md#terrarium).
Package elevation looks up altitude (meters above sea level) for arbitrary lat/lon coordinates against the Mapzen Terrarium DEM (https://github.com/tilezen/joerd/blob/master/docs/formats.md#terrarium).
Package email sends transactional mail via the Resend HTTP API.
Package email sends transactional mail via the Resend HTTP API.
Package engage is the one door for every non-transactional message (a plug-in reminder, a weekly recap, a milestone): it decides whether a message may go out at all and makes sure each one goes out at most once.
Package engage is the one door for every non-transactional message (a plug-in reminder, a weekly recap, a milestone): it decides whether a message may go out at all and makes sure each one goes out at most once.
Package flags owns the DB-backed operational flag table (migration 0003_flags.sql).
Package flags owns the DB-backed operational flag table (migration 0003_flags.sql).
Package geocoding wraps Open-Meteo's free geocoding endpoint (https://geocoding-api.open-meteo.com/v1/search) for forward- geocoding text input → lat/lon.
Package geocoding wraps Open-Meteo's free geocoding endpoint (https://geocoding-api.open-meteo.com/v1/search) for forward- geocoding text input → lat/lon.
Package hydra is a thin admin-API client for Ory Hydra.
Package hydra is a thin admin-API client for Ory Hydra.
Package identity holds the two install-wide switches that decide how much an email address is trusted when it identifies an account.
Package identity holds the two install-wide switches that decide how much an email address is trusted when it identifies an account.
Package idp defines the UserProvider interface — the single contract between Rivolt's API layer and whichever identity backend is deployed.
Package idp defines the UserProvider interface — the single contract between Rivolt's API layer and whichever identity backend is deployed.
Package insights computes read-only breakdowns of the user's own recorded data.
Package insights computes read-only breakdowns of the user's own recorded data.
Package iosapp is the link to Rivolt's iPhone app: one setting, RIVOLT_IOS_APP_URL, that every surface (the Settings row, the share card, the store banner, /app, the welcome and statement emails) reads.
Package iosapp is the link to Rivolt's iPhone app: one setting, RIVOLT_IOS_APP_URL, that every surface (the Settings row, the share card, the store banner, /app, the welcome and statement emails) reads.
Package kratos provides admin-side provisioning of Ory Kratos identities via the Kratos admin API.
Package kratos provides admin-side provisioning of Ory Kratos identities via the Kratos admin API.
Package leases coordinates per-vehicle ownership across multiple rivolt pods so each vehicle is subscribed by exactly one process.
Package leases coordinates per-vehicle ownership across multiple rivolt pods so each vehicle is subscribed by exactly one process.
Package ledger builds the server-side money statement (the Money tab and, eventually, every cost/energy total in the SPA) from recorded charges and drives.
Package ledger builds the server-side money statement (the Money tab and, eventually, every cost/energy total in the SPA) from recorded charges and drives.
Package leftopen sends the left-open alert: an opt-in push when a door, the frunk, the liftgate, the tailgate or the tonneau has stayed open for OpenFor after the truck was parked and left (DA's ruling, Sprint 8 item 4).
Package leftopen sends the left-open alert: an opt-in push when a door, the frunk, the liftgate, the tailgate or the tonneau has stayed open for OpenFor after the truck was parked and left (DA's ruling, Sprint 8 item 4).
Package logging provides a context-aware slog handler and helpers for stamping per-request fields (request_id, user_id, vehicle_id, trace_id) onto every log line emitted while serving a request, without requiring callers to thread the logger through.
Package logging provides a context-aware slog handler and helpers for stamping per-request fields (request_id, user_id, vehicle_id, trace_id) onto every log line emitted while serving a request, without requiring callers to thread the logger through.
Package maps wires same-origin reverse-proxies that let the SPA reach self-hosted map services (Valhalla for routing + map matching, an nginx-served PMTiles bundle for vector basemaps) through the existing rivolt origin and session cookie.
Package maps wires same-origin reverse-proxies that let the SPA reach self-hosted map services (Valhalla for routing + map matching, an nginx-served PMTiles bundle for vector basemaps) through the existing rivolt origin and session cookie.
Package metrics owns the application's Prometheus instrumentation.
Package metrics owns the application's Prometheus instrumentation.
Package milestones notices when a vehicle passes one of a few round numbers (1,000 miles recorded, 1 MWh charged at home, 100 charges, halfway through the lease, and a personal-best efficiency on a long drive), keeps a dismissible card for each, and pushes it to the devices that turned milestones on.
Package milestones notices when a vehicle passes one of a few round numbers (1,000 miles recorded, 1 MWh charged at home, 100 charges, halfway through the lease, and a personal-best efficiency on a long drive), keeps a dismissible card for each, and pushes it to the devices that turned milestones on.
Package offpeak is the user's electricity schedule: the times of day (in their own time zone) at which their plan charges a different rate, and the checks that keep a schedule well formed.
Package offpeak is the user's electricity schedule: the times of day (in their own time zone) at which their plan charges a different rate, and the checks that keep a schedule well formed.
Package oidc adds an OIDC sign-in path alongside the static operator credential and the trusted-proxy header in internal/auth.
Package oidc adds an OIDC sign-in path alongside the static operator credential and the trusted-proxy header in internal/auth.
Package onboardmail sends the welcome email and the setup reminders: at most three emails per user ever (one welcome, two reminders), only to a verified address, only until the truck is connected and sending data, and never after the user opted out.
Package onboardmail sends the welcome email and the setup reminders: at most three emails per user ever (one welcome, two reminders), only to a verified address, only until the truck is connected and sending data, and never after the user opted out.
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.
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.
Package overnight suggests where to sleep at the end of a planned day: hotel Level 2 chargers from the NREL listing near the point where the day's drive budget runs out.
Package overnight suggests where to sleep at the end of a planned day: hotel Level 2 chargers from the NREL listing near the point where the day's drive budget runs out.
Package packhealth derives an "effective pack capacity" per qualifying charge session.
Package packhealth derives an "effective pack capacity" per qualifying charge session.
Package passkeys is Rivolt's WebAuthn: passkeys as a second way to sign in to an email account, next to the password (Sprint 10; DA-approved design).
Package passkeys is Rivolt's WebAuthn: passkeys as a second way to sign in to an email account, next to the password (Sprint 10; DA-approved design).
passkeytest
Package passkeytest is a software authenticator for tests: enough of one to make attestations ("none") and assertions that the WebAuthn library accepts, with the flags, origin and counter under the test's control.
Package passkeytest is a software authenticator for tests: enough of one to make attestations ("none") and assertions that the WebAuthn library accepts, with the flags, origin and counter under the test's control.
Package planleg caches planner calls and caps how many a user can make.
Package planleg caches planner calls and caps how many a user can make.
Package plugreminder sends the "Plug in tonight?" push: an opt-in, once a day, when the truck is parked at the saved home place, not plugged in, and below the SoC the user set.
Package plugreminder sends the "Plug in tonight?" push: an opt-in, once a day, when the truck is parked at the saved home place, not plugged in, and below the SoC the user set.
Package privacy holds repository-wide checks that keep real people's data out of the source tree.
Package privacy holds repository-wide checks that keep real people's data out of the source tree.
Package push handles Web Push subscriptions and notification delivery.
Package push handles Web Push subscriptions and notification delivery.
Package ratelimit implements the global upstream token bucket gating outbound calls to Rivian's GraphQL gateway.
Package ratelimit implements the global upstream token bucket gating outbound calls to Rivian's GraphQL gateway.
Package recap turns a finished drive into a short natural-language narration ("Trip recap") via the operator-configured LLM provider.
Package recap turns a finished drive into a short natural-language narration ("Trip recap") via the operator-configured LLM provider.
Package receipts syncs what Rivian actually billed for each charging session (its Charging history) next to our own estimate.
Package receipts syncs what Rivian actually billed for each charging session (its Charging history) next to our own estimate.
Package repair holds one-off data repairs run from the rivolt CLI.
Package repair holds one-off data repairs run from the rivolt CLI.
blips
Package blips is the repair for wake-blip charges: rows the recorder wrote when a truck woke from sleep, its first vehicleState frame replayed the pre-sleep "charging_active" and the next frame, about a second later, said complete (fixed in the recorder by liveCharge.blip, #1254).
Package blips is the repair for wake-blip charges: rows the recorder wrote when a truck woke from sleep, its first vehicleState frame replayed the pre-sleep "charging_active" and the next frame, about a second later, said complete (fixed in the recorder by liveCharge.blip, #1254).
chargeenergy
Package chargeenergy repairs the energy of AC home charges the recorder under-recorded.
Package chargeenergy repairs the energy of AC home charges the recorder under-recorded.
phantom
Package phantom is the repair for phantom (stale-copy) live charges: rows the recorder fabricated from a replayed previous-session total, with no power and no SoC change behind them (architect's scratchpad/phantom-charges.md; devils-advocate's audit).
Package phantom is the repair for phantom (stale-copy) live charges: rows the recorder fabricated from a replayed previous-session total, with no power and no SoC change behind them (architect's scratchpad/phantom-charges.md; devils-advocate's audit).
r2
Package r2 rebuilds the drives and charges of a vehicle whose vehicleState gear was unusable (R2 before #214: the gear stayed at the last D/R for days, so drives never closed and no charge opened).
Package r2 rebuilds the drives and charges of a vehicle whose vehicleState gear was unusable (R2 before #214: the gear stayed at the last D/R for days, so drives never closed and no charge opened).
Package retention runs the daily sweeps that delete personal data once it has outlived its purpose: expired sessions (IP and User-Agent) and waitlist requests.
Package retention runs the daily sweeps that delete personal data once it has outlived its purpose: expired sessions (IP and User-Agent) and waitlist requests.
Package rivian is Rivolt's adapter to the unofficial Rivian owner-app GraphQL API.
Package rivian is Rivolt's adapter to the unofficial Rivian owner-app GraphQL API.
Package rivianexpiry warns about a Rivian session before it expires.
Package rivianexpiry warns about a Rivian session before it expires.
Package samples persists raw vehicle_state polling snapshots.
Package samples persists raw vehicle_state polling snapshots.
Package secrets is the persistence layer on top of [`internal/crypto`](../crypto).
Package secrets is the persistence layer on top of [`internal/crypto`](../crypto).
Package sessions is the source-of-truth store for authenticated user sessions.
Package sessions is the source-of-truth store for authenticated user sessions.
Package settings persists app-level configuration (AI provider keys, charging cost, Rivian session) in the shared Postgres database.
Package settings persists app-level configuration (AI provider keys, charging cost, Rivian session) in the shared Postgres database.
Package signupgate implements RIVOLT_SIGNUP_DISABLED: an install-wide switch that closes every path that can create a new account on its own (the /signup page and API, access requests, OIDC and Kratos first sign-in).
Package signupgate implements RIVOLT_SIGNUP_DISABLED: an install-wide switch that closes every path that can create a new account on its own (the /signup page and API, access requests, OIDC and Kratos first sign-in).
Package signuprequests manages the pre-account waitlist: someone visits /signup without an invite, fills the "request access" form, and lands as a pending row that an admin later approves (minting a single-use magic-link signup token) or rejects.
Package signuprequests manages the pre-account waitlist: someone visits /signup without an invite, fills the "request access" form, and lands as a pending row that an admin later approves (minting a single-use magic-link signup token) or rejects.
Package statement builds and sends the monthly statement email (scratchpad/statement-email-spec.md): pure rendering from the ledger's own Monthly, the signed unsubscribe token, the preference and send-state store, and the idempotent hourly job.
Package statement builds and sends the monthly statement email (scratchpad/statement-email-spec.md): pure rendering from the ledger's own Monthly, the signed unsubscribe token, the preference and send-state store, and the idempotent hourly job.
Package syntheticplan is the deterministic trip planner that stands in for the gateway on installs that have no Rivian access (preview): a Valhalla route, an energy model, and charging stops picked from the DC fast-charger archive.
Package syntheticplan is the deterministic trip planner that stands in for the gateway on installs that have no Rivian access (preview): a Valhalla route, an energy model, and charging stops picked from the DC fast-charger archive.
Package tracing wires the OpenTelemetry trace SDK with an OTLP/HTTP exporter pointed at Grafana Tempo.
Package tracing wires the OpenTelemetry trace SDK with an OTLP/HTTP exporter pointed at Grafana Tempo.
Package tripadvice wraps the operator-configured AI provider to generate plain-language observations about a Rivian trip plan: charging stop summary, arrival SoC commentary, adapter warnings, and drive-mode suggestions when the plan looks sub-optimal.
Package tripadvice wraps the operator-configured AI provider to generate plain-language observations about a Rivian trip plan: charging stop summary, arrival SoC commentary, adapter warnings, and drive-mode suggestions when the plan looks sub-optimal.
Package tripmultiday orchestrates a multi-day trip plan over the trip planner (Rivian's planTripWithMultiStopV2, or the replay planners on installs with no Rivian access).
Package tripmultiday orchestrates a multi-day trip plan over the trip planner (Rivian's planTripWithMultiStopV2, or the replay planners on installs with no Rivian access).
Package tripprofile derives an energy-consumption multiplier from a user's editable VehicleProfile (wheel size, tire type, roof / rear accessories, default cargo).
Package tripprofile derives an energy-consumption multiplier from a user's editable VehicleProfile (wheel size, tire type, roof / rear accessories, default cargo).
Package trips persists per-user named trip templates for the planner.
Package trips persists per-user named trip templates for the planner.
Package tripweather corrects a Rivian trip plan's per-waypoint SoC curve for weather conditions Rivian's planner doesn't see.
Package tripweather corrects a Rivian trip plan's per-waypoint SoC curve for weather conditions Rivian's planner doesn't see.
Package vehiclelease holds a vehicle's lease terms and computes where the driver stands against the mileage allowance.
Package vehiclelease holds a vehicle's lease terms and computes where the driver stands against the mileage allowance.
Package weather enriches a drive with the conditions at its start point and time.
Package weather enriches a drive with the conditions at its start point and time.
Package web embeds the built Vite web app into the Go binary.
Package web embeds the built Vite web app into the Go binary.
Package weekly is the opt-in weekly recap email: on Monday morning, last week's miles, energy, cost and efficiency, and lease pace if the user tracks a lease.
Package weekly is the opt-in weekly recap email: on Monday morning, last week's miles, energy, cost and efficiency, and lease pace if the user tracks a lease.
Package zonelookup names the IANA time zone at a coordinate, offline: the boundaries are embedded (bradfitz/latlong), so no request leaves the process and no place is sent to anyone.
Package zonelookup names the IANA time zone at a coordinate, offline: the boundaries are embedded (bradfitz/latlong), so no request leaves the process and no place is sent to anyone.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL