Locating Configuration Files
In this lesson, we'll take an in deep look at Viper's support for configuration files.
We'll cover the following...
Configuration files are a staple of program configuration, especially when the configuration data is complicated and hierarchical in nature. Viper supports a large number of configuration files, including JSON, TOML, YAML, HCL, INI, envfile and Java Properties files. In this lesson, you will see how to locate the configuration file. Later, we will see how to write configuration files, how to read them and even how to watch them for changes.
Overview
When working with configuration files there are several tasks. First, you need to locate where the configuration file is, and then you need to read and parse its contents. Under some circumstances, you may also want to write or update a configuration file from your program. For more dynamic situations, it’s important to be able to watch a configuration file for changes and re-read it to reflect the configuration changes. Let’s see how Viper allows you to perform all these tasks.
Locating configuration files
Viper doesn’t make any assumptions about your configuration ...