Liking cljdoc? Tell your friends :D

omniconf.core

Omniconf is an exhaustive configuration tool.

Omniconf is an exhaustive configuration tool.
raw docstring

*data-readers*clj

The default data-readers to use when reading a configuration file

The default data-readers to use when reading a configuration file
sourceraw docstring

defineclj

(define scheme)

Declare the configuration that the program supports. scheme is a map of keyword names to specs.

Example:

(define {:boolean-option {:description "can be either true or nil"} :string-option {:type :string :description "this option's value is taken as is"} :integer-option {:type :number :required true :description "parsed as integer, must be present"}}

Supported attributes:

:description - string to describe the option in the help message. :type - one of #{:string :keyword :number :boolean :edn :file :directory}. :parser - 1-arity fn to be called on a string given by CMD args or ENV. Unnecessary if :type is specified. :required - boolean value whether the option must have a value; or 0-arity fn, if it returns true, the option must have a value. :one-of - a set of accepted values for the given option. :verifier - fn on key and val, should throw an exception if option is invalid. :secret - if true, value will not be printed during verification. :nested - allows to create hierarchies of options.

Declare the configuration that the program supports. `scheme` is a map of
keyword names to specs.

Example:

(define {:boolean-option {:description "can be either true or nil"}
         :string-option  {:type :string
                          :description "this option's value is taken as is"}
         :integer-option {:type :number
                          :required true
                          :description "parsed as integer, must be present"}}

Supported attributes:

:description - string to describe the option in the help message.
:type - one of #{:string :keyword :number :boolean :edn :file :directory}.
:parser - 1-arity fn to be called on a string given by CMD args or ENV.
          Unnecessary if :type is specified.
:required - boolean value whether the option must have a value;
            or 0-arity fn, if it returns true, the option must have a value.
:one-of - a set of accepted values for the given option.
:verifier - fn on key and val, should throw an exception if option is invalid.
:secret - if true, value will not be printed during verification.
:nested - allows to create hierarchies of options.
sourceraw docstring

enable-functions-as-defaultsclj

(enable-functions-as-defaults)

Allow invoking functions passed to :default field for the options.

Allow invoking functions passed to :default field for the options.
sourceraw docstring

failclj

(fail fmt & args)

Throws an exception with a message specified by fmt and args.

Throws an exception with a message specified by `fmt` and `args`.
sourceraw docstring

getclj

(get & ks)

Get the value from the current configuration given the path in nested structure specified by ks. Path can be provided as a single sequence, or as a variable number of keywords.

Get the value from the current configuration given the path in nested
structure specified by `ks`. Path can be provided as a single sequence, or as
a variable number of keywords.
sourceraw docstring

parse-booleanclj

(parse-boolean s)

Parses string as a Boolean.

Parses string as a Boolean.
sourceraw docstring

parse-ednclj

(parse-edn s)

Calls clojure.edn/read-string on a string.

Calls `clojure.edn/read-string` on a string.
sourceraw docstring

parse-filenameclj

(parse-filename s)

Parses string as a relative filename.

Parses string as a relative filename.
sourceraw docstring

parse-numberclj

(parse-number s)

Parses string as a Long.

Parses string as a Long.
sourceraw docstring

populate-from-cmdclj

(populate-from-cmd cmd-args)
(populate-from-cmd cmd-args quit-on-error)

Fill configuration from command-line arguments.

Fill configuration from command-line arguments.
sourceraw docstring

populate-from-envclj

(populate-from-env)
(populate-from-env quit-on-error)

Fill configuration from environment variables. This function must be called only after define. If quit-on-error is true, immediately quit when program occurs.

Fill configuration from environment variables. This function must be called
only after `define`. If `quit-on-error` is true, immediately quit when program
occurs.
sourceraw docstring

populate-from-fileclj

(populate-from-file edn-file)
(populate-from-file edn-file quit-on-error)

Fill configuration from an edn file. Any data-reader functions may be optionally set by setting the data-readers binding.

Fill configuration from an edn file.
Any data-reader functions may be optionally set by setting the *data-readers* binding.
sourceraw docstring

populate-from-mapclj

(populate-from-map config-map)

Fill configuration from a map passed directly as value.

Fill configuration from a map passed directly as value.
sourceraw docstring

populate-from-propertiesclj

(populate-from-properties)
(populate-from-properties quit-on-error)

Fill configuration from Java properties.

Fill configuration from Java properties.
sourceraw docstring

populate-from-ssmclj

(populate-from-ssm path)

Fill configuration from AWS Systems Manager. Recursively look up all parameters under the given path. com.grammarly/omniconf.ssm dependency must be on classpath.

Fill configuration from AWS Systems Manager. Recursively look up all parameters
under the given `path`.
com.grammarly/omniconf.ssm dependency must be on classpath.
sourceraw docstring

populate-from-ssm-continuallyclj

(populate-from-ssm-continually path interval-in-seconds)

Like populate-from-ssm, but runs regularly at the specified interval. Use this to dynamically reconfigure your program at runtime. com.grammarly/omniconf.ssm dependency must be on classpath.

Like `populate-from-ssm`, but runs regularly at the specified interval. Use
this to dynamically reconfigure your program at runtime.
com.grammarly/omniconf.ssm dependency must be on classpath.
sourceraw docstring

(print-cli-help)

Prints a help message describing all supported command-line arguments.

Prints a help message describing all supported command-line arguments.
sourceraw docstring

report-configurationclj

(report-configuration)

Prints the current configuration state to *out*. Hide options marked as :secret.

Prints the current configuration state to `*out*`. Hide options marked as
`:secret`.
sourceraw docstring

setclj

(set & args)

Set the value for the ks path in the current configuration. Path can be provided as a single sequence, or as a variable number of keywords. If value is a string, call the respective parser on it before setting.

Set the `value` for the `ks` path in the current configuration. Path can be
provided as a single sequence, or as a variable number of keywords. If value
is a string, call the respective parser on it before setting.
sourceraw docstring

set-logging-fnclj

(set-logging-fn fn)

Change println to a custom logging function that Omniconf will use.

Change `println` to a custom logging function that Omniconf will use.
sourceraw docstring

stop-ssm-pollerclj

(stop-ssm-poller)

Stop the process that polls SSM for configuration, created by populate-from-ssm-continually. com.grammarly/omniconf.ssm dependency must be on classpath.

Stop the process that polls SSM for configuration, created by
`populate-from-ssm-continually`.
com.grammarly/omniconf.ssm dependency must be on classpath.
sourceraw docstring

verifyclj

(verify & {:keys [silent]})

Checks if all the required options are provided, if all values are in range, and prints the configuration. If :quit-on-error is set, script will exit if configuration is incorrect. If :silent is true, don't print the configuration state.

Checks if all the required options are provided, if all values are in range,
and prints the configuration. If `:quit-on-error` is set, script will exit if
configuration is incorrect. If `:silent` is true, don't print the
configuration state.
sourceraw docstring

verify-directory-non-emptyclj

(verify-directory-non-empty key dir)

Check if dir contains at least one file. Also checks that dir exists.

Check if `dir` contains at least one file. Also checks that `dir` exists.
sourceraw docstring

verify-file-existsclj

(verify-file-exists key file)

Check if file or directory denoted by file exists, raise error otherwise.

Check if file or directory denoted by `file` exists, raise error otherwise.
sourceraw docstring

with-optionscljmacro

(with-options bindings & body)

Binds given symbols to respective configuration parameters and executes body in that context. Works only for top-level parameters.

Binds given symbols to respective configuration parameters and executes
`body` in that context. Works only for top-level parameters.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close