Raxol.Protocols.CoreProtocols.Configurable protocol (Raxol v2.0.1)

View Source

Protocol for configurable modules and components. Handles configuration loading, validation, and persistence.

Summary

Types

t()

All the types that implement this protocol.

Functions

Gets the current configuration.

Gets the default configuration.

Merges configuration with defaults.

Sets the configuration, validating it first.

Validates the configuration.

Types

t()

@type t() :: term()

All the types that implement this protocol.

Functions

get_config(configurable)

@spec get_config(t()) :: map()

Gets the current configuration.

get_default_config(configurable)

@spec get_default_config(t()) :: map()

Gets the default configuration.

merge_config(configurable, config)

@spec merge_config(t(), map()) :: map()

Merges configuration with defaults.

set_config(configurable, config)

@spec set_config(t(), map()) :: {:ok, t()} | {:error, [String.t()]}

Sets the configuration, validating it first.

validate_config(configurable, config)

@spec validate_config(t(), map()) :: :ok | {:error, [String.t()]}

Validates the configuration.