Per-app configuration store backed by Agent.
Each WalEx instance is identified by :name and keeps its config (database
credentials, publication, subscriptions, modules, slot settings, etc.) under
a registered agent so it can be read by replication processes and updated at
runtime via add_config/3, remove_config/3, and replace_config/3.
Summary
Functions
Appends one or more values to a multi-valued config key
(:modules or :subscriptions). Duplicates are removed.
Resolves the event-handler modules for an app: combines explicit :modules
with the convention-derived modules for each subscription, deduplicates, and
keeps only those that actually compile.
Returns a specification to start this module under a supervisor.
Reads stored config for an app.
Shortcut for get_configs(app_name, :database).
Shortcut for get_configs(app_name, :modules).
Returns true if configs is a keyword list with a non-nil entry for key.
Maps each subscription name to its conventional <App>.Events.<Subscription> module atom.
Removes a value from a multi-valued config key
(:modules or :subscriptions).
Replaces a single-valued config key
(e.g. :password, :hostname, :publication).
Starts the per-app config agent. Expects opts[:configs] to contain a keyword
list of user configuration; the agent is registered under the app name.
Converts snake_case (or already-cased) names into CamelCase module-name fragments.
Types
@type start_opts() :: [ database: binary(), hostname: binary(), name: binary(), password: binary(), port: binary(), publication: binary(), username: binary(), webhook_signing_secret: binary(), slot_name: binary(), durable_slot: boolean(), message_middleware: (term(), term() -> :ok), event_relay: keyword(), modules: [module()], subscriptions: [binary()] ]
Functions
Appends one or more values to a multi-valued config key
(:modules or :subscriptions). Duplicates are removed.
Resolves the event-handler modules for an app: combines explicit :modules
with the convention-derived modules for each subscription, deduplicates, and
keeps only those that actually compile.
Returns a specification to start this module under a supervisor.
See Supervisor.
Reads stored config for an app.
With one argument returns the full keyword list. With a key atom returns
that single value. With a list of keys returns a keyword list of those
entries in the requested order.
Shortcut for get_configs(app_name, :database).
Shortcut for get_configs(app_name, :modules).
Returns true if configs is a keyword list with a non-nil entry for key.
Maps each subscription name to its conventional <App>.Events.<Subscription> module atom.
Removes a value from a multi-valued config key
(:modules or :subscriptions).
Replaces a single-valued config key
(e.g. :password, :hostname, :publication).
@spec start_link(opts :: start_opts()) :: Agent.on_start()
Starts the per-app config agent. Expects opts[:configs] to contain a keyword
list of user configuration; the agent is registered under the app name.
Converts snake_case (or already-cased) names into CamelCase module-name fragments.