(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.
(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.
(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.
(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.
(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.
(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.
(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.
(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.
(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.
(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.
(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.
(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.
(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.
(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.
(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.
(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.
(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.
(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.
(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.
(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.
(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.
(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.
(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.
(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.
(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.
(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.
(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.
(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.
(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.
(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.
(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)
(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.
(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.
(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.
(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.
(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.
(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.
(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.
(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.
(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.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close