-- 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 Control.Monad (void)
--   import Configuration.Dotenv
--   void $ loadFile defaultConfig
--   
-- -- 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.8.0.2 module Configuration.Dotenv.Environment -- | getEnvironment retrieves the entire environment as a list of -- (key,value) pairs. -- -- If an environment entry does not contain an '=' character, -- the key is the whole entry and the value is the -- empty string. getEnvironment :: IO [(String, String)] lookupEnv :: String -> IO (Maybe String) setEnv :: String -> String -> IO () -- | Like unsetEnv, but allows for the removal of blank environment -- variables. May throw an exception if the underlying platform doesn't -- support unsetting of environment variables. unsetEnv :: String -> IO () -- | 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 [(String, String)] -- | loadSafeFile parses the .scheme.yml file and will -- perform the type checking of the environment variables in the -- .env file. loadSafeFile :: MonadIO m => ValidatorMap -> FilePath -> Config -> m [(String, String)] -- | 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 -- | 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 -- | Parameters: -- -- type ValidatorMap = Map Text (Text -> Bool) -- | Default configuration for loadSafeFile. It currently checks: -- bool, integer, and text. defaultValidatorMap :: ValidatorMap