(defconfig name)
(defconfig name default-val)
Define a configuration variable with name NAME, backed by Archaius.
This will define a var with the given name, initialized to the given default value. The value will be read as a DynamicStringProperty, and will assume the value is encoded with EDN.
If you define a spec with the same name (e.g. if your var is user/foo and you define spec :user/foo
)
then the value read from Archaius will be validated against that spec before altering the value of
the var.
You can pass in the optional metadata:
:on-change -- For dynamic properties, a function that is called when the value of the property changes. The callback should take two arguments: the old value and the new value.
The new var will have the following metadata added to it:
:property -- The DynamicStringProperty instance.
Define a configuration variable with name NAME, backed by Archaius. This will define a var with the given name, initialized to the given default value. The value will be read as a DynamicStringProperty, and will assume the value is encoded with EDN. If you define a spec with the same name (e.g. if your var is user/foo and you define spec `:user/foo`) then the value read from Archaius will be validated against that spec before altering the value of the var. You can pass in the optional metadata: :on-change -- For dynamic properties, a function that is called when the value of the property changes. The callback should take two arguments: the old value and the new value. The new var will have the following metadata added to it: :property -- The DynamicStringProperty instance.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close