load

Function load 

Source
pub(crate) fn load(path: &Path) -> Result<Config, Box<dyn Error>>
Expand description

Loads configuration from a TOML file, then applies environment variable overrides.

§Environment variable overrides

The following environment variables, when set, override the corresponding TOML fields:

  • STARGAZER_POSTGRES_URL overrides postgres.url
  • STARGAZER_RDIO_ENDPOINT overrides rdio.endpoint
  • STARGAZER_RDIO_API_KEY overrides rdio.api_key
  • STARGAZER_TIER3_DPLUS_CALLSIGN overrides tier3.dplus_callsign
  • STARGAZER_SERVER_LISTEN overrides server.listen

§Errors

Returns an error if the file cannot be read or contains invalid TOML, or if the STARGAZER_SERVER_LISTEN environment variable contains an invalid socket address.