Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- module MiniLight.Component.Internal.Types
- data LoaderEnv = LoaderEnv {}
- class HasLoaderEnv c where
- resolveConfig :: MonadIO m => FilePath -> m (Either String AppConfig)
- loadAppConfig :: (HasLightEnv env, HasLoaderEnv env, MonadIO m, MonadCatch m) => FilePath -> Resolver -> LightT env m ()
- patchAppConfig :: (HasLightEnv env, HasLoaderEnv env, MonadIO m, MonadCatch m) => FilePath -> Resolver -> LightT env m ()
Documentation
The environment for config loader
class HasLoaderEnv c where Source #
Instances
HasLoaderEnv LoaderEnv Source # | |
HasLoaderEnv LoopState Source # | |
HasLoaderEnv env' => HasLoaderEnv (env, env') Source # | |
resolveConfig :: MonadIO m => FilePath -> m (Either String AppConfig) Source #
Load an config file and return the resolved AppConfig
.
:: (HasLightEnv env, HasLoaderEnv env, MonadIO m, MonadCatch m) | |
=> FilePath | Filepath to the yaml file. |
-> Resolver | Specify any resolver. |
-> LightT env m () |
Load an config file and set in the environment. Calling this function at once, this overrides all values in the environment.
This will generate an error log and skip the component if the configuration is invalid.
This function also assign unique IDs for each component, using assignUID
.
:: (HasLightEnv env, HasLoaderEnv env, MonadIO m, MonadCatch m) | |
=> FilePath | Filepath to the yaml file. |
-> Resolver | Specify any resolver. |
-> LightT env m () |
Load the config file again and place the newly loaded components. This is used for HCR (hot component replacement).
Call loadAppConfig
first.