conferer-1.0.0.1: Configuration management library
Copyright(c) 2019 Lucas David Traverso
LicenseMPL-2.0
MaintainerLucas David Traverso <lucas6246@gmail.com>
Stabilitystable
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Conferer.Source.Env

Description

Environment based source

Synopsis

Documentation

data EnvSource Source #

Source that interfaces with the environment transforming keys by uppercasing and interspersing underscores, and using a prefix to avoid clashing with system env vars

so with "app" prefix, "some.key" turns into APP_SOME_KEY

Instances

Instances details
Show EnvSource Source # 
Instance details

Defined in Conferer.Source.Env

IsSource EnvSource Source # 
Instance details

Defined in Conferer.Source.Env

type RawEnvironment = [(String, String)] Source #

Type alias for the environment

type Prefix = Text Source #

Type alias for the env vars prefix

fromEnv :: Prefix -> IO Source Source #

Create a Source using the real environment

fromEnvList :: RawEnvironment -> Prefix -> Source Source #

Create a Source using a hardcoded list of env vars

keyToEnvVar :: Prefix -> Key -> Text Source #

Get the env name from a prefix and a key by uppercasing and intercalating underscores