Liking cljdoc? Tell your friends :D

clojure-commons.config


define-optional-propertyclj

(define-optional-property sym
                          desc
                          [props config-valid configs flag-props]
                          prop-name
                          extraction-fn
                          default-value)

Defines an optional property. This is a helper function that performs common tasks required by the macros for optional properties.

Parameters: sym - the symbol to define. desc - a brief description of the property. props - a ref containing the properties. config-valid - a ref containing the validity flag. configs - a ref containing the list of config settings. flag-props - the feature flag properties determining if the property is relevant. prop-name - the name of the property. extraction-fn - the function used to extract the property value. default-value - the default value for the property.

Defines an optional property. This is a helper function that performs common tasks required by
the macros for optional properties.

Parameters:
    sym           - the symbol to define.
    desc          - a brief description of the property.
    props         - a ref containing the properties.
    config-valid  - a ref containing the validity flag.
    configs       - a ref containing the list of config settings.
    flag-props    - the feature flag properties determining if the property is relevant.
    prop-name     - the name of the property.
    extraction-fn - the function used to extract the property value.
    default-value - the default value for the property.
sourceraw docstring

define-propertyclj

(define-property sym desc configs flag-props extraction-fn)

Defines a property. This is a helper function that performs common tasks required by all of the defprop macros.

Parameters: sym - the symbol to define. desc - a brief description of the property. configs - a ref containing the list of config settings. flag-props - the feature flag properties determining if the property is relevant. extraction-fn - the function used to extract the property value.

Defines a property. This is a helper function that performs common tasks required by all of the
defprop macros.

Parameters:
    sym           - the symbol to define.
    desc          - a brief description of the property.
    configs       - a ref containing the list of config settings.
    flag-props    - the feature flag properties determining if the property is relevant.
    extraction-fn - the function used to extract the property value.
sourceraw docstring

define-required-propertyclj

(define-required-property sym
                          desc
                          [props config-valid configs flag-props]
                          prop-name
                          extraction-fn)

Defines a required property. This is a helper function that performs common tasks required by the macros for required properties.

Parameters: sym - the symbol to define. desc - a brief description of the property. props - a ref containing the properties. config-valid - a ref containing the validity flag. configs - a ref containing the list of config settings. flag-props - the feature flag properties determining if the property is relevant. prop-name - the name of the property. extraction-fn - the function used to extract the property value.

Defines a required property. This is a helper function that performs common tasks required by
the macros for required properties.

Parameters:
    sym           - the symbol to define.
    desc          - a brief description of the property.
    props         - a ref containing the properties.
    config-valid  - a ref containing the validity flag.
    configs       - a ref containing the list of config settings.
    flag-props    - the feature flag properties determining if the property is relevant.
    prop-name     - the name of the property.
    extraction-fn - the function used to extract the property value.
sourceraw docstring

defprop-booleancljmacro

(defprop-boolean sym desc [props config-valid configs & flag-props] prop-name)

Defines a required Boolean property.

Parameters: sym - the symbol to define. desc - a brief description of the property. props - a ref containing the properties. config-valid - a ref containing a validity flag. configs - a ref containing the list of config settings. flag-props - the feature flag properties determining if the property is relevant. prop-name - the name of the property.

Defines a required Boolean property.

Parameters:
    sym          - the symbol to define.
    desc         - a brief description of the property.
    props        - a ref containing the properties.
    config-valid - a ref containing a validity flag.
    configs      - a ref containing the list of config settings.
    flag-props   - the feature flag properties determining if the property is relevant.
    prop-name    - the name of the property.
sourceraw docstring

defprop-intcljmacro

(defprop-int sym desc [props config-valid configs & flag-props] prop-name)

Defines a required integer property.

Parameters: sym - the symbol to define. desc - a brief description of the property. props - a ref containing the properties. config-valid - a ref containing a validity flag. configs - a ref containing the list of config settings. flag-props - the feature flag properties determining if the property is relevant. prop-name - the name of the property.

Defines a required integer property.

Parameters:
    sym          - the symbol to define.
    desc         - a brief description of the property.
    props        - a ref containing the properties.
    config-valid - a ref containing a validity flag.
    configs      - a ref containing the list of config settings.
    flag-props   - the feature flag properties determining if the property is relevant.
    prop-name    - the name of the property.
