Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetConfigFile ¶ added in v0.2.0
GetConfigFile returns the path to a config file if one is specified
This function will automatically add the `-config` flag to the calling program and parse the cmdline to determine if it has been specified. If the `-config` flag is not specified, this will fall back to trying to get a path to a config file from the specified environment variable
func RegisterValidator ¶
RegisterValidator registers a custom validator to be used for validating a value
Note:
Once a validator is registered, its name can be used in the validators struct field tag
func Run ¶
Run reads all configuration into the configuration structs and then validates the stored data
Notes:
`target` must be a pointer to a struct `filename` is optional This is the full path to a configuration file supported: json, toml, or yaml If not provided, reading from a configuration file will not be done. `hint` is optional Must be one of: json, toml, or yaml Only needed if a configuration file does not follow standard extensions. json = *.json toml = *.toml yaml = *.yml or *.yaml Only needed if `filename` is provided
Types ¶
Click to show internal directories.
Click to hide internal directories.