headroom-0.2.0.0: License Header Manager
Copyright(c) 2019-2020 Vaclav Svejcar
LicenseBSD-3
Maintainervaclav.svejcar@gmail.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Headroom.Configuration

Description

This module provides logic for working with the cofiguration data types. Headroom uses the partial options monoid pattern for the configuration, where the Configuration is the data type for total configuration and PartialConfiguration for the partial one.

Synopsis

Loading & Parsing Configuration

loadConfiguration Source #

Arguments

:: MonadIO m 
=> FilePath

path to YAML configuration file

-> m PartialConfiguration

parsed configuration

Loads and parses application configuration from given YAML file.

parseConfiguration Source #

Arguments

:: MonadThrow m 
=> ByteString

raw input to parse

-> m PartialConfiguration

parsed application configuration

Parses application configuration from given raw input in YAML format.

parseVariables Source #

Arguments

:: MonadThrow m 
=> [Text]

list of raw variables

-> m (HashMap Text Text)

parsed variables

Parses variables from raw input in key=value format.

>>> parseVariables ["key1=value1"]
fromList [("key1","value1")]

Processing Partial Configuration

makeConfiguration Source #

Arguments

:: MonadThrow m 
=> PartialConfiguration

source PartialConfiguration

-> m Configuration

full Configuration

Makes full Configuration from provided PartialConfiguration (if valid).

makeHeadersConfig Source #

Arguments

:: MonadThrow m 
=> PartialHeadersConfig

source PartialHeadersConfig

-> m HeadersConfig

full HeadersConfig

Makes full HeadersConfig from provided PartialHeadersConfig (if valid).

makeHeaderConfig Source #

Arguments

:: MonadThrow m 
=> FileType

determines for which file type this configuration is

-> PartialHeaderConfig

source PartialHeaderConfig

-> m HeaderConfig

full HeaderConfig

Makes full HeaderConfig from provided PartialHeaderConfig (if valid).