Configuration loading and typed accessors.
Reads resources/conf/<env>/config.edn through Aero and exposes the
settings libraries need. Assembling an Integrant system from those settings
is the application's job — see wagoe.system-config in the monorepo, or the
config.clj that wagoe new generates.
This lives in a library because four published libraries used to reach for
it with requiring-resolve, which worked in the monorepo and in generated
projects and nowhere else — and wagoe.user's CLI resolved a db-spec that
generated projects never had (BOU-306).
Usage: (def config (load-config)) (db-spec config)
Configuration loading and typed accessors. Reads `resources/conf/<env>/config.edn` through Aero and exposes the settings libraries need. Assembling an Integrant system from those settings is the application's job — see `wagoe.system-config` in the monorepo, or the `config.clj` that `wagoe new` generates. This lives in a library because four published libraries used to reach for it with `requiring-resolve`, which worked in the monorepo and in generated projects and nowhere else — and `wagoe.user`'s CLI resolved a `db-spec` that generated projects never had (BOU-306). Usage: (def config (load-config)) (db-spec config)
(app-config config)Extract application-level configuration.
Args: config: Configuration map from load-config
Returns: Map with application settings
Extract application-level configuration. Args: config: Configuration map from load-config Returns: Map with application settings
(db-adapter config)Extract database adapter keyword from config.
Args: config: Configuration map from load-config
Returns: Keyword adapter (:sqlite, :h2, :postgresql, :mysql)
Extract database adapter keyword from config. Args: config: Configuration map from load-config Returns: Keyword adapter (:sqlite, :h2, :postgresql, :mysql)
(db-spec config)Extract database specification from config for the active adapter.
Args: config: Configuration map from load-config
Returns: Database spec map appropriate for the adapter
Example: {:adapter :sqlite :database-path "dev-database.db"}
Extract database specification from config for the active adapter.
Args:
config: Configuration map from load-config
Returns:
Database spec map appropriate for the adapter
Example:
{:adapter :sqlite :database-path "dev-database.db"}(default-tenant-id config)Extract default tenant ID for development/testing.
This provides a consistent tenant context for:
Args: config: Configuration map from load-config
Returns: UUID string of default tenant ID
Note: Production systems should NOT rely on defaults and must always specify tenant-id explicitly in requests.
Extract default tenant ID for development/testing. This provides a consistent tenant context for: - REPL development and testing - CLI operations without explicit tenant specification - Default test fixtures Args: config: Configuration map from load-config Returns: UUID string of default tenant ID Note: Production systems should NOT rely on defaults and must always specify tenant-id explicitly in requests.
(error-reporting-config config)Extract error reporting configuration.
Args: config: Configuration map from load-config
Returns: Map with error reporting provider and settings
Extract error reporting configuration. Args: config: Configuration map from load-config Returns: Map with error reporting provider and settings
(http-config config)Extract HTTP server configuration.
Args: config: Configuration map from load-config
Returns: Map with :port, :host, :join?, :port-range, and :drain-timeout-ms keys
:drain-timeout-ms controls graceful shutdown: on stop the server stops accepting new connections, lets in-flight requests finish (bounded by this timeout, in milliseconds), then halts. 0 or nil disables graceful draining.
Extract HTTP server configuration. Args: config: Configuration map from load-config Returns: Map with :port, :host, :join?, :port-range, and :drain-timeout-ms keys :drain-timeout-ms controls graceful shutdown: on stop the server stops accepting new connections, lets in-flight requests finish (bounded by this timeout, in milliseconds), then halts. 0 or nil disables graceful draining.
(load-config)(load-config {:keys [profile]
:or {profile (keyword (or (System/getenv "WAG_ENV") "dev"))}})Load configuration from resources/conf/dev/config.edn using Aero.
Args: opts: Optional map with :profile key (defaults to :dev)
Returns: Configuration map with resolved environment variables and profile selection
Example: (load-config) (load-config {:profile :test})
Load configuration from resources/conf/dev/config.edn using Aero.
Args:
opts: Optional map with :profile key (defaults to :dev)
Returns:
Configuration map with resolved environment variables and profile selection
Example:
(load-config)
(load-config {:profile :test})(logging-config config)Extract logging configuration.
Args: config: Configuration map from load-config
Returns: Map with logging provider and settings
Extract logging configuration. Args: config: Configuration map from load-config Returns: Map with logging provider and settings
(metrics-config config)Extract metrics configuration.
Args: config: Configuration map from load-config
Returns: Map with metrics provider and settings
Extract metrics configuration. Args: config: Configuration map from load-config Returns: Map with metrics provider and settings
(tracing-config config)Extract tracing configuration (defaults to the inert no-op tracer).
Extract tracing configuration (defaults to the inert no-op tracer).
(user-validation-config config)Extract user validation configuration.
Args: config: Configuration map from load-config
Returns: Map with user validation settings including:
Extract user validation configuration. Args: config: Configuration map from load-config Returns: Map with user validation settings including: - :email-domain-allowlist - Set of allowed email domains - :password-policy - Password complexity requirements - :name-restrictions - Name validation rules - :role-restrictions - Role assignment rules - :tenant-limits - Per-tenant user limits - :cross-field-validation - Cross-field validation rules
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 |