funflow-2.0.0: Make composable workflows
Safe HaskellNone
LanguageHaskell2010

Funflow.Config

Synopsis

Documentation

data ExternalConfig Source #

Instances

Instances details
Show ExternalConfig Source # 
Instance details

Defined in Funflow.Config

data Configurable a where Source #

A value which is intended to be populated using an external source (e.g. a config file)

Constructors

ConfigFromFile :: FromJSON a => ConfigKey -> Configurable a

Define a configurable which will be loaded from a config file using the given key

ConfigFromEnv :: FromJSON a => ConfigKey -> Configurable a

Define a configurable which will be loaded from the specified environment variable

Literal :: a -> Configurable a

A literal value which does not need to be loaded from an external config source

render :: forall a. Configurable a -> ExternalConfig -> Either String (Configurable a) Source #

Render a Configurable into a Literal value using a set of external configurations, returning an error message if rendering failed.

getConfigKey :: Configurable a -> Maybe ConfigKey Source #

Gets the config key for a configurable value, if it exists.

missing :: ExternalConfig -> ConfigKeysBySource -> [ConfigKey] Source #

Get a list of any ConfigKeys which don't exist in their corresponding field in the providedExternalConfig

readEnv :: MonadIO m => ConfigKey -> m (KeyMap String) Source #

Construct an HashMap containing specified environment variable values.

readEnvs :: MonadIO m => [ConfigKey] -> m (KeyMap String) Source #

Convenience function for calling readEnv on a list of ConfigKeys

readYamlFileConfig :: (MonadIO m, FromJSON a) => FilePath -> m a Source #

Construct a HashMap containing the content of a yaml file. Is just an Alias for decodeFileThrow.