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.
Access the value of a setting or map of a section. Note that the setting comes first, followed by the access path.
(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.
Validated and expanded configuration object.
Validated and expanded configuration object.
(configuration-object rec__2619__auto__)
(configuration-object data__2620__auto__ v__2621__auto__)
(configuration-object rec__2304__auto__)
(configuration-object data__2305__auto__ v__2306__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__2619__auto__)
(configuration-schema data__2620__auto__ v__2621__auto__)
(configuration-schema rec__2304__auto__)
(configuration-schema data__2305__auto__ v__2306__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 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 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__2619__auto__)
(map-schema-description data__2620__auto__ v__2621__auto__)
(map-schema-description rec__2304__auto__)
(map-schema-description data__2305__auto__ v__2306__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__2619__auto__)
(map-schema-sections data__2620__auto__ v__2621__auto__)
(map-schema-sections rec__2304__auto__)
(map-schema-sections data__2305__auto__ v__2306__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__2619__auto__)
(map-schema-sections-map data__2620__auto__ v__2621__auto__)
(map-schema-sections-map rec__2304__auto__)
(map-schema-sections-map data__2305__auto__ v__2306__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__2619__auto__)
(map-schema-settings data__2620__auto__ v__2621__auto__)
(map-schema-settings rec__2304__auto__)
(map-schema-settings data__2305__auto__ v__2306__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__2619__auto__)
(map-schema-settings-map data__2620__auto__ v__2621__auto__)
(map-schema-settings-map rec__2304__auto__)
(map-schema-settings-map data__2305__auto__ v__2306__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 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__2619__auto__)
(range-completer data__2620__auto__ v__2621__auto__)
(range-completer rec__2304__auto__)
(range-completer data__2305__auto__ v__2306__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__2619__auto__)
(range-description data__2620__auto__ v__2621__auto__)
(range-description rec__2304__auto__)
(range-description data__2305__auto__ v__2306__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__2619__auto__)
(range-diff data__2620__auto__ v__2621__auto__)
(range-diff rec__2304__auto__)
(range-diff data__2305__auto__ v__2306__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__2619__auto__)
(range-error-path data__2620__auto__ v__2621__auto__)
(range-error-path rec__2304__auto__)
(range-error-path data__2305__auto__ v__2306__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__2619__auto__)
(range-error-range data__2620__auto__ v__2621__auto__)
(range-error-range rec__2304__auto__)
(range-error-range data__2305__auto__ v__2306__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__2619__auto__)
(range-error-value data__2620__auto__ v__2621__auto__)
(range-error-value rec__2304__auto__)
(range-error-value data__2305__auto__ v__2306__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__2619__auto__)
(range-reduce data__2620__auto__ v__2621__auto__)
(range-reduce rec__2304__auto__)
(range-reduce data__2305__auto__ v__2306__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]].
Description of an error that occurred during range checking
Description of an error that occurred during range checking
(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.
RangeError
object.reduce
is a function accepting a range, a key, a function, an initial result,
and a value, reducing collection values similar to clojure [[reduce]], calling
(f range key 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 key, 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 key, a function, an initial result, and a value, reducing collection values similar to clojure [[reduce]], calling `(f range key 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
A schema describes a map-structured config format, and can be used for validation and completion.
A schema describes a map-structured config format, and can be used for validation and completion.
(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 within a config with settings of its own.
Section within a config with settings of its own.
(section-inherit? rec__2619__auto__)
(section-inherit? data__2620__auto__ v__2621__auto__)
(section-inherit? rec__2304__auto__)
(section-inherit? data__2305__auto__ v__2306__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__2619__auto__)
(section-key data__2620__auto__ v__2621__auto__)
(section-key rec__2304__auto__)
(section-key data__2305__auto__ v__2306__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__2619__auto__)
(section-schema data__2620__auto__ v__2621__auto__)
(section-schema rec__2304__auto__)
(section-schema data__2305__auto__ v__2306__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__2619__auto__)
(sequence-schema-description data__2620__auto__ v__2621__auto__)
(sequence-schema-description rec__2304__auto__)
(sequence-schema-description data__2305__auto__ v__2306__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__2619__auto__)
(sequence-schema-element-schema data__2620__auto__ v__2621__auto__)
(sequence-schema-element-schema rec__2304__auto__)
(sequence-schema-element-schema data__2305__auto__ v__2306__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__2619__auto__)
(sequence-schema-non-empty? data__2620__auto__ v__2621__auto__)
(sequence-schema-non-empty? rec__2304__auto__)
(sequence-schema-non-empty? data__2305__auto__ v__2306__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]].
A sequence schema describes a sequence config format.
A sequence schema describes a sequence config format.
(set-of-range range)
Range for a set of values of an underlying range.
Range for a set of values of an underlying range.
Named setting within a config.
Named setting within a config.
(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__2619__auto__)
(setting-description data__2620__auto__ v__2621__auto__)
(setting-description rec__2304__auto__)
(setting-description data__2305__auto__ v__2306__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__2619__auto__)
(setting-inherit? data__2620__auto__ v__2621__auto__)
(setting-inherit? rec__2304__auto__)
(setting-inherit? data__2305__auto__ v__2306__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__2619__auto__)
(setting-key data__2620__auto__ v__2621__auto__)
(setting-key rec__2304__auto__)
(setting-key data__2305__auto__ v__2306__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__2619__auto__)
(setting-range data__2620__auto__ v__2621__auto__)
(setting-range rec__2304__auto__)
(setting-range data__2305__auto__ v__2306__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.
Description of a range of values.
Description of a range of values.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close