Liking cljdoc? Tell your friends :D
Clojure only.

utility-belt.config

Config reading/loading helpers. Adds extensions to aero and default config reader.

Config reading/loading helpers.
Adds extensions to aero and default config reader.
raw docstring

read-configclj

(read-config config-path)
(read-config config-path
             {:keys [profile resolver validate]
              :or {resolver aero/resource-resolver}})

Reads config from resources. Allowed options:

  • resolver: The resolver to use in aero (default: aero/resource-resolver)
  • profile: The profile to use is #profile is used
  • validate: A map of keys in the config to be validated. Keys can be vectors with the path to the config to be validated. Values can be a map with {<expected key value> <validation fn>} or simply <validation fn> All validators must return 'truthy' or a validation exception will be raised Example: for the config {:env 'prod' :host 'localhost'} Validation that host can't be localhost in prod can be added with: (read-config '<the conf file>' {:validate {:env {'prod' #(not (= 'localhost' (:host %2)))}}})
Reads config from resources.
Allowed options:
- resolver: The resolver to use in aero (default: aero/resource-resolver)
- profile: The profile to use is #profile is used
- validate: A map of keys in the config to be validated.
            Keys can be vectors with the path to the config to be validated.
            Values can be a map with {<expected key value> <validation fn>} or simply <validation fn>
            All validators must return 'truthy' or a validation exception will be raised
Example: for the config
{:env 'prod' :host 'localhost'}
Validation that host can't be localhost in prod can be added with:
(read-config '<the conf file>' {:validate {:env {'prod' #(not (= 'localhost' (:host %2)))}}})
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close