-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Loads environment variables from dotenv files
--
-- In most applications, configuration should be separated from
-- code. While it usually works well to keep configuration in the
-- environment, there are cases where you may want to store configuration
-- in a file outside of version control.
--
-- Dotenv files have become popular for storing configuration,
-- especially in development and test environments. In Ruby,
-- Python and Javascript there are libraries to facilitate
-- loading of configuration options from configuration files. This
-- library loads configuration to environment variables for programs
-- written in Haskell.
--
-- To use, call loadFile from your application:
--
--
-- import Configuration.Dotenv
-- loadFile False "/my/dotenvfile"
--
--
-- This package also includes an executable that can be used to inspect
-- the results of applying one or more Dotenv files to the environment,
-- or for invoking your executables with an environment after one or more
-- Dotenv files is applied.
--
-- See the Github page for more information on this package.
@package dotenv
@version 0.5.0.0
-- |
-- - - Module : Configuration.Dotenv.Types
-- - - Copyright : © 2015–2017 Stack Builders Inc.
-- - - License : MIT
-- - -
-- - - Maintainer : Stack Builders
-- hackage@stackbuilders.com
-- - - Stability : experimental
-- - - Portability : portable
-- - -
-- - - Provides the types with extra options for loading a dotenv
-- file.
--
module Configuration.Dotenv.Types
-- | Configuration Data Types with extra options for executing dotenv.
data Config
Config :: [FilePath] -> [FilePath] -> Bool -> Config
-- | The paths for the .env files
[configPath] :: Config -> [FilePath]
-- | The paths for the .env.example files
[configExamplePath] :: Config -> [FilePath]
-- | Flag to allow override env variables
[configOverride] :: Config -> Bool
-- | Default configuration. Use .env file without .env.example strict envs
-- and without overriding.
defaultConfig :: Config
instance GHC.Show.Show Configuration.Dotenv.Types.Config
instance GHC.Classes.Eq Configuration.Dotenv.Types.Config
module Configuration.Dotenv.ParsedVariable
data ParsedVariable
ParsedVariable :: VarName -> VarValue -> ParsedVariable
type VarName = String
data VarValue
Unquoted :: VarContents -> VarValue
SingleQuoted :: VarContents -> VarValue
DoubleQuoted :: VarContents -> VarValue
type VarContents = [VarFragment]
data VarFragment
VarInterpolation :: String -> VarFragment
VarLiteral :: String -> VarFragment
interpolateParsedVariables :: [ParsedVariable] -> IO [(String, String)]
instance GHC.Classes.Eq Configuration.Dotenv.ParsedVariable.ParsedVariable
instance GHC.Show.Show Configuration.Dotenv.ParsedVariable.ParsedVariable
instance GHC.Classes.Eq Configuration.Dotenv.ParsedVariable.VarValue
instance GHC.Show.Show Configuration.Dotenv.ParsedVariable.VarValue
instance GHC.Classes.Eq Configuration.Dotenv.ParsedVariable.VarFragment
instance GHC.Show.Show Configuration.Dotenv.ParsedVariable.VarFragment
-- | Parser for files in dotenv format. These files generally consist of
-- lines with the form key=value. Comments and blank lines are also
-- supported. More information on the dotenv format can be found in the
-- project README and the test suite.
module Configuration.Dotenv.Parse
-- | Returns a parser for a Dotenv configuration file. Accepts key and
-- value arguments separated by =. Comments in all positions are
-- handled appropriately.
configParser :: Parser [ParsedVariable]
-- | This module contains common functions to load and read dotenv files.
module Configuration.Dotenv
-- | Loads the given list of options into the environment. Optionally
-- override existing variables with values from Dotenv files.
load :: MonadIO m => Bool -> [(String, String)] -> m ()
-- | loadFile parses the environment variables defined in the
-- dotenv example file and checks if they are defined in the dotenv file
-- or in the environment. It also allows to override the environment
-- variables defined in the environment with the values defined in the
-- dotenv file.
loadFile :: MonadIO m => Config -> m ()
-- | Parses the given dotenv file and returns values without adding
-- them to the environment.
parseFile :: MonadIO m => FilePath -> m [(String, String)]
-- | The helper allows to avoid exceptions in the case of missing files and
-- perform some action instead.
onMissingFile :: MonadCatch m => m a -> m a -> m a
-- | Provides a Data.Text interface for retrieving variables in a dotenv
-- file.
module Configuration.Dotenv.Text
-- | Parses the given dotenv file and returns values without adding
-- them to the environment.
parseFile :: MonadIO m => FilePath -> m [(Text, Text)]