Copyright | (c) 2019 Lucas David Traverso |
---|---|
License | MPL-2.0 |
Maintainer | Lucas David Traverso <lucas6246@gmail.com> |
Stability | stable |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Public API module for Source related features
Synopsis
- data Source = forall s.(IsSource s, Show s) => Source s
- class IsSource s where
- getKeyInSource :: s -> Key -> IO (Maybe Text)
- getSubkeysInSource :: s -> Key -> IO [Key]
- type SourceCreator = Config -> IO Source
- module Conferer.Key
Documentation
class IsSource s where Source #
Main interface for interacting with external systems that provide configuration
which will be used by FromConfig
to fetch values.
getKeyInSource :: s -> Key -> IO (Maybe Text) Source #
getSubkeysInSource :: s -> Key -> IO [Key] Source #
This function is used by the Config
to list possible values
from the Source
that if the user getKeyInSource
, it will be found.
Instances
type SourceCreator = Config -> IO Source Source #
The type for creating a source given a Config
, some sources require a
certain configuration to be initialized (for example: the redis source
needs connection info to connect to the server)
module Conferer.Key