(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 prefixes & {:keys [include? exclude?]})Returns a set of symbols of all namespaces on the classpath starting
with one of the given prefixes.
The optional include? and exclude? predicates can be used to filter
found results, for example:
(classpath-namespaces ['my.project] :exclude? #(str/ends-with % "-test"))
Returns a set of symbols of all namespaces on the classpath starting with one of the given `prefixes`. The optional `include?` and `exclude?` predicates can be used to filter found results, for example: ```clojure (classpath-namespaces ['my.project] :exclude? #(str/ends-with % "-test")) ```
(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 & {:keys [include? exclude?]})Loads and returns all namespaces matching prefixes on the classpath.
Takes the same options as classpath-namespaces.
Loads and returns all namespaces matching `prefixes` on the classpath. Takes the same options as [[classpath-namespaces]].
(require-namespaces ns-names)Requires all namespaces with ns-names, and returns a sequence of
namespace objects.
Requires all namespaces with `ns-names`, and returns a sequence of namespace objects.
(scan prefixes & {:keys [config include? exclude?]})(scan config prefixes & {:keys [include? exclude?]})Scans the classpath for namespaces starting with prefixes, and returns
a config with all components found in those.
Takes the same options as classpath-namespaces.
Scans the classpath for namespaces starting with `prefixes`, and returns a config with all components found in those. Takes the same options as [[classpath-namespaces]].
(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 & {:keys [include? exclude?]})Like scan, but scans the classpath at macro expansion time.
Expands to code that uses require to load required namespaces, and a
config map created with from-namespaces.
Takes the same options as classpath-namespaces.
Like [[scan]], but scans the classpath at macro expansion time. Expands to code that uses `require` to load required namespaces, and a config map created with [[from-namespaces]]. Takes the same options as [[classpath-namespaces]].
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |