Feature flag management for gradual rollout of new functionality.
This namespace provides pure functions for checking feature flags based on environment variables and configuration.
Design Principles:
Feature flag management for gradual rollout of new functionality. This namespace provides pure functions for checking feature flags based on environment variables and configuration. Design Principles: - Pure functions: No side effects, configuration passed as parameter - Explicit defaults: Clear behavior when flag not set - Type-safe: Boolean coercion with validation - Backward compatible: Defaults to false for new features
(add-flags-to-config config)(add-flags-to-config config env-map)Add feature flags to application configuration.
Args: config: Application configuration map env-map: Optional environment map
Returns: Configuration map with :feature-flags added
Add feature flags to application configuration. Args: config: Application configuration map env-map: Optional environment map Returns: Configuration map with :feature-flags added
(all-flags)(all-flags env-map)Get status of all known feature flags.
Args: env-map: Optional environment map
Returns: Map of flag-key -> boolean status
Example: (all-flags) => {:devex-validation true, :structured-logging false}
Get status of all known feature flags.
Args:
env-map: Optional environment map
Returns:
Map of flag-key -> boolean status
Example:
(all-flags)
=> {:devex-validation true, :structured-logging false}(enabled? flag-key)(enabled? flag-key env-map)Check if a feature flag is enabled.
Args: flag-key: Feature flag keyword (from known-flags) env-map: Optional environment map (defaults to System/getenv)
Returns: Boolean indicating if feature is enabled
Example: (enabled? :devex-validation) => true ; if BND_DEVEX_VALIDATION=true in environment
Check if a feature flag is enabled. Args: flag-key: Feature flag keyword (from known-flags) env-map: Optional environment map (defaults to System/getenv) Returns: Boolean indicating if feature is enabled Example: (enabled? :devex-validation) => true ; if BND_DEVEX_VALIDATION=true in environment
(flag-info flag-key)(flag-info flag-key env-map)Get information about a specific flag.
Args: flag-key: Feature flag keyword env-map: Optional environment map
Returns: Map with :enabled?, :env-var, :description
Get information about a specific flag. Args: flag-key: Feature flag keyword env-map: Optional environment map Returns: Map with :enabled?, :env-var, :description
(get-env-value env-var)(get-env-value env-var env-map)Get environment variable value.
Args: env-var: Environment variable name env-map: Map of environment variables (defaults to System/getenv)
Returns: String value or nil
Get environment variable value. Args: env-var: Environment variable name env-map: Map of environment variables (defaults to System/getenv) Returns: String value or nil
Registry of known feature flags with metadata.
Each flag includes:
Registry of known feature flags with metadata. Each flag includes: - :env-var - Environment variable name - :default - Default value if not set - :description - Human-readable description
(parse-bool value)Parse string value to boolean.
Args: value: String value from environment
Returns: Boolean value
Truthy values: "true", "1", "yes", "on" (case-insensitive) Falsy values: Everything else
Parse string value to boolean. Args: value: String value from environment Returns: Boolean value Truthy values: "true", "1", "yes", "on" (case-insensitive) Falsy values: Everything else
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |