Caddy.ConfigManager.Behaviour behaviour (Caddy v2.3.1)
View SourceBehaviour for ConfigManager, enabling Mox-based testing.
Defines the contract for configuration management operations that coordinate between in-memory and runtime Caddy config.
Summary
Callbacks
Apply JSON config directly to running Caddy
Apply JSON config to running Caddy at specific path
Check if in-memory and runtime configs are in sync
Get configuration from specified source
Get in-memory config in specified format
Get JSON config from running Caddy
Get JSON config from running Caddy at specific path
Rollback to last known good config
Set Caddyfile in memory with optional sync to Caddy
Pull running Caddy config to memory
Push in-memory config to running Caddy
Push in-memory config to running Caddy with options
Validate config without applying
Types
Callbacks
Apply JSON config directly to running Caddy
Apply JSON config to running Caddy at specific path
@callback check_sync_status() :: {:ok, sync_status()}
Check if in-memory and runtime configs are in sync
Get configuration from specified source
@callback get_memory_config(format :: :caddyfile | :json) :: {:ok, binary() | map()} | {:error, term()}
Get in-memory config in specified format
Get JSON config from running Caddy
Get JSON config from running Caddy at specific path
@callback rollback() :: :ok | {:error, term()}
Rollback to last known good config
Set Caddyfile in memory with optional sync to Caddy
@callback sync_from_caddy() :: :ok | {:error, term()}
Pull running Caddy config to memory
@callback sync_to_caddy() :: :ok | {:error, term()}
Push in-memory config to running Caddy
Push in-memory config to running Caddy with options
Validate config without applying