Expand description
Default locations for Signstar configuration files.
ยงExamples
use signstar_common::config::{
get_config_file_or_default,
get_config_file_paths,
get_config_file,
get_default_config_dir_path,
get_default_config_file_path,
get_etc_override_config_file_path,
get_etc_override_dir_path,
get_run_override_config_file_path,
get_run_override_dir_path,
get_usr_local_override_config_file_path,
get_usr_local_override_dir_path,
};
// Get directory paths for Signstar configuration files.
println!("{:?}", get_etc_override_dir_path());
println!("{:?}", get_run_override_dir_path());
println!("{:?}", get_usr_local_override_dir_path());
println!("{:?}", get_default_config_dir_path());
// Get file paths for Signstar configuration files.
println!("{:?}", get_etc_override_config_file_path());
println!("{:?}", get_run_override_config_file_path());
println!("{:?}", get_usr_local_override_config_file_path());
println!("{:?}", get_default_config_file_path());
// Get the first config file found, according to directory precedence.
println!("{:?}", get_config_file());
// Get the first config file found, according to directory precedence, or the default if none are found.
println!("{:?}", get_config_file_or_default());
// Get all configuration file paths, sorted by directory precedence.
println!("{:?}", get_config_file_paths());
Enumsยง
- Error
- An error that may occur when handling configuration directories or files.
Constantsยง
- CONFIG_
FILE ๐ - The filename of a Signstar configuration file.
- DEFAULT_
CONFIG_ ๐DIR - The default config directory below โ/usrโ for Signstar hosts.
- ETC_
OVERRIDE_ ๐CONFIG_ DIR - The override config directory below โ/etcโ for Signstar hosts.
- RUN_
OVERRIDE_ ๐CONFIG_ DIR - The override config directory below โ/runโ for Signstar hosts.
- USR_
LOCAL_ ๐OVERRIDE_ CONFIG_ DIR - The override config directory below โ/usr/localโ for Signstar hosts.
Functionsยง
- create_
default_ config_ dir - Creates the default configuration directory below /usr.
- create_
etc_ override_ config_ dir - Creates the configuration override dir below /etc.
- create_
run_ override_ config_ dir - Creates the configuration override dir below /run.
- create_
usr_ local_ override_ config_ dir - Creates the configuration override dir below /usr/local.
- get_
config_ file - Returns the first Signstar configuration file available, or
None
if none found. - get_
config_ file_ or_ default - Returns the first Signstar configuration file available, or the default if none found.
- get_
config_ file_ paths - Returns a list of all configuration file locations, sorted by precedence.
- get_
default_ config_ dir_ path - Returns the directory path of the default configuration directory below /usr.
- get_
default_ config_ file_ path - Returns the file path of the default configuration file /usr.
- get_
etc_ override_ config_ file_ path - Returns the file path of the configuration file override below /etc.
- get_
etc_ override_ dir_ path - Returns the directory path of the configuration override directory below /etc.
- get_
run_ override_ config_ file_ path - Returns the file path of the configuration file override below /run.
- get_
run_ override_ dir_ path - Returns the directory path of the configuration override directory below /run.
- get_
usr_ local_ override_ config_ file_ path - Returns the file path of the configuration file override below /usr/local.
- get_
usr_ local_ override_ dir_ path - Returns the directory path of the configuration override directory below /usr/local.