(bind m)
(bind config m)
Returns a config from all the values of m
, coerced into components,
and tagged with the corresponding keys of m
.
Designed to be used similar to how Guice or Dagger 2 define modules,
binding implementations to types. With bind
, you can bind
implementation vars to abstract tags.
Returns a config from all the values of `m`, coerced into components, and tagged with the corresponding keys of `m`. Designed to be used similar to how Guice or Dagger 2 define _modules_, binding implementations to types. With `bind`, you can bind implementation vars to abstract tags.
(classpath-namespaces)
(classpath-namespaces prefixes)
Returns a set of symbols of all namespaces on the classpath. When
prefixes
are given, only returns namespaces starting with one of the
prefixes.
Requires org.clojure/java.classpath
and org.clojure/tools.namespace
on the classpath.
Returns a set of symbols of all namespaces on the classpath. When `prefixes` are given, only returns namespaces starting with one of the prefixes. Requires `org.clojure/java.classpath` and `org.clojure/tools.namespace` on the classpath.
(find-namespaces prefixes)
Returns namespaces whose names start with one of the prefixes
. Can be
used together with from-namespaces
to build a config from loaded
namespaces, found by prefixes
.
Returns namespaces whose names start with one of the `prefixes`. Can be used together with [[from-namespaces]] to build a config from loaded namespaces, found by `prefixes`.
(from-namespaces namespaces)
(from-namespaces config namespaces)
Builds a configuration from the given namespaces.
Builds a configuration from the given namespaces.
(load-namespaces prefixes)
Loads and returns all namespaces matching prefixes
on the classpath.
See classpath-namespaces
for required libraries.
Loads and returns all namespaces matching `prefixes` on the classpath. See [[classpath-namespaces]] for required libraries.
(scan prefixes)
(scan config prefixes)
Scans the classpath for namespaces starting with prefixes
, and returns
a config with all components found in those.
See classpath-namespaces
for required libraries.
Scans the classpath for namespaces starting with `prefixes`, and returns a config with all components found in those. See [[classpath-namespaces]] for required libraries.
(services)
(services name)
Builds a configuration map from namespaces configured in
META-INF/services/init.namespaces
files on the classpath. The format
of these files is the same as defined by java.util.ServiceLoader
.
The default filename init.namespaces
can be overridden with name
.
Requires com.fbeyer/autoload
on the classpath.
Builds a configuration map from namespaces configured in `META-INF/services/init.namespaces` files on the classpath. The format of these files is the same as defined by `java.util.ServiceLoader`. The default filename `init.namespaces` can be overridden with `name`. Requires `com.fbeyer/autoload` on the classpath.
(static-scan prefixes)
Like scan
, but discovers the configuration at macro expansion time.
As such, libraries required for classpath-namespaces
are only needed
during compilation, not at runtime.
Expands to code that uses require
to load required namespaces, and a
config map creating var components with init.meta/component
.
Designed to be used in ahead-of-time compiled applications, that have
clojure.tools.namespace
as a development dependency but don't want to
have it as a runtime dependency.
Like [[scan]], but discovers the configuration at macro expansion time. As such, libraries required for [[classpath-namespaces]] are only needed during compilation, not at runtime. Expands to code that uses `require` to load required namespaces, and a config map creating var components with [[init.meta/component]]. Designed to be used in ahead-of-time compiled applications, that have `clojure.tools.namespace` as a development dependency but don't want to have it as a runtime dependency.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close