yummy.config

*die-fn*

dynamic

configuration-environment-variable

(configuration-environment-variable program-name)

Yield an environment variable name which can be used to point to a configuration file path

configuration-path

(configuration-path program-name path)

Try to find a configuration path candidate by looking at provided paths, JVM properties, and the environment

configuration-property

(configuration-property program-name)

Yield a property name which can be used to point to a configuration file path

die!

(die! e msg)

Exit early

load-config

(load-config {:keys [spec program-name path die-fn], :as opts})

Load config from the filesystem. The path of the config file is resolved with configuration-path

load-config-string

(load-config-string input {:keys [spec die-fn]})(load-config-string input)

Load configuration from a string, optionaly ensuring that the supplied spec is honored. An optional die-fn can be provided to report errors

safe-parse

(safe-parse data)

Parse YAML data or die with a helpful message

safe-slurp

(safe-slurp path)

Slurp a file or die with a helpful message

spec-printer

A custom spec printer with more helpful messages

validate

(validate v spec)

Validate configuration against aspec or die with a helpful message