Crate merino_settings
source · [−]Expand description
Merino Settings
The top level settings struct is Settings. If you are looking for documentation about the settings that can be set, start there.
Configuration is specified in several ways, with later methods overriding earlier ones.
- A base configuration checked into the repository, in
config/base.yaml
. This provides the default values for most settings. - Per-environment configuration files in the
config
directory. The environment is selected using the environment variableMERINO__ENV
. The settings for that environment are then loaded fromconfig/${env}.yaml
, if it exists. The default environment is “development”. A “production” environment is also provided. - A local configuration file not checked into the repository, at
config/local.yaml
. This file is in.gitignore
and is safe to use for local configuration and secrets if desired. - Environment variables that begin with
MERINO
and use__
as a level separator. For example,Settings::http::workers
can be controlled from the environment variableMERINO__HTTP__WORKERS
.
Tests should use Settings::load_for_test
which only reads from
config/base.yaml
, config/test.yaml
, and config/local_test.yaml
(if it
exists). It does not read from environment variables.
Configuration files are canonically YAML files. However, any format supported
by the config crate can be used, including JSON and TOML. To choose another
format, simply use a different extension for your file, like
config/local.toml
.
Re-exports
pub use crate::providers::SuggestionProviderConfig;
Modules
Structs
Settings for the HTTP server.
Logging settings.
Top level settings object for Merino.
Enums
Top-level settings for suggestion providers.
Settings for the error and event reporting system Sentry.