(binding-map config)
(binding-map config throw-errors?)
Get the dynamic bindings configured in the configuration, and turn them into a var->value mapping to be used with [[clojure.core/with-bindings]].
This will ignore unkown vars/namespaces, because they may not have loaded yet.
Get the dynamic bindings configured in the configuration, and turn them into a var->value mapping to be used with [[clojure.core/with-bindings]]. This will ignore unkown vars/namespaces, because they may not have loaded yet.
(load-config)
(load-config source)
(load-config source opts)
Loads and returns configuration from source
or the file "tests.edn"
if called without arguments.
If the config value loaded from source
is nil, it returns the default
configuration, which is the result of (default-config)
.
Accepts various types as source
:
File
loads from a file from the file system, provided it existsObject
coerces to File
, treated as the single argument to (io/file),
like a string pathURL
treated as a resource on the classpathnil
returns the default configurationThe list of supported types can be extended by extending
the ConfigSource
protocol.
opts
can be used to affect some aspects of loading, which is dependent on
the source
's ConfigSource
implementation. For the source
s supported
out of the box, aero is used to parse the raw
data. It uses opts
in the following way:
(:profile opts)
can be specified to select an Aero profile
(:aero/read-config-opts opts)
is passed to aero/read-config
By default, when loading from something that coerces to a File
, Aero will
try to resolve #include
references as resources first, then files. This is
the default behaviour of Aero (aero/adaptive-resolver
) and is kept for
backwards-compatibility.
When loading from a resource (URL
), we tell Aero to only try resolving
#include
s to resources (aero/resource-resolver
) to try and be less
surprising.
These default choices can be overridden by setting another resolver in opts
:
{:aero/read-config-opts {:resolver resolver-to-use}}
Loads and returns configuration from `source` or the file "tests.edn" if called without arguments. If the config value loaded from `source` is nil, it returns the default configuration, which is the result of `(default-config)`. Accepts various types as `source`: - `File` loads from a file from the file system, provided it exists - `Object` coerces to `File`, treated as the single argument to (io/file), like a string path - `URL` treated as a resource on the classpath - `nil` returns the default configuration The list of supported types can be extended by extending the `ConfigSource` protocol. `opts` can be used to affect some aspects of loading, which is dependent on the `source`'s `ConfigSource` implementation. For the `source`s supported out of the box, [aero](https://github.com/juxt/aero) is used to parse the raw data. It uses `opts` in the following way: `(:profile opts)` can be specified to select an Aero profile `(:aero/read-config-opts opts)` is passed to `aero/read-config` By default, when loading from something that coerces to a `File`, Aero will try to resolve `#include` references as resources first, then files. This is the default behaviour of Aero (`aero/adaptive-resolver`) and is kept for backwards-compatibility. When loading from a resource (`URL`), we tell Aero to only try resolving `#include`s to resources (`aero/resource-resolver`) to try and be less surprising. These default choices can be overridden by setting another resolver in `opts`: `{:aero/read-config-opts {:resolver resolver-to-use}}`
(merge-config c1 c2)
Applies meta-merge to c1 and c2, using ^:replace for certain keys if no metadata is specified.
Applies meta-merge to c1 and c2, using ^:replace for certain keys if no metadata is specified.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close