mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
Exit with error message on unrecognized config keys
This commit is contained in:
parent
a852b290ca
commit
cedf0b61ca
10 changed files with 27 additions and 26 deletions
|
|
@ -11,7 +11,7 @@ use aquatic_common::cli::LogLevel;
|
|||
|
||||
/// aquatic_http configuration
|
||||
#[derive(Clone, Debug, PartialEq, TomlConfig, Deserialize)]
|
||||
#[serde(default)]
|
||||
#[serde(default, deny_unknown_fields)]
|
||||
pub struct Config {
|
||||
/// Socket workers receive requests from the socket, parse them and send
|
||||
/// them on to the swarm workers. They then receive responses from the
|
||||
|
|
@ -52,7 +52,7 @@ impl aquatic_common::cli::Config for Config {
|
|||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, TomlConfig, Deserialize)]
|
||||
#[serde(default)]
|
||||
#[serde(default, deny_unknown_fields)]
|
||||
pub struct NetworkConfig {
|
||||
/// Bind to this address
|
||||
pub address: SocketAddr,
|
||||
|
|
@ -82,7 +82,7 @@ impl Default for NetworkConfig {
|
|||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, TomlConfig, Deserialize)]
|
||||
#[serde(default)]
|
||||
#[serde(default, deny_unknown_fields)]
|
||||
pub struct ProtocolConfig {
|
||||
/// Maximum number of torrents to accept in scrape request
|
||||
pub max_scrape_torrents: usize,
|
||||
|
|
@ -103,7 +103,7 @@ impl Default for ProtocolConfig {
|
|||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, TomlConfig, Deserialize)]
|
||||
#[serde(default)]
|
||||
#[serde(default, deny_unknown_fields)]
|
||||
pub struct CleaningConfig {
|
||||
/// Clean peers this often (seconds)
|
||||
pub torrent_cleaning_interval: u64,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue