Skip to main content

Module config

Module config 

Source
Expand description

The configuration: the file, overridden by environment variables.

access_id = "…"
base_url = "https://www.rmv.de/hapi/"
timeout_seconds = 20
retries = 2
delay_threshold_minutes = 2

The file is config.toml in the directory of dirs::config, or the one RMV_CONFIG names. RMV_ACCESS_ID and RMV_BASE_URL override the file.

The access key is a secret: Settings and Config never show it in their Debug output, and Settings::get returns REDACTED for it.

Structs§

Config
The configuration in effect.
Settings
The contents of the configuration file. Unset values take their default.

Enums§

Error
The configuration file could not be read or written, or a value is invalid.

Constants§

DEFAULT_BASE_URL
The production server of RMV, dialect version 2.39.
DEFAULT_DELAY_THRESHOLD_MINUTES
From how many minutes late an arrival counts as delayed.
DEFAULT_RETRIES
How often a request is repeated after a transient error.
DEFAULT_TIMEOUT_SECONDS
MAX_RETRIES
The most repetitions the setting allows. Every repetition counts against the quota of the access key.
REDACTED
What stands in for the access key in texts of the API that echo it.