configuration-tools-0.3.0: Tools for specifying and parsing configurations

CopyrightCopyright © 2015 PivotCloud Inc.
LicenseMIT
MaintainerLars Kuhtz <lkuhtz@pivotmail.com>
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Configuration.Utils.Internal.ConfigFileReader

Contents

Description

 

Synopsis

Documentation

parseConfigFiles Source #

Arguments

:: (ConfigFileParser μ, FromJSON (α -> α)) 
=> ConfigFilesConfig 
-> α

default configuration value

-> [ConfigFile]

list of configuration file paths

-> μ α 

readConfigFile Source #

Arguments

:: (ConfigFileParser μ, FromJSON (α -> α)) 
=> ConfigFilesConfig 
-> ConfigFile

file path

-> μ (α -> α) 

data ConfigFileFormat Source #

Constructors

Yaml 
Json 
Other 

Instances

Bounded ConfigFileFormat Source # 
Enum ConfigFileFormat Source # 
Eq ConfigFileFormat Source # 
Ord ConfigFileFormat Source # 
Read ConfigFileFormat Source # 
Show ConfigFileFormat Source # 
Generic ConfigFileFormat Source # 
NFData ConfigFileFormat Source # 

Methods

rnf :: ConfigFileFormat -> () #

type Rep ConfigFileFormat Source # 
type Rep ConfigFileFormat = D1 (MetaData "ConfigFileFormat" "Configuration.Utils.Internal.ConfigFileReader" "configuration-tools-0.3.0-ImqUTwebcDg3IrJuLq9v1C" False) ((:+:) (C1 (MetaCons "Yaml" PrefixI False) U1) ((:+:) (C1 (MetaCons "Json" PrefixI False) U1) (C1 (MetaCons "Other" PrefixI False) U1)))

Local Config Files

loadLocal Source #

Arguments

:: (Functor μ, MonadIO μ, MonadError Text μ, FromJSON (α -> α)) 
=> ConfigFile

file path

-> μ (α -> α) 

Remote Config Files

loadRemote Source #

Arguments

:: (ConfigFileParser μ, FromJSON (α -> α)) 
=> ConfigFilesConfig 
-> ConfigFile

URL

-> μ (α -> α) 

jsonMimeType :: IsString s => [s] Source #

Defined in RFC 4627

contentType Source #

Arguments

:: ByteString

value of an HTTP Content-Type header

-> ConfigFileFormat