Liking cljdoc? Tell your friends :D

boundary.core.config.feature-flags

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
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
raw docstring

add-flags-to-configclj

(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
sourceraw docstring

all-flagsclj

(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}
sourceraw docstring

enabled?clj

(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
sourceraw docstring

flag-infoclj

(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
sourceraw docstring

get-env-valueclj

(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
sourceraw docstring

known-flagsclj

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
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
sourceraw docstring

parse-boolclj

(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
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close