duct.core

Core functions required by a Duct application.

add-shutdown-hook

(add-shutdown-hook key func)

Set a function to be executed when the current process shuts down. The key argument should be unique, and is used in remove-shutdown-hook.

compile

(compile config)

Prep then initiate all keys that derive from :duct/compiler.

exec

(exec config)

Prep then initiate a configuration, excluding keys that derive from :duct/compiler, and then block indefinitely. This function should be called from -main when a standalone application is required.

merge-configs

(merge-configs & configs)

Intelligently merge multiple configurations. Uses meta-merge and will merge configurations in order from left to right. Generic top-level keys are merged into more specific descendants, if the descendants exist.

prep

(prep config)

Prep a configuration, ready to be initiated. Key namespaces are loaded, and modules are applied.

read-config

(read-config source)(read-config source & sources)

Read an edn configuration from one or more slurpable sources. Multiple sources are merged together with merge-configs. Three additional data readers are supported:

#ref
an Integrant reference to another key
#resource
a resource path string, see clojure.java.io/resource
#env
an environment variable, see duct.core.env/env

remove-shutdown-hook

(remove-shutdown-hook key)

Remove a shutdown hook identified by the specified key.

target-path

A path to place generated files in. Typically used by compilers. Can be set via the duct.target.path system property.