etc-0.4.0.3: Declarative configuration spec for Haskell projects

Safe HaskellNone
LanguageHaskell2010

System.Etc.Spec

Synopsis

Documentation

data ConfigSpec cmd #

Instances
Eq cmd => Eq (ConfigSpec cmd) # 
Instance details

Defined in System.Etc.Internal.Spec.Types

Methods

(==) :: ConfigSpec cmd -> ConfigSpec cmd -> Bool #

(/=) :: ConfigSpec cmd -> ConfigSpec cmd -> Bool #

Show cmd => Show (ConfigSpec cmd) # 
Instance details

Defined in System.Etc.Internal.Spec.Types

Methods

showsPrec :: Int -> ConfigSpec cmd -> ShowS #

show :: ConfigSpec cmd -> String #

showList :: [ConfigSpec cmd] -> ShowS #

FromJSON cmd => FromJSON (ConfigSpec cmd) # 
Instance details

Defined in System.Etc.Internal.Spec.Types

data ConfigValue cmd #

Instances
Eq cmd => Eq (ConfigValue cmd) # 
Instance details

Defined in System.Etc.Internal.Spec.Types

Methods

(==) :: ConfigValue cmd -> ConfigValue cmd -> Bool #

(/=) :: ConfigValue cmd -> ConfigValue cmd -> Bool #

Show cmd => Show (ConfigValue cmd) # 
Instance details

Defined in System.Etc.Internal.Spec.Types

Methods

showsPrec :: Int -> ConfigValue cmd -> ShowS #

show :: ConfigValue cmd -> String #

showList :: [ConfigValue cmd] -> ShowS #

Generic (ConfigValue cmd) # 
Instance details

Defined in System.Etc.Internal.Spec.Types

Associated Types

type Rep (ConfigValue cmd) :: * -> * #

Methods

from :: ConfigValue cmd -> Rep (ConfigValue cmd) x #

to :: Rep (ConfigValue cmd) x -> ConfigValue cmd #

FromJSON cmd => FromJSON (ConfigValue cmd) # 
Instance details

Defined in System.Etc.Internal.Spec.Types

type Rep (ConfigValue cmd) # 
Instance details

Defined in System.Etc.Internal.Spec.Types

type Rep (ConfigValue cmd) = D1 (MetaData "ConfigValue" "System.Etc.Internal.Spec.Types" "etc-0.4.0.3-1VdOfTC1BjK5K2oA1bREav" False) (C1 (MetaCons "ConfigValue" PrefixI True) ((S1 (MetaSel (Just "defaultValue") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Value)) :*: S1 (MetaSel (Just "configValueType") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 ConfigValueType)) :*: (S1 (MetaSel (Just "isSensitive") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Bool) :*: S1 (MetaSel (Just "configSources") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (ConfigSources cmd)))) :+: C1 (MetaCons "SubConfig" PrefixI True) (S1 (MetaSel (Just "subConfig") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (HashMap Text (ConfigValue cmd)))))

data ConfigurationError #

Instances
Show ConfigurationError # 
Instance details

Defined in System.Etc.Internal.Spec.Types

Generic ConfigurationError # 
Instance details

Defined in System.Etc.Internal.Spec.Types

Associated Types

type Rep ConfigurationError :: * -> * #

Exception ConfigurationError # 
Instance details

Defined in System.Etc.Internal.Spec.Types

type Rep ConfigurationError # 
Instance details

Defined in System.Etc.Internal.Spec.Types

parseConfigSpec #

Arguments

:: MonadThrow m 
=> Text

Text to be parsed

-> m (ConfigSpec ())

returns ConfigSpec

Parses a text input into a ConfigSpec, input can be JSON or YAML (if cabal flag is set).

readConfigSpec #

Arguments

:: Text

Filepath where contents are going to be read from and parsed

-> IO (ConfigSpec ())

returns ConfigSpec

Reads contents of a file and parses into a ConfigSpec, file contents can be either JSON or YAML (if cabal flag is set).