sourceraw docstring

defprop-longcljmacro

(defprop-long sym desc [props config-valid configs & flag-props] prop-name)

Defines a required long property.

Parameters: sym - the symbol to define. desc - a brief description of the property. props - a ref containing the properties. config-valid - a ref containing a validity flag. configs - a ref containing the list of config settings. flag-props - the feature flag properties determining if the property is relevant. prop-name - the name of the property.

Defines a required long property.

Parameters:
    sym          - the symbol to define.
    desc         - a brief description of the property.
    props        - a ref containing the properties.
    config-valid - a ref containing a validity flag.
    configs      - a ref containing the list of config settings.
    flag-props   - the feature flag properties determining if the property is relevant.
    prop-name    - the name of the property.
sourceraw docstring

defprop-optbooleancljmacro

(defprop-optboolean sym
                    desc
                    [props config-valid configs & flag-props]
                    prop-name)
(defprop-optboolean sym
                    desc
                    [props config-valid configs & flag-props]
                    prop-name
                    default)

Defines an optional Boolean property.

Parameters: sym - the symbol to define. desc - a brief description of the property. props - a ref containing the properties. config-valid - a ref containing the validity flag. configs - a ref containing the list of config settings. flag-props - the feature flag properties determining if the property is relevant. prop-name - the name of the property. default - the default value.

Defines an optional Boolean property.

Parameters:
    sym          - the symbol to define.
    desc         - a brief description of the property.
    props        - a ref containing the properties.
    config-valid - a ref containing the validity flag.
    configs      - a ref containing the list of config settings.
    flag-props   - the feature flag properties determining if the property is relevant.
    prop-name    - the name of the property.
    default      - the default value.
sourceraw docstring

defprop-optintcljmacro

(defprop-optint sym desc [props config-valid configs & flag-props] prop-name)
(defprop-optint sym
                desc
                [props config-valid configs & flag-props]
                prop-name
                default)

Defines an optional integer property.

Parameters: sym - the symbol to define. desc - a brief description of the property. props - a ref containing the properties. config-valid - a ref containing the validity flag. flag-props - the feature flag properties determining if the property is relevant. prop-name - the name of the property. default - the default value.

Defines an optional integer property.

Parameters:
    sym          - the symbol to define.
    desc         - a brief description of the property.
    props        - a ref containing the properties.
    config-valid - a ref containing the validity flag.
    flag-props   - the feature flag properties determining if the property is relevant.
    prop-name    - the name of the property.
    default      - the default value.
sourceraw docstring

defprop-optlongcljmacro

(defprop-optlong sym desc [props config-valid configs & flag-props] prop-name)
(defprop-optlong sym
                 desc
                 [props config-valid configs & flag-props]
                 prop-name
                 default)

Defines an optional long property.

Parameters: sym - the symbol to define. desc - a brief description of the property. props - a ref containing the properties. config-valid - a ref containing the validity flag. prop-name - the name of the property. flag-props - the feature flag properties determining if the property is relevant. default - the default value.

Defines an optional long property.

Parameters:
    sym          - the symbol to define.
    desc         - a brief description of the property.
    props        - a ref containing the properties.
    config-valid - a ref containing the validity flag.
    prop-name    - the name of the property.
    flag-props   - the feature flag properties determining if the property is relevant.
    default      - the default value.
sourceraw docstring

defprop-optstrcljmacro

(defprop-optstr sym desc [props config-valid configs & flag-props] prop-name)
(defprop-optstr sym
                desc
                [props config-valid configs & flag-props]
                prop-name
                default)

Defines an optional string property.

Parameters: sym - the symbol to define. desc - a brief description of the property. props - a ref containing the properties. config-valid - a ref containing a validity flag. configs - a ref containing the list of config settings. flag-props - the feature flag properties determining if the property is relevant. prop-name - the name of the property. default - the default value.

Defines an optional string property.

Parameters:
    sym          - the symbol to define.
    desc         - a brief description of the property.
    props        - a ref containing the properties.
    config-valid - a ref containing a validity flag.
    configs      - a ref containing the list of config settings.
    flag-props   - the feature flag properties determining if the property is relevant.
    prop-name    - the name of the property.
    default      - the default value.
