Compile-time and runtime configuration for the connector subsystem.
Compile-Time Configuration
Register connectors and the global dispatch policy callback via
Application.compile_env:
# config/config.exs
config :good_analytics, :connectors, [
GoodAnalytics.Connectors.Adapters.Meta,
GoodAnalytics.Connectors.Adapters.Google,
GoodAnalytics.Connectors.Adapters.LinkedIn,
GoodAnalytics.Connectors.Adapters.TikTok
]
config :good_analytics, :dispatch_policy, {MyApp.ConnectorPolicy, :evaluate}Runtime Configuration
The global kill switch can be set in runtime.exs:
config :good_analytics, :connectors_enabled, trueSetting this to false short-circuits all dispatch planning globally.
Summary
Functions
Returns true if the connector subsystem is globally enabled.
Returns the configured dispatch policy callback, or nil if none is set.
Invokes the global dispatch policy callback for a planning context.
Looks up a registered connector module by its connector type (atom or string).
Returns the list of registered connector modules.
Returns the list of registered connector types (atoms).
Functions
Returns true if the connector subsystem is globally enabled.
Reads from runtime config, defaults to true. Can be set to false
in runtime.exs to short-circuit all dispatch planning without redeployment.
Returns the configured dispatch policy callback, or nil if none is set.
The callback should be a {module, function} tuple that accepts a
planning context map and returns :allow or {:reject, reason}.
Invokes the global dispatch policy callback for a planning context.
Returns :allow if no policy is configured or the policy approves.
Returns {:reject, reason} if the policy rejects the dispatch.
Looks up a registered connector module by its connector type (atom or string).
Returns nil if not found. The lookup map is memoized in :persistent_term
and rebuilt only when the registered-connectors list changes, so the
per-delivery hot path stays O(1) without rebuilding the map on every call.
Returns the list of registered connector modules.
Returns the list of registered connector types (atoms).
Each module must implement connector_type/0 from the connector behavior.