yaml-0.8.16: Support for parsing and rendering YAML documents.

Safe HaskellNone
LanguageHaskell98

Data.Yaml.Config

Description

Functionality for using YAML as configuration files

In particular, merging environment variables with yaml values

loadYamlSettings is a high-level API for loading YAML and merging environment variables. A yaml value of _env:ENV_VAR:default will lookup the environment variable ENV_VAR.

On a historical note, this code was taken directly from the yesod web framework's configuration module.

Synopsis

Documentation

applyCurrentEnv Source

Arguments

:: Bool

require an environment variable to be present?

-> Value 
-> IO Value 

applyEnvValue Source

Arguments

:: Bool

require an environment variable to be present?

-> HashMap Text Text 
-> Value 
-> Value 

loadYamlSettings Source

Arguments

:: FromJSON settings 
=> [FilePath]

run time config files to use, earlier files have precedence

-> [Value]

any other values to use, usually from compile time config. overridden by files

-> EnvUsage 
-> IO settings 

Load the settings from the following three sources:

  • Run time config files
  • Run time environment variables
  • The default compile time config file