sourceraw docstring

defprop-optuuidcljmacro

(defprop-optuuid sym desc [props config-valid configs & flag-props] prop-name)
(defprop-optuuid sym
                 desc
                 [props config-valid configs & flag-props]
                 prop-name
                 default)

Defines an optional UUID property.

Parameters: sym - the symbol to define. desc - a brief description of the property. props - a ref containing the properties. config-valid - a ref containing the validity flag. configs - a ref containing the list of config settings. flag-props - the feature flag properties determining if the property is relevant. prop-name - the name of the property. default - the default value.

Defines an optional UUID property.

Parameters:
    sym          - the symbol to define.
    desc         - a brief description of the property.
    props        - a ref containing the properties.
    config-valid - a ref containing the validity flag.
    configs      - a ref containing the list of config settings.
    flag-props   - the feature flag properties determining if the property is relevant.
    prop-name    - the name of the property.
    default      - the default value.
sourceraw docstring

defprop-optveccljmacro

(defprop-optvec sym desc [props config-valid configs & flag-props] prop-name)
(defprop-optvec sym
                desc
                [props config-valid configs & flag-props]
                prop-name
                default)

Defines an optional vector property.

Parameters: sym - the symbol to define. desc - a brief description of the property. props - a ref containing the properties. config-valid - a ref containing a validity flag. configs - a ref containing the list of config settings. flag-props - the feature flag properties determining if the property is relevant. prop-name - the name of the property. default - the default value.

Defines an optional vector property.

Parameters:
    sym          - the symbol to define.
    desc         - a brief description of the property.
    props        - a ref containing the properties.
    config-valid - a ref containing a validity flag.
    configs      - a ref containing the list of config settings.
    flag-props   - the feature flag properties determining if the property is relevant.
    prop-name    - the name of the property.
    default      - the default value.
sourceraw docstring

defprop-strcljmacro

(defprop-str sym desc [props config-valid configs & flag-props] prop-name)

defines a required string property.

Parameters: sym - the symbol to define. desc - a brief description of the property. props - a ref containing the properties. config-valid - a ref containing a validity flag. configs - a ref containing the list of config settings. flag-props - the feature flag properties determining if the property is relevant. prop-name - the name of the property.

defines a required string property.

Parameters:
    sym          - the symbol to define.
    desc         - a brief description of the property.
    props        - a ref containing the properties.
    config-valid - a ref containing a validity flag.
    configs      - a ref containing the list of config settings.
    flag-props   - the feature flag properties determining if the property is relevant.
    prop-name    - the name of the property.
sourceraw docstring

defprop-uuidcljmacro

(defprop-uuid sym desc [props config-valid configs & flag-props] prop-name)

Defines a required UUID property

Parameters: sym - the symbol to define. desc - a brief description of the property. props - a ref containing the properties. config-valid - a ref containing a validity flag. configs - a ref containing the list of config settings. flag-props - the feature flag properties determining if the property is relevant. prop-name - the name of the property.

Defines a required UUID property

Parameters:
    sym          - the symbol to define.
    desc         - a brief description of the property.
    props        - a ref containing the properties.
    config-valid - a ref containing a validity flag.
    configs      - a ref containing the list of config settings.
    flag-props   - the feature flag properties determining if the property is relevant.
    prop-name    - the name of the property.
sourceraw docstring

defprop-veccljmacro

(defprop-vec sym desc [props config-valid configs & flag-props] prop-name)

Defines a required vector property.

Parameters: sym - the symbol to define. desc - a brief description of the property. props - a ref containing the properties. config-valid - a ref containing a validity flag. configs - a ref containing the list of config settings. flag-props - the feature flag properties determining if the property is relevant. prop-name - the name of the property.

Defines a required vector property.

Parameters:
    sym          - the symbol to define.
    desc         - a brief description of the property.
    props        - a ref containing the properties.
    config-valid - a ref containing a validity flag.
    configs      - a ref containing the list of config settings.
    flag-props   - the feature flag properties determining if the property is relevant.
    prop-name    - the name of the property.
sourceraw docstring

get-optional-boolean-propclj

