Squidie.Config (squidie v0.1.2)

Copy Markdown View Source

Loads and validates host application configuration for Squidie.

This contract is intentionally small so application teams only configure the runtime boundary once, while workflow authors stay focused on declarative workflow definitions and public API usage.

Summary

Functions

Loads Squidie configuration from the host application environment.

Loads configuration or raises an ArgumentError with the validation details.

Types

config_error()

@type config_error() :: {:missing_config, [atom()]} | {:invalid_config, keyword()}

raw_config()

@type raw_config() :: [
  repo: module(),
  runtime: runtime(),
  read_model: read_model(),
  journal_storage: term(),
  queue: atom() | String.t()
]

read_model()

@type read_model() :: :read_model

runtime()

@type runtime() :: :journal

t()

@type t() :: %Squidie.Config{
  journal_storage: Squidie.Runtime.Journal.Storage.t() | nil,
  queue: String.t(),
  read_model: read_model(),
  repo: module(),
  runtime: runtime()
}

Functions

load(overrides \\ [])

@spec load(keyword()) :: {:ok, t()} | {:error, config_error()}

Loads Squidie configuration from the host application environment.

Optional overrides are merged after application configuration so tests and embedding applications can supply runtime-specific repositories without mutating global application state.

load!(overrides \\ [])

@spec load!(keyword()) :: t()

Loads configuration or raises an ArgumentError with the validation details.