Managing system-wide configuration.
Configuration map is assumed immutable and can be safely cached. Configuration is static. When the config changes, service should be restarted. Design choice is to have stateless fail-fast services, that have their configuration stored on various places.
Managing system-wide configuration. Configuration map is assumed immutable and can be safely cached. Configuration is static. When the config changes, service should be restarted. Design choice is to have stateless fail-fast services, that have their configuration stored on various places.
(bget cfg k)
(bget cfg k default)
Like get, but coerces to boolean. Does not parse default value. Defaults to false
Like get, but coerces to boolean. Does not parse default value. Defaults to false
(bget-in cfg ks)
(bget-in cfg ks default-value)
Like get-in, but coerces to boolean. Does not parse default value. Defaults to false.
Like get-in, but coerces to boolean. Does not parse default value. Defaults to false.
(cfg)
(cfg search-in)
(cfg search-in include-raw?)
Provides map merged from various sources, in following order:
Sources are also optionally put under :raw key.
Accepted file names for configuration files, loaded in following order:
Conflicts when merging branch and non-branch nodes are resolved into creation of branch node with previous non-branch node put under nil key.
Provides map merged from various sources, in following order: * :cp Configuration file in the root classpath * :profile Project specific environment variables (set e.g. in lein project.clj or profiles.clj) Users must use lein-environ plugin to enable this * custom-cfg reference * :env Environment variables, translating keys * :sys Java system properties, translating keys * :res Custom configuration resources pointed from [:crispin] property, guessing format from filename, defaulting to .edn Sources are also optionally put under :raw key. Accepted file names for configuration files, loaded in following order: * config.json * config.edn * config.clj Conflicts when merging branch and non-branch nodes are resolved into creation of branch node with previous non-branch node put under nil key.
A reference to map that will be merged into configuration map. Used e.g. by boot to inject custom configuration.
A reference to map that will be merged into configuration map. Used e.g. by boot to inject custom configuration.
(fetch-env)
Returns map that represents current environment variables. Name of the environment variable is translated into sequence of keys, e.g. JAVA_HOME will result into {:java {:home "/usr/lib/..."}} map
Returns map that represents current environment variables. Name of the environment variable is translated into sequence of keys, e.g. JAVA_HOME will result into {:java {:home "/usr/lib/..."}} map
(fetch-resource uri)
(fetch-resource parser uri)
Returns map loaded from resource specified by _uri_
, parsed with
_parser_
. UTF-8 encoding is assumed and the resource must
produce exactly one parsed value.
Returns nil
if resource does not exists
Returns map loaded from resource specified by `_uri_`, parsed with `_parser_`. UTF-8 encoding is assumed and the resource must produce exactly one parsed value. Returns `nil` if resource does not exists
(fetch-sys)
Returns map that represents current system properties Name of the environment variable is translated into sequence of keys, e.g. java.home will result into {:java {:home "/usr/lib/..."}} map
Returns map that represents current system properties Name of the environment variable is translated into sequence of keys, e.g. java.home will result into {:java {:home "/usr/lib/..."}} map
(filenames-in-jar jar-file)
Returns a sequence of Strings naming the non-directory entries in
the _jar-file_
.
Returns a sequence of Strings naming the non-directory entries in the `_jar-file_`.
(jar-file? f)
Returns _true_
if file is a normal file with a .jar or
.JAR extension.
Returns `_true_` if file is a normal file with a .jar or .JAR extension.
(nget cfg k)
(nget cfg k default)
Like get, but coerces to number. Does not parse default value. Allows nil values.
Like get, but coerces to number. Does not parse default value. Allows nil values.
(nget-in cfg ks)
(nget-in cfg ks default-value)
Like get-in, but parses value with edn reader and asserts that it is a number. Does not parse default value. Allows nil values.
Like get-in, but parses value with edn reader and asserts that it is a number. Does not parse default value. Allows nil values.
(sget cfg k)
(sget cfg k default)
Like get, but coerces to string. Does not parse default value. Allows nil values.
Like get, but coerces to string. Does not parse default value. Allows nil values.
(sget-in cfg ks)
(sget-in cfg ks default-value)
Like get-in, but coerces to string. Does not parse default value. Nil is not coerced into a string.
Like get-in, but coerces to string. Does not parse default value. Nil is not coerced into a string.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close