yesod-1.4.2: Creation of type-safe, RESTful web applications.

Safe Haskell | None
Language | Haskell98

Yesod.Default.Config2

Description

Some next-gen helper functions for the scaffolding's configuration system.

Synopsis

- 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

newtype MergedValue Source

Constructors

MergedValue |

Fields

getMergedValue :: Value

Instances

Semigroup MergedValue Source |

applyCurrentEnv Source

Arguments

:: Bool | require an environment variable to be present?
-> Value |
-> IO Value |

getCurrentEnv :: IO (HashMap Text Text) Source

applyEnvValue Source

Arguments

:: Bool | require an environment variable to be present?
-> HashMap Text Text |
-> Value |
-> Value |

loadAppSettings 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

loadAppSettingsArgs Source

Arguments

:: 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

data EnvUsage Source

ignoreEnv :: EnvUsage Source

useEnv :: EnvUsage Source

requireEnv :: EnvUsage Source

useCustomEnv :: HashMap Text Text -> EnvUsage Source

requireCustomEnv :: HashMap Text Text -> EnvUsage Source