Foundation.Contracts.Configurable behaviour (foundation v0.1.0)
Behaviour contract for configuration providers.
Defines the interface that all configuration implementations must follow. Ensures consistent API across different configuration backends.
Summary
Callbacks
Check if the configuration service is available.
Get the complete configuration.
Get a configuration value by path.
Reset configuration to defaults.
Get the list of paths that can be updated at runtime.
Update a configuration value at the given path.
Validate a configuration structure.
Types
Callbacks
@callback available?() :: boolean()
Check if the configuration service is available.
@callback get() :: {:ok, Foundation.Types.Config.t()} | {:error, Foundation.Types.Error.t()}
Get the complete configuration.
@callback get(config_path()) :: {:ok, config_value()} | {:error, Foundation.Types.Error.t()}
Get a configuration value by path.
@callback reset() :: :ok | {:error, Foundation.Types.Error.t()}
Reset configuration to defaults.
@callback updatable_paths() :: [config_path()]
Get the list of paths that can be updated at runtime.
@callback update(config_path(), config_value()) :: :ok | {:error, Foundation.Types.Error.t()}
Update a configuration value at the given path.
@callback validate(Foundation.Types.Config.t()) :: :ok | {:error, Foundation.Types.Error.t()}
Validate a configuration structure.