Application configuration via a big map.
A configuration is a nested key-value map.
It contains top-level settings and sections of qualified settings, like so:
{:top-level-setting-key 'foo
{:section-key
{:section-setting 'bar}}}
Additionally, a config contains profiles with additional settings that can be mixed in, like so:
{:top-level-setting-key 'foo
{:section-key
{:section-setting 'bar}}
{:profiles
{:dev
{:top-level-setting-key 'bar
{:section-key
{:section-setting 'baz}}}}}}
Each profile has the same format as the top-level configuration itself
(sans the :profiles
key).
Application configuration via a big map. A configuration is a nested key-value map. It contains top-level settings and sections of qualified settings, like so: {:top-level-setting-key 'foo {:section-key {:section-setting 'bar}}} Additionally, a config contains *profiles* with additional settings that can be mixed in, like so: {:top-level-setting-key 'foo {:section-key {:section-setting 'bar}} {:profiles {:dev {:top-level-setting-key 'bar {:section-key {:section-setting 'baz}}}}}} Each profile has the same format as the top-level configuration itself (sans the `:profiles` key).
(access config setting-or-section & sections)
Access the value of a setting or map of a section.
Note that the setting comes first, followed by the access path.
setting-or-section
is either a setting, section or an index into a sequence schema.sections
is a list of sections and indices into sequence schemasAccess the value of a setting or map of a section. Note that the setting comes first, followed by the access path. - `setting-or-section` is either a setting, section or an index into a sequence schema. - `sections` is a list of sections and indices into sequence schemas
(access-lens setting-or-section & sections)
A lens focussing on the value of a setting or map of a section.
Both the yanker and the shover use access
to check the validity of the
structure of the given configuration object and to signal errors otherwise.
Additionally, the shover completes the given value according to the range or
schema.
Note that the setting comes first, followed by the access path.
setting-or-section
is either a setting, section or an index into a sequence schema.sections
is a list of sections and indices into sequence schemasA lens focussing on the value of a setting or map of a section. Both the yanker and the shover use [[access]] to check the validity of the structure of the given configuration object and to signal errors otherwise. Additionally, the shover completes the given value according to the range or schema. Note that the setting comes first, followed by the access path. - `setting-or-section` is either a setting, section or an index into a sequence schema. - `sections` is a list of sections and indices into sequence schemas
(any-range & rs)
Range that satisfies one of the ranges, tried from left to right.
Range that satisfies one of the ranges, tried from left to right.
(any-value-range dflt)
Range for any value at all.
Range for any value at all.
(boolean-range dflt)
Range for a boolean, with explicit default.
Range for a boolean, with explicit default.
(boolean? x)
Check if a value is a boolean.
Check if a value is a boolean.
(configuration-object rec__3650__auto__)
(configuration-object data__3651__auto__ v__3652__auto__)
(configuration-object rec__3306__auto__)
(configuration-object data__3307__auto__ v__3308__auto__)
Lens for the object
field from a [[Configuration]] record. See active.clojure.config/really-make-configuration
.
Lens for the `object` field from a [[Configuration]] record. See [[active.clojure.config/really-make-configuration]].
(configuration-schema rec__3650__auto__)
(configuration-schema data__3651__auto__ v__3652__auto__)
(configuration-schema rec__3306__auto__)
(configuration-schema data__3307__auto__ v__3308__auto__)
Lens for the schema
field from a [[Configuration]] record. See active.clojure.config/really-make-configuration
.
Lens for the `schema` field from a [[Configuration]] record. See [[active.clojure.config/really-make-configuration]].
(configuration? thing)
Is object a Configuration
record? See active.clojure.config/really-make-configuration
.
Is object a `Configuration` record? See [[active.clojure.config/really-make-configuration]].
(diff-configuration-objects schema config-object-1 config-object-2)
Returns sequence of triples [path-vector version-1 version-2]
of settings that differ.
The config objects must be validated and completed.
Returns sequence of triples `[path-vector version-1 version-2]` of settings that differ. The config objects must be validated and completed.
(diff-configurations schema config-1 config-2)
Returns sequence of triples [path-vectors version-1 version-2] of settings that differ.
Returns sequence of triples [path-vectors version-1 version-2] of settings that differ.
(diff-setting-values setting path v1 v2)
Returns sequence of triples [path-vector version-1 version-2]
of settings that differ.
Handles some ranges more intelligently.
Returns sequence of triples `[path-vector version-1 version-2]` of settings that differ. Handles some ranges more intelligently.
(integer-between-range min max dflt)
Range for an integer from a specified range, with explicit default.
Range for an integer from a specified range, with explicit default.
(make-configuration schema config-object)
(make-configuration schema profile-names config-object)
Make a configuration from a map.
Make a configuration from a map.
(make-map-schema description settings settings-map sections sections-map)
Make a [[Schema]] object describing a config format.
For internal use; you should use schema
.
description
is a human-readable descriptionsettings
is a collection of [[Setting]]ssettings-map
is a map from setting keys to settingssections
is a collection of [[Section]]ssections-map
is a map from section keys to sectionsMake a [[Schema]] object describing a config format. *For internal use;* you should use [[schema]]. - `description` is a human-readable description - `settings` is a collection of [[Setting]]s - `settings-map` is a map from setting keys to settings - `sections` is a collection of [[Section]]s - `sections-map` is a map from section keys to sections
(make-range description completer reduce)
(make-range description completer reduce diff)
(make-range-error range path value)
Make a a [[RangeError]] object describing an error from range checking.
range
is the range that caused the errorpath
is the path in the configuration that describes where the error is.value
is the value that was wrong.range
can be nil' if
key` does not appear in the schema.
Make a a [[RangeError]] object describing an error from range checking. - `range` is the range that caused the error - `path` is the path in the configuration that describes where the error is. - `value` is the value that was wrong. `range` can be `nil' if `key` does not appear in the schema.
(make-scalar-range description completer)
(make-scalar-range description completer diff)
Make a range for unstructured, non-collection ranges.
Make a range for unstructured, non-collection ranges.
(make-section key schema inherit?)
Construct a Section
(Section within a config with settings of its own.) record.
key
: access via active.clojure.config/section-key
schema
: access via active.clojure.config/section-schema
inherit?
: access via active.clojure.config/section-inherit?
Construct a `Section` (Section within a config with settings of its own.) record. `key`: access via [[active.clojure.config/section-key]] `schema`: access via [[active.clojure.config/section-schema]] `inherit?`: access via [[active.clojure.config/section-inherit?]]
(make-sequence-schema description element-schema non-empty?)
Construct a SequenceSchema
(A sequence schema describes a sequence config format.) record.
description
: access via active.clojure.config/sequence-schema-description
element-schema
: access via active.clojure.config/sequence-schema-element-schema
non-empty?
: access via active.clojure.config/sequence-schema-non-empty?
Construct a `SequenceSchema` (A sequence schema describes a sequence config format.) record. `description`: access via [[active.clojure.config/sequence-schema-description]] `element-schema`: access via [[active.clojure.config/sequence-schema-element-schema]] `non-empty?`: access via [[active.clojure.config/sequence-schema-non-empty?]]
(make-setting key description range inherit?)
Make a named schema [[Setting]] object.
key
is a keyword naming the settingdescription
is a human-readable description objectrange
is a [[Range]] for the admissible values of the settinginherit?
says whether the setting values may be inherited from a surrounding sectionMake a named schema [[Setting]] object. - `key` is a keyword naming the setting - `description` is a human-readable description object - `range` is a [[Range]] for the admissible values of the setting - `inherit?` says whether the setting values may be inherited from a surrounding section
(map-of-range key-range val-range)
Range for a map with keys and values of underlying ranges, respectively.
Range for a map with keys and values of underlying ranges, respectively.
(map-schema-description rec__3650__auto__)
(map-schema-description data__3651__auto__ v__3652__auto__)
(map-schema-description rec__3306__auto__)
(map-schema-description data__3307__auto__ v__3308__auto__)
Lens for the description
field from a [[Schema]] record. See active.clojure.config/make-map-schema
.
Lens for the `description` field from a [[Schema]] record. See [[active.clojure.config/make-map-schema]].
(map-schema-sections rec__3650__auto__)
(map-schema-sections data__3651__auto__ v__3652__auto__)
(map-schema-sections rec__3306__auto__)
(map-schema-sections data__3307__auto__ v__3308__auto__)
Lens for the sections
field from a [[Schema]] record. See active.clojure.config/make-map-schema
.
Lens for the `sections` field from a [[Schema]] record. See [[active.clojure.config/make-map-schema]].
(map-schema-sections-map rec__3650__auto__)
(map-schema-sections-map data__3651__auto__ v__3652__auto__)
(map-schema-sections-map rec__3306__auto__)
(map-schema-sections-map data__3307__auto__ v__3308__auto__)
Lens for the sections-map
field from a [[Schema]] record. See active.clojure.config/make-map-schema
.
Lens for the `sections-map` field from a [[Schema]] record. See [[active.clojure.config/make-map-schema]].
(map-schema-settings rec__3650__auto__)
(map-schema-settings data__3651__auto__ v__3652__auto__)
(map-schema-settings rec__3306__auto__)
(map-schema-settings data__3307__auto__ v__3308__auto__)
Lens for the settings
field from a [[Schema]] record. See active.clojure.config/make-map-schema
.
Lens for the `settings` field from a [[Schema]] record. See [[active.clojure.config/make-map-schema]].
(map-schema-settings-map rec__3650__auto__)
(map-schema-settings-map data__3651__auto__ v__3652__auto__)
(map-schema-settings-map rec__3306__auto__)
(map-schema-settings-map data__3307__auto__ v__3308__auto__)
Lens for the settings-map
field from a [[Schema]] record. See active.clojure.config/make-map-schema
.
Lens for the `settings-map` field from a [[Schema]] record. See [[active.clojure.config/make-map-schema]].
(map-schema? thing)
Is object a Schema
record? See active.clojure.config/make-map-schema
.
Is object a `Schema` record? See [[active.clojure.config/make-map-schema]].
(merge-config-objects schema c)
(merge-config-objects schema c1 c2)
(merge-config-objects schema c1 c2 & cs)
Merge several config maps into one, with the latter taking precedence.
Merge several config maps into one, with the latter taking precedence.
(nonempty-string-range & [max-length])
Range for a non-empty string with optional max length.
Range for a non-empty string with optional max length.
(normalize&check-config-object schema config)
(normalize&check-config-object schema profile-names config)
(normalize&check-config-object schema profile-names config inherited-map path)
Normalize and check the validity of a configuration object.
In the result, every setting has an associated value.
Normalize and check the validity of a configuration object. In the result, every setting has an associated value.
(one-of-range vals dflt)
Range for one of a set of values, with explicit default.
Range for one of a set of values, with explicit default.
(one-of-range-custom-compare vals dflt compare-fn)
Range for one of a set of values, with custom compare function, with explicit default.
Range for one of a set of values, with custom compare function, with explicit default.
(optional-default-range range dflt)
Range for something that may be in an underlying range. If it is nil, then dflt
is used, which must be in the underlying range too.
Range for something that may be in an underlying range. If it is nil, then `dflt` is used, which must be in the underlying range too.
(optional-range range)
Range for something that may be in an underlying range or nil
.
Range for something that may be in an underlying range or `nil`.
(or-dot-range r)
Given range r
is required in the first line,
the remainder of the lines the field holds ".".
Given range `r` is required in the first line, the remainder of the lines the field holds ".".
(predicate-range desc pred dflt)
Range specified by a simple predicate.
Range specified by a simple predicate.
(range-completer rec__3650__auto__)
(range-completer data__3651__auto__ v__3652__auto__)
(range-completer rec__3306__auto__)
(range-completer data__3307__auto__ v__3308__auto__)
Lens for the completer
field from a [[ValueRange]] record. See active.clojure.config/really-make-range
.
Lens for the `completer` field from a [[ValueRange]] record. See [[active.clojure.config/really-make-range]].
(range-description rec__3650__auto__)
(range-description data__3651__auto__ v__3652__auto__)
(range-description rec__3306__auto__)
(range-description data__3307__auto__ v__3308__auto__)
Lens for the description
field from a [[ValueRange]] record. See active.clojure.config/really-make-range
.
Lens for the `description` field from a [[ValueRange]] record. See [[active.clojure.config/really-make-range]].
(range-diff rec__3650__auto__)
(range-diff data__3651__auto__ v__3652__auto__)
(range-diff rec__3306__auto__)
(range-diff data__3307__auto__ v__3308__auto__)
Lens for the diff
field from a [[ValueRange]] record. See active.clojure.config/really-make-range
.
Lens for the `diff` field from a [[ValueRange]] record. See [[active.clojure.config/really-make-range]].
(range-error-path rec__3650__auto__)
(range-error-path data__3651__auto__ v__3652__auto__)
(range-error-path rec__3306__auto__)
(range-error-path data__3307__auto__ v__3308__auto__)
Lens for the path
field from a [[RangeError]] record. See active.clojure.config/make-range-error
.
Lens for the `path` field from a [[RangeError]] record. See [[active.clojure.config/make-range-error]].
(range-error-range rec__3650__auto__)
(range-error-range data__3651__auto__ v__3652__auto__)
(range-error-range rec__3306__auto__)
(range-error-range data__3307__auto__ v__3308__auto__)
Lens for the range
field from a [[RangeError]] record. See active.clojure.config/make-range-error
.
Lens for the `range` field from a [[RangeError]] record. See [[active.clojure.config/make-range-error]].
(range-error-value rec__3650__auto__)
(range-error-value data__3651__auto__ v__3652__auto__)
(range-error-value rec__3306__auto__)
(range-error-value data__3307__auto__ v__3308__auto__)
Lens for the value
field from a [[RangeError]] record. See active.clojure.config/make-range-error
.
Lens for the `value` field from a [[RangeError]] record. See [[active.clojure.config/make-range-error]].
(range-error? thing)
Is object a RangeError
record? See active.clojure.config/make-range-error
.
Is object a `RangeError` record? See [[active.clojure.config/make-range-error]].
(range-map descr range f & args)
Range constructed by transforming values matching an existing range.
Range constructed by transforming values matching an existing range.
(range-reduce rec__3650__auto__)
(range-reduce data__3651__auto__ v__3652__auto__)
(range-reduce rec__3306__auto__)
(range-reduce data__3307__auto__ v__3308__auto__)
Lens for the reduce
field from a [[ValueRange]] record. See active.clojure.config/really-make-range
.
Lens for the `reduce` field from a [[ValueRange]] record. See [[active.clojure.config/really-make-range]].
(range? thing)
Is object a ValueRange
record? See active.clojure.config/really-make-range
.
Is object a `ValueRange` record? See [[active.clojure.config/really-make-range]].
(really-make-configuration object schema)
Construct a Configuration
(Validated and expanded configuration object.) record.
object
: access via active.clojure.config/configuration-object
schema
: access via active.clojure.config/configuration-schema
Construct a `Configuration` (Validated and expanded configuration object.) record. `object`: access via [[active.clojure.config/configuration-object]] `schema`: access via [[active.clojure.config/configuration-schema]]
(really-make-range description completer reduce diff)
Make a [[Range]] range object.
reduce
is a function accepting a range, a path, a function, an initial result,
and a value, reducing collection values similar to clojure [[reduce]], calling
(f range path res v)
on all scalar values.diff
is a function accepting two values that returns a sequence of [path v1 v2]
, see
diff functions belowMake a [[Range]] range object. - `description' is a human-readable string - `completer' is a function that accepts a range, a path, and a value, and either returns a "completed" value that takes defaults etc. into account, or a [[RangeError]] object. - `reduce` is a function accepting a range, a path, a function, an initial result, and a value, reducing collection values similar to clojure [[reduce]], calling `(f range path res v)` on all scalar values. - `diff` is a function accepting two values that returns a sequence of `[path v1 v2]`, see diff functions below
(schema description & element-list)
Construct a map schema.
description
is a human-readable descriptionConstruct a map schema. - `description` is a human-readable description - `element-list' is a list of the [[Setting]]s and [[Section]]s of the schema
(schema-range schema)
Range for a configuration object matching a schema.
Range for a configuration object matching a schema.
(section key schema & {:keys [inherit?]})
Make a section within a config with settings of its own.
Make a section within a config with settings of its own.
(section-inherit? rec__3650__auto__)
(section-inherit? data__3651__auto__ v__3652__auto__)
(section-inherit? rec__3306__auto__)
(section-inherit? data__3307__auto__ v__3308__auto__)
Lens for the inherit?
field from a [[Section]] record. See active.clojure.config/make-section
.
Lens for the `inherit?` field from a [[Section]] record. See [[active.clojure.config/make-section]].
(section-key rec__3650__auto__)
(section-key data__3651__auto__ v__3652__auto__)
(section-key rec__3306__auto__)
(section-key data__3307__auto__ v__3308__auto__)
Lens for the key
field from a [[Section]] record. See active.clojure.config/make-section
.
Lens for the `key` field from a [[Section]] record. See [[active.clojure.config/make-section]].
(section-schema rec__3650__auto__)
(section-schema data__3651__auto__ v__3652__auto__)
(section-schema rec__3306__auto__)
(section-schema data__3307__auto__ v__3308__auto__)
Lens for the schema
field from a [[Section]] record. See active.clojure.config/make-section
.
Lens for the `schema` field from a [[Section]] record. See [[active.clojure.config/make-section]].
(section-subconfig config & sections)
Extract a section from a config as a config.
Extract a section from a config as a config.
(section? thing)
Is object a Section
record? See active.clojure.config/make-section
.
Is object a `Section` record? See [[active.clojure.config/make-section]].
(sequable? thing)
Test if something can be coerced to a seq.
Test if something can be coerced to a seq.
(sequence-of-range range)
Range for a sequence of values of an underlying range.
Range for a sequence of values of an underlying range.
(sequence-schema-description rec__3650__auto__)
(sequence-schema-description data__3651__auto__ v__3652__auto__)
(sequence-schema-description rec__3306__auto__)
(sequence-schema-description data__3307__auto__ v__3308__auto__)
Lens for the description
field from a [[SequenceSchema]] record. See active.clojure.config/make-sequence-schema
.
Lens for the `description` field from a [[SequenceSchema]] record. See [[active.clojure.config/make-sequence-schema]].
(sequence-schema-element-schema rec__3650__auto__)
(sequence-schema-element-schema data__3651__auto__ v__3652__auto__)
(sequence-schema-element-schema rec__3306__auto__)
(sequence-schema-element-schema data__3307__auto__ v__3308__auto__)
Lens for the element-schema
field from a [[SequenceSchema]] record. See active.clojure.config/make-sequence-schema
.
Lens for the `element-schema` field from a [[SequenceSchema]] record. See [[active.clojure.config/make-sequence-schema]].
(sequence-schema-non-empty? rec__3650__auto__)
(sequence-schema-non-empty? data__3651__auto__ v__3652__auto__)
(sequence-schema-non-empty? rec__3306__auto__)
(sequence-schema-non-empty? data__3307__auto__ v__3308__auto__)
Lens for the non-empty?
field from a [[SequenceSchema]] record. See active.clojure.config/make-sequence-schema
.
Lens for the `non-empty?` field from a [[SequenceSchema]] record. See [[active.clojure.config/make-sequence-schema]].
(sequence-schema? thing)
Is object a SequenceSchema
record? See active.clojure.config/make-sequence-schema
.
Is object a `SequenceSchema` record? See [[active.clojure.config/make-sequence-schema]].
(set-of-range range)
Range for a set of values of an underlying range.
Range for a set of values of an underlying range.
(setting key description range & {:keys [inherit?]})
Construct a setting.
key
is a keyword naming the settingdescription
is a human-readable description objectrange
is a [[Range]] for the admissible values of the settinginherit?
says whether the setting values may be inherited from a surrounding sectionConstruct a setting. - `key` is a keyword naming the setting - `description` is a human-readable description object - `range` is a [[Range]] for the admissible values of the setting - `inherit?` says whether the setting values may be inherited from a surrounding section
(setting-default-value setting)
Compute the default value for a setting.
Compute the default value for a setting.
(setting-description rec__3650__auto__)
(setting-description data__3651__auto__ v__3652__auto__)
(setting-description rec__3306__auto__)
(setting-description data__3307__auto__ v__3308__auto__)
Lens for the description
field from a [[Setting]] record. See active.clojure.config/make-setting
.
Lens for the `description` field from a [[Setting]] record. See [[active.clojure.config/make-setting]].
(setting-inherit? rec__3650__auto__)
(setting-inherit? data__3651__auto__ v__3652__auto__)
(setting-inherit? rec__3306__auto__)
(setting-inherit? data__3307__auto__ v__3308__auto__)
Lens for the inherit?
field from a [[Setting]] record. See active.clojure.config/make-setting
.
Lens for the `inherit?` field from a [[Setting]] record. See [[active.clojure.config/make-setting]].
(setting-key rec__3650__auto__)
(setting-key data__3651__auto__ v__3652__auto__)
(setting-key rec__3306__auto__)
(setting-key data__3307__auto__ v__3308__auto__)
Lens for the key
field from a [[Setting]] record. See active.clojure.config/make-setting
.
Lens for the `key` field from a [[Setting]] record. See [[active.clojure.config/make-setting]].
(setting-range rec__3650__auto__)
(setting-range data__3651__auto__ v__3652__auto__)
(setting-range rec__3306__auto__)
(setting-range data__3307__auto__ v__3308__auto__)
Lens for the range
field from a [[Setting]] record. See active.clojure.config/make-setting
.
Lens for the `range` field from a [[Setting]] record. See [[active.clojure.config/make-setting]].
(setting? thing)
Is object a Setting
record? See active.clojure.config/make-setting
.
Is object a `Setting` record? See [[active.clojure.config/make-setting]].
Range for something that may be passed to [[slurp]].
Range for something that may be passed to [[slurp]].
Range for an abitrary string, default is empty string.
Range for an abitrary string, default is empty string.
(tuple-of-range & rs)
Range for a sequence of mixed underlying ranges.
Range for a sequence of mixed underlying ranges.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close