conferer-0.1.0.1: Configuration management library

Safe HaskellSafe
LanguageHaskell2010

Conferer.Types

Synopsis

Documentation

data Provider Source #

Core interface for library provided configuration, basically consists of getting a Key and informing returning a maybe signaling the value and if it's present in that specific provider

Constructors

Provider 

Fields

newtype Key Source #

The way to index Providers, basically list of names that will be adapted to whatever the provider needs

Constructors

Path 

Fields

Instances
Eq Key Source # 
Instance details

Defined in Conferer.Types

Methods

(==) :: Key -> Key -> Bool #

(/=) :: Key -> Key -> Bool #

Ord Key Source # 
Instance details

Defined in Conferer.Types

Methods

compare :: Key -> Key -> Ordering #

(<) :: Key -> Key -> Bool #

(<=) :: Key -> Key -> Bool #

(>) :: Key -> Key -> Bool #

(>=) :: Key -> Key -> Bool #

max :: Key -> Key -> Key #

min :: Key -> Key -> Key #

Show Key Source # 
Instance details

Defined in Conferer.Types

Methods

showsPrec :: Int -> Key -> ShowS #

show :: Key -> String #

showList :: [Key] -> ShowS #

IsString Key Source # 
Instance details

Defined in Conferer.Types

Methods

fromString :: String -> Key #

keyName :: Key -> Text Source #

Collapse a key into a textual representation

data Config Source #

Core type that the user of this library interact with, in the future it may contain more this besides a list of providers

Constructors

Config 

Fields

type ProviderCreator = Config -> IO Provider Source #

The type for creating a provider given a Config, some providers require a certain configuration to be initialized (for example: the redis provider needs connection info to connect to the server)

class FetchFromConfig a where Source #

Main typeclass for defining the way to get values from config, hiding the Text based nature of the Providers

Here an error means that the value couldn't be parsed and that a reasonable default was not possible.

Methods

fetch :: Key -> Config -> IO (Either Text a) Source #