Safe Haskell | None |
---|---|
Language | Haskell98 |
Some next-gen helper functions for the scaffolding's configuration system.
- newtype MergedValue = MergedValue {
- getMergedValue :: Value
- applyCurrentEnv :: Bool -> Value -> IO Value
- getCurrentEnv :: IO (HashMap Text Text)
- applyEnvValue :: Bool -> HashMap Text Text -> Value -> Value
- loadAppSettings :: FromJSON settings => [FilePath] -> [Value] -> EnvUsage -> IO settings
- loadAppSettingsArgs :: FromJSON settings => [Value] -> EnvUsage -> IO settings
- configSettingsYml :: FilePath
- getDevSettings :: Settings -> IO Settings
- develMainHelper :: IO (Settings, Application) -> IO ()
- makeYesodLogger :: LoggerSet -> IO Logger
- data EnvUsage
- ignoreEnv :: EnvUsage
- useEnv :: EnvUsage
- requireEnv :: EnvUsage
- useCustomEnv :: HashMap Text Text -> EnvUsage
- requireCustomEnv :: HashMap Text Text -> EnvUsage
Documentation
getCurrentEnv :: IO (HashMap Text Text) Source
:: Bool | require an environment variable to be present? |
-> HashMap Text Text | |
-> Value | |
-> Value |
:: 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
:: FromJSON settings | |
=> [Value] | any other values to use, usually from compile time config. overridden by files |
-> EnvUsage | use environment variables |
-> IO settings |
Same as loadAppSettings
, but get the list of runtime config files from
the command line arguments.
configSettingsYml :: FilePath Source
Location of the default config file.
getDevSettings :: Settings -> IO Settings Source
Helper for getApplicationDev in the scaffolding. Looks up PORT and DISPLAY_PORT and prints appropriate messages.
develMainHelper :: IO (Settings, Application) -> IO () Source
Helper for develMain in the scaffolding.
makeYesodLogger :: LoggerSet -> IO Logger Source
useCustomEnv :: HashMap Text Text -> EnvUsage Source
requireCustomEnv :: HashMap Text Text -> EnvUsage Source