yesod-1.6.2.1: Creation of type-safe, RESTful web applications.
Safe HaskellNone
LanguageHaskell2010

Yesod.Default.Config2

Description

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

Synopsis

Locally defined

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 #

Create a Logger value (from yesod-core) out of a LoggerSet (from fast-logger).

Re-exports from Data.Yaml.Config

applyCurrentEnv :: Bool -> Value -> IO Value #

getCurrentEnv :: IO (KeyMap Text) #

applyEnvValue :: Bool -> KeyMap Text -> Value -> Value #

loadYamlSettings :: FromJSON settings => [FilePath] -> [Value] -> EnvUsage -> IO settings #

loadYamlSettingsArgs :: FromJSON settings => [Value] -> EnvUsage -> IO settings #

data EnvUsage #

useCustomEnv :: KeyMap Text -> EnvUsage #

requireCustomEnv :: KeyMap Text -> EnvUsage #

For backwards compatibility

newtype MergedValue Source #

Constructors

MergedValue 

Instances

Instances details
Semigroup MergedValue Source # 
Instance details

Defined in Yesod.Default.Config2

Methods

(<>) :: MergedValue -> MergedValue -> MergedValue

sconcat :: NonEmpty MergedValue -> MergedValue

stimes :: Integral b => b -> MergedValue -> MergedValue

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 

Deprecated: Use loadYamlSettings

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 

Deprecated: Use loadYamlSettingsArgs

Same as loadAppSettings, but get the list of runtime config files from the command line arguments.