The delayed map of explicit configuration values.
The delayed map of explicit configuration values.
A ref containing the map of symbols for the loaded defconfig vars to their default values.
A ref containing the map of symbols for the loaded defconfig vars to their default values.
(defconfig name)
(defconfig name default-val)
(defconfig name doc default-val)
Same as (def name doc-string? init?) except the var's value may be configured at load-time by this library.
The following additional metadata is supported: :required - When true, an exception will be thrown if no default nor configured value is provided. :validate - A vector of alternating single-arity predicates and error messages. After a value is set on the var, an exception will be thrown when a predicate, passed the set value, yields false.
Note: default-val will be evaluated, even if a configured value is provided.
Same as (def name doc-string? init?) except the var's value may be configured at load-time by this library. The following additional metadata is supported: :required - When true, an exception will be thrown if no default nor configured value is provided. :validate - A vector of alternating single-arity predicates and error messages. After a value is set on the var, an exception will be thrown when a predicate, passed the set value, yields false. Note: default-val will be evaluated, even if a configured value is provided.
(defconfig! name)
Equivalent to (defconfig ^:required ...).
Equivalent to (defconfig ^:required ...).
(extract this)
Extracts the value to be bound to a config var
Extracts the value to be bound to a config var
(load-data-readers)
Loads the namespaces of data reader Vars whose reader tag symbol has the 'config' namespace.
Loads the namespaces of data reader Vars whose reader tag symbol has the 'config' namespace.
(lookup qname)
(lookup qname default-val)
Returns the extracted value if the qname is present, otherwise default-val or nil.
Returns the extracted value if the qname is present, otherwise default-val or nil.
A ref containing the set of symbols for the loaded defconfig vars that do not have a default value.
A ref containing the set of symbols for the loaded defconfig vars that do not have a default value.
(provided? this)
Returns true if the item should be bound to a config var.
Returns true if the item should be bound to a config var.
(present? qname)
Returns true if a configuration entry exists for the qname and, if an Optional value, the value is provided.
Returns true if a configuration entry exists for the qname and, if an Optional value, the value is provided.
(read-config source)
Reads the config EDN map from a source acceptable to clojure.java.io/reader.
Reads the config EDN map from a source acceptable to clojure.java.io/reader.
(read-edn source)
Returns an EdnVal from a string value. Can be composed with other readers.
Returns an EdnVal from a string value. Can be composed with other readers.
(read-env name)
Returns an EnvVal identified by the specified string name.
Returns an EnvVal identified by the specified string name.
(read-file path)
Returns a FileVal identified by the specified string path.
Returns a FileVal identified by the specified string path.
(read-or source)
Returns an OrVal from a vector.
Returns an OrVal from a vector.
(read-property name)
Returns a PropVal identified by the specified string name.
Returns a PropVal identified by the specified string name.
(unbound)
Returns the set of symbols for the defconfig vars with neither a default nor configured value.
Returns the set of symbols for the defconfig vars with neither a default nor configured value.
(valid-key? k)
Returns true IFF k is acceptable as a key in a configuration map, i.e., a namespaced symbol.
Returns true IFF k is acceptable as a key in a configuration map, i.e., a namespaced symbol.
(validate val var-sym validate-vec)
Throws an ex-info if, for any predicate in validate-vec, (pred val) is false.
The validate-vec must be a vector of alternating single-arity predicate fns and associated error messages. Example: [number? "must be a number" even? "must be even"]
The ex-info's ex-data map will contain the following entries: :pred - the predicate fn that failed :msg - the associated error message :sym - the fully-qualified symbol of the config var :val - the value set on the config var
Throws an ex-info if, for any predicate in validate-vec, (pred val) is false. The validate-vec must be a vector of alternating single-arity predicate fns and associated error messages. Example: [number? "must be a number" even? "must be even"] The ex-info's ex-data map will contain the following entries: :pred - the predicate fn that failed :msg - the associated error message :sym - the fully-qualified symbol of the config var :val - the value set on the config var
(var-symbol v)
Returns the namespace-qualified symbol for the var.
Returns the namespace-qualified symbol for the var.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close