Copyright | (c) 2019-2021 Vaclav Svejcar |
---|---|
License | BSD-3-Clause |
Maintainer | vaclav.svejcar@gmail.com |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
This module provides logic for working with the cofiguration data types. Headroom uses the partial options monoid pattern for the configuration.
Synopsis
- loadConfiguration :: (MonadIO m, MonadThrow m) => FilePath -> m PtConfiguration
- parseConfiguration :: MonadThrow m => ByteString -> m PtConfiguration
- makeConfiguration :: MonadThrow m => PtConfiguration -> m CtConfiguration
- makeHeadersConfig :: MonadThrow m => PtHeadersConfig -> m CtHeadersConfig
- makeHeaderConfig :: MonadThrow m => FileType -> PtHeaderConfig -> m CtHeaderConfig
Loading & Parsing Configuration
loadConfiguration :: (MonadIO m, MonadThrow m) => FilePath -> m PtConfiguration Source #
Loads and parses application configuration from given YAML file.
:: MonadThrow m | |
=> ByteString | raw input to parse |
-> m PtConfiguration | parsed application configuration |
Parses application configuration from given raw input in YAML format.
Processing Partial Configuration
:: MonadThrow m | |
=> PtConfiguration | source |
-> m CtConfiguration | full |
Makes full CtConfiguration
from provided PtConfiguration
(if valid).
:: MonadThrow m | |
=> PtHeadersConfig | source |
-> m CtHeadersConfig | full |
Makes full CtHeadersConfig
from provided PtHeadersConfig
(if valid).
:: MonadThrow m | |
=> FileType | determines for which file type this configuration is |
-> PtHeaderConfig | source |
-> m CtHeaderConfig | full |
Makes full CtHeaderConfig
from provided PtHeaderConfig
(if valid).