mirror of
https://github.com/OMGeeky/confique.git
synced 2026-01-04 02:25:17 +01:00
Remove example module and doc-example feature
Now that we use derives, not a lot of magic happens anymore. Thus, I think it's not necessary to show the generated stuff anymore.
This commit is contained in:
@@ -9,13 +9,8 @@ edition = "2018"
|
||||
default = ["toml", "yaml"]
|
||||
yaml = ["serde_yaml"]
|
||||
|
||||
# This is used to enable the `example` module. This is only useful to generate
|
||||
# the docs for this library!
|
||||
doc-example = ["log"]
|
||||
|
||||
[dependencies]
|
||||
confique-macro = { path = "macro" }
|
||||
log = { version = "0.4", features = ["serde"], optional = true }
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
serde_yaml = { version = "0.8", optional = true }
|
||||
toml = { version = "0.5", optional = true }
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
//! This module demonstrate what a `config!` invocation will generate. This
|
||||
//! module exists merely for documentation purposes and is not usable from your
|
||||
//! crate.
|
||||
//!
|
||||
//! TODO
|
||||
|
||||
use std::{net::IpAddr, path::PathBuf};
|
||||
|
||||
// This is necessary because the macro generates a bunch of paths starting with
|
||||
// `confique`, assuming that symbol is in scope.
|
||||
#[doc(hidden)]
|
||||
use crate as confique;
|
||||
|
||||
crate::config! {
|
||||
// This is used here to make all items show up in the documentation.
|
||||
#![visibility = "pub"]
|
||||
|
||||
/// An example configuration.
|
||||
config: {
|
||||
dns: {
|
||||
/// The DNS server IP address.
|
||||
#[example = "1.1.1.1"]
|
||||
server: IpAddr,
|
||||
|
||||
/// Whether to use a local DNS resolution cache.
|
||||
use_cache: bool = true,
|
||||
|
||||
/// How often to reattempt reaching the DNS server.
|
||||
retry_attempts: u32 = 27,
|
||||
},
|
||||
|
||||
#[typename = "Logger"]
|
||||
log: {
|
||||
/// Sets the log level. Possible values: "trace", "debug", "info",
|
||||
/// "warn", "error" and "off".
|
||||
level: log::LevelFilter = "info",
|
||||
|
||||
/// If this is set, log messages are also written to this file.
|
||||
#[example = "/var/log/test.log"]
|
||||
file: Option<PathBuf>,
|
||||
},
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user