Skip to main content

modo/geolocation/
config.rs

1use serde::Deserialize;
2
3/// Configuration for the geolocation module.
4///
5/// Deserializes from the `geolocation` section of the application YAML config.
6#[non_exhaustive]
7#[derive(Debug, Clone, Deserialize, Default)]
8#[serde(default)]
9pub struct GeolocationConfig {
10    /// Path to the MaxMind GeoLite2 or GeoIP2 `.mmdb` database file.
11    ///
12    /// Supports `${VAR}` and `${VAR:default}` env-var substitution when loaded
13    /// through the framework's config loader. An empty path causes
14    /// [`GeoLocator::from_config`](super::GeoLocator::from_config) to return an error.
15    pub mmdb_path: String,
16}