(get-optional-boolean-prop props prop-name config-valid)
(get-optional-boolean-prop props prop-name config-valid default)

Gets an optional Boolean property from a set of properties.

Parameters: props - a ref containing the properties. prop-name - the name of the property. config-valid - a ref containing the vailidity flag. default - the default value.

Gets an optional Boolean property from a set of properties.

Parameters:
    props        - a ref containing the properties.
    prop-name    - the name of the property.
    config-valid - a ref containing the vailidity flag.
    default      - the default value.
sourceraw docstring

get-optional-integer-propclj

(get-optional-integer-prop props prop-name config-valid)
(get-optional-integer-prop props prop-name config-valid default)

Gets an optional integer property from a set of properties.

Parameters: props - a ref containing the properties. prop-name - the name of the property. config-valid - a ref containing the validity flag. default - the default value.

Gets an optional integer property from a set of properties.

Parameters:
    props        - a ref containing the properties.
    prop-name    - the name of the property.
    config-valid - a ref containing the validity flag.
    default      - the default value.
sourceraw docstring

get-optional-long-propclj

(get-optional-long-prop props prop-name config-valid)
(get-optional-long-prop props prop-name config-valid default)

Gets an optional long property from a set of properties.

Parameters: props - a ref containing the properties. prop-name - the name of the property. config-valid - a ref containing the vailidity flag. default - the default value.

Gets an optional long property from a set of properties.

Parameters:
    props        - a ref containing the properties.
    prop-name    - the name of the property.
    config-valid - a ref containing the vailidity flag.
    default      - the default value.
sourceraw docstring

get-optional-propclj

(get-optional-prop props prop-name config-valid)
(get-optional-prop props prop-name config-valid default)

Gets an optional property from a set of properties.

Parameters: props - a ref containing the properties. prop-name - the name of the property. config-valid - a ref containing a validity flag. default - the default property value.

Gets an optional property from a set of properties.

Parameters:
    props        - a ref containing the properties.
    prop-name    - the name of the property.
    config-valid - a ref containing a validity flag.
    default      - the default property value.
sourceraw docstring

get-optional-uuid-propclj

(get-optional-uuid-prop props prop-name config-valid)
(get-optional-uuid-prop props prop-name config-valid default)

Gets an optional UUID property from a set of properties.

Parameters: props - a ref containing the properties. prop-name - the name of the property. config-valid - a ref containing the vailidity flag. default - the default value.

Gets an optional UUID property from a set of properties.

Parameters:
    props        - a ref containing the properties.
    prop-name    - the name of the property.
    config-valid - a ref containing the vailidity flag.
    default      - the default value.
sourceraw docstring

get-optional-vector-propclj

(get-optional-vector-prop props prop-name config-valid)
(get-optional-vector-prop props prop-name config-valid default)

Gets an optional vector property from a set of properties.

Parameters: props - a ref containing the properties. prop-name - the name of the property. config-valid - a ref containing a validity flag.

Gets an optional vector property from a set of properties.

Parameters:
    props        - a ref containing the properties.
    prop-name    - the name of the property.
    config-valid - a ref containing a validity flag.
sourceraw docstring

get-required-boolean-propclj

(get-required-boolean-prop props prop-name config-valid)

Gets a required Boolean property from a set of properties. If a property is missing or not able to be converted to a Boolean then the configuration will be marked as invalid and false will be returned.

Parameters: props - a ref containing the properties. prop-name - the name of a property. config-valid - a ref containing a validity flag.

Gets a required Boolean property from a set of properties.  If a property is missing or not able
to be converted to a Boolean then the configuration will be marked as invalid and false will
be returned.

Parameters:
    props        - a ref containing the properties.
    prop-name    - the name of a property.
    config-valid - a ref containing a validity flag.
sourceraw docstring

get-required-integer-propclj

(get-required-integer-prop props prop-name config-valid)

Gets a required integer property from a set of properties. If the property is missing or not able to be converted to an integer then the configuration will be marked as invalid and zero will be returned.

Parameters: props - a ref containing the properties. prop-name - the name of the property. config-valid - a ref containing a validity flag.

Gets a required integer property from a set of properties.  If the property is missing or not
able to be converted to an integer then the configuration will be marked as invalid and zero
will be returned.

Parameters:
    props        - a ref containing the properties.
    prop-name    - the name of the property.
    config-valid - a ref containing a validity flag.
sourceraw docstring

get-required-long-propclj

(get-required-long-prop props prop-name config-valid)

Gets a required long property from a set of properties. If a property is missing or not able to be converted to a long then the configuration will be marked as invalid and zero will be returned.

Parameters: props - a ref containing the properties. prop-name - the name of a property. config-valid - a ref containing a validity flag.

Gets a required long property from a set of properties.  If a property is missing or not able to
be converted to a long then the configuration will be marked as invalid and zero will be
returned.

Parameters:
    props        - a ref containing the properties.
    prop-name    - the name of a property.
    config-valid - a ref containing a validity flag.
sourceraw docstring

get-required-propclj

(get-required-prop props prop-name config-valid)

Gets a required property from a set of properties.

Parameters: props - a ref containing the properties. prop-name - the name of the property. config-valid - a ref containing a validity flag.

Gets a required property from a set of properties.

Parameters:
    props        - a ref containing the properties.
    prop-name    - the name of the property.
    config-valid - a ref containing a validity flag.
sourceraw docstring

get-required-uuid-propclj

(get-required-uuid-prop props prop-name config-valid)

Gets a required UUID property from a set of properties. If a property is missing or not able to be converted to a UUID then the configuration will be marked as invalid and false will be returned.

Parameters: props - a ref containing the properties. prop-name - the name of a property. config-valid - a ref containing a validity flag.

Gets a required UUID property from a set of properties. If a property is missing or not able
to be converted to a UUID then the configuration will be marked as invalid and false will be
returned.

Parameters:
    props        - a ref containing the properties.
    prop-name    - the name of a property.
    config-valid - a ref containing a validity flag.
sourceraw docstring

get-required-vector-propclj

(get-required-vector-prop props prop-name config-valid)

Gets a required vector property from a set of properties.

Parameters: props - a ref containing the properties. prop-name - the name of the property. config-valid - a ref containing a validity flag.

Gets a required vector property from a set of properties.

Parameters:
    props        - a ref containing the properties.
    prop-name    - the name of the property.
    config-valid - a ref containing a validity flag.
sourceraw docstring

load-config-from-fileclj

(load-config-from-file filepath props)
(load-config-from-file conf-dir filename props)

A multi-arity function that loads the configuration properties from a file.

Parameters: conf-dir - the path to the configuration directory. filename - the name of the configuration file. props - the reference to the properties.

or: filepath - the path to the configuration file. props - the reference to the properties.

A multi-arity function that loads the configuration properties from a file.

Parameters:
    conf-dir - the path to the configuration directory.
    filename - the name of the configuration file.
    props    - the reference to the properties.

or:
    filepath - the path to the configuration file.
    props    - the reference to the properties.
sourceraw docstring

load-config-from-mapclj

(load-config-from-map m props)

Loads configuration properties from a Clojure map. This function is used primarily for unit testing services.

Loads configuration properties from a Clojure map. This function is used primarily for unit testing services.
sourceraw docstring

log-configclj

(log-config props & {:keys [filters] :or {filters []}})

Logs the configuration settings.

Parameters: props - the reference to the properties. :filters - list of regexes matching keys in a properties file whose values should be masked. Defaults to: [#"passord" #"password"]. The defaults will be added to the :filters list anyway, so you don't need to specify them.

Logs the configuration settings.

Parameters:
    props - the reference to the properties.
    :filters - list of regexes matching keys in a properties file
               whose values should be masked. Defaults to: [#"passord" #"password"].
               The defaults will be added to the :filters list anyway, so you don't need
               to specify them.
sourceraw docstring

mask-configclj

(mask-config props & {:keys [filters] :or {filters []}})

Returns a new configuration map with the appropriate fields masked.

Parameters: props - the reference to the properties map. :filters - same as what's passed in to (log-config)

Returns a new configuration map with the appropriate fields masked.

Parameters:
    props - the reference to the properties map.
    :filters - same as what's passed in to (log-config)
sourceraw docstring

masked-field?clj

(masked-field? field filters)

Returns a truthy value if the field should be masked and a falsey value if it shouldn't.

Returns a truthy value if the field should be masked and a falsey value if it shouldn't.
sourceraw docstring

record-invalid-propclj

(record-invalid-prop prop-name t config-valid)

Records a property that has an invalid value. Instead of failing on the first missing parameter, we log the missing parameter, mark the configuration as invalid and keep going so that we can log as many configuration errors as possible in one run.

Parameters: prop-name - the name of the property. t - the Throwable instance that caused the error. confiv-valid - a ref containing a validity flag.

Records a property that has an invalid value.  Instead of failing on the first missing
parameter, we log the missing parameter, mark the configuration as invalid and keep going so
that we can log as many configuration errors as possible in one run.

Parameters:
    prop-name    - the name of the property.
    t            - the Throwable instance that caused the error.
    confiv-valid - a ref containing a validity flag.
sourceraw docstring

record-missing-propclj

(record-missing-prop prop-name config-valid)

Records a property that is missing. Instead of failing on the first missing parameter, we log the missing parameter, mark the configuration as invalid and keep going so that we can log as many configuration errors as possible in one run.

Parameters: prop-name - the name of the property. config-valid - a ref containing a validity flag.

Records a property that is missing.  Instead of failing on the first missing parameter, we log
the missing parameter, mark the configuration as invalid and keep going so that we can log as
many configuration errors as possible in one run.

Parameters:
    prop-name    - the name of the property.
    config-valid - a ref containing a validity flag.
sourceraw docstring

string-to-booleanclj

(string-to-boolean prop-name value config-valid)

Attempts to convert a String property to a Boolean property. Returns false if the property can't be converted.

Parameters: prop-name - the name of the property. value - the value of the property as a string. config-valid - a ref containing a validity flag.

Attempts to convert a String property to a Boolean property.  Returns false if the property
can't be converted.

Parameters:
    prop-name    - the name of the property.
    value        - the value of the property as a string.
    config-valid - a ref containing a validity flag.
sourceraw docstring

string-to-intclj

(string-to-int prop-name value config-valid)

Attempts to convert a String property to an integer property. Returns zero if the property can't be converted.

Parameters: prop-name - the name of the property. value - the value of the property as a string. config-valid - a ref containing a vailidity flag.

Attempts to convert a String property to an integer property.  Returns zero if the property
can't be converted.

Parameters:
    prop-name    - the name of the property.
    value        - the value of the property as a string.
    config-valid - a ref containing a vailidity flag.
sourceraw docstring

string-to-longclj

(string-to-long prop-name value config-valid)

Attempts to convert a String property to a long property. Returns zero if the property can't be converted.

Parameters: prop-name - the name of the property. value - the value of the property as a string. config-valid - a ref containing a validity flag.

Attempts to convert a String property to a long property.  Returns zero if the property can't
be converted.

Parameters:
    prop-name    - the name of the property.
    value        - the value of the property as a string.
    config-valid - a ref containing a validity flag.
sourceraw docstring

string-to-uuidclj

(string-to-uuid prop-name value config-valid)

Attempts to convert a String property to a UUID property. Returns false if the property can't be converted.

Parameters: prop-name - the name of the property. value - the value of the property as a string. config-valid - a ref containing a validity flag.

Attempts to convert a String property to a UUID property.  Returns false if the property can't
be converted.

Parameters:
    prop-name    - the name of the property.
    value        - the value of the property as a string.
    config-valid - a ref containing a validity flag.
sourceraw docstring

validate-configclj

(validate-config configs config-valid)

Validates a configuration that has been defined and loaded using this library.

Parameters: configs - a ref containing an array of symbols that were defined. config-valid - a ref to the configuration validity flag.

Validates a configuration that has been defined and loaded using this library.

Parameters:
    configs      - a ref containing an array of symbols that were defined.
    config-valid - a ref to the configuration validity flag.
sourceraw docstring

vector-from-propclj

(vector-from-prop value)

Derives a list of values from a single comma-delimited value.

Parameters: value - the value to convert to a vector.

Derives a list of values from a single comma-delimited value.

Parameters:
    value - the value to convert to a vector.
sourceraw docstring

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

× close