CrossClj

0.2.0 docs

SourceDocs


project

docs index

NAMESPACES
clonfig

RECENT
    VARS
    compose-ev-prefix
    config-ev
    config-ev-name
    delayed-config
    deref-delayed-config
    destructure-attr-defaults
    post-processor-fn
    read-ev
    value-delay

    « Index of all namespaces of this project

    clonfig implementation
    
    (compose-ev-prefix & args)
    compose an environment variable prefix consisting of one or more strings or keywords
    or sequences thereof
    (config-ev attr-name & {:keys [ev-prefix]})
    given a keyword name for a config attribute, lookup the associated environment variable
    
    (config-ev-name attr-name & {:keys [ev-prefix]})
    given a keyword name for a config attribute,
    convert it to the corresponding environment variable name.
    :foo => "FOO"
    :foo-bar => "FOO_BAR"
    if ev-prefix is given it will be converted similarly, and prefixed
    to the converte attr_name, joined with _
    (delayed-config config-defaults & {:keys [value-processors ev-prefix]})
    given a map of keyword named config attributes and their defaults, return
    a map of delays to the attribute values
    (deref-delayed-config dc)
    given a map of delays to config values, deref all the delays to return a map of config values
    
    (destructure-attr-defaults attr-defaults)
    destructures an attribute default to a [def-val post-processor] pair, or a map of nested config-defaults.
    the attribute defaults
    may already be a pair, or it may be a lone default-value or a lone post-processor function
    or a nested config-defaults map
    (post-processor-fn value-processors post-processor)
    given a map of keyword keyed value-processors and a post-processor which is either a keyword
    to look up a value-processor function or a post-processor function,
    returns a post-processor function.
    value-processor functions take a single argument: [value].
    post-processor functions take two arguments: [config value] and can therefore look up
    other config values from the config map
    (read-ev name)
    read an environment variable
    
    (value-delay config-promise attr-name attr-defaults & {:keys [value-processors ev-prefix]})
    given a promise of config, and attr-name and defaults,
    returns a delay containing a function returning the value. if there is no
    post-processor then the delay returns the value directly, gotten from
    environment-variable or default-value.
    if there is a post-processor then it is called with [config value] parameters to
    give the value returned by the delay