PacketFlow.Component.Configuration (packetflow v0.1.0)
Component configuration interfaces for dynamic configuration
This module provides:
- Dynamic configuration management
- Configuration validation and schema definitions
- Runtime configuration updates
- Configuration templates and profiles
- Configuration versioning and rollback
- Environment-specific configurations
Summary
Functions
Apply a configuration template to a component
Returns a specification to start this module under a supervisor.
Create a configuration template
Export configuration to file
Get all component configurations
Get configuration for a component
Get configuration history for a component
Get configuration schema for a component
Get a specific configuration value
Import configuration from file
Callback implementation for GenServer.init/1
.
Register a component configuration with schema
Rollback to a previous configuration version
Unregister a component configuration
Unwatch configuration changes
Update configuration for a component
Update configuration schema for a component
Update a specific configuration value
Validate configuration against schema
Watch configuration changes for a component
Types
@type component_config() :: %{ component_id: atom(), config: map(), schema: %{required(config_key()) => config_schema()}, version: String.t(), environment: atom(), last_updated: integer(), metadata: map() }
@type config_schema() :: %{ type: :string | :integer | :float | :boolean | :list | :map | :atom, required: boolean(), default: config_value(), validator: function() | nil, description: String.t() }
@type config_template() :: %{ name: String.t(), description: String.t(), config: map(), schema: %{required(config_key()) => config_schema()}, environments: [atom()] }
@type config_value() :: term()
Functions
Apply a configuration template to a component
Returns a specification to start this module under a supervisor.
See Supervisor
.
@spec create_config_template(String.t(), String.t(), map(), map(), [atom()]) :: :ok | {:error, term()}
Create a configuration template
Export configuration to file
@spec get_all_configs() :: %{required(atom()) => component_config()}
Get all component configurations
Get configuration for a component
@spec get_config_history(atom()) :: [component_config()] | {:error, term()}
Get configuration history for a component
Get configuration schema for a component
@spec get_config_value(atom(), config_key()) :: config_value() | {:error, term()}
Get a specific configuration value
Import configuration from file
Callback implementation for GenServer.init/1
.
Register a component configuration with schema
Rollback to a previous configuration version
@spec unregister_component_config(atom()) :: :ok
Unregister a component configuration
Unwatch configuration changes
Update configuration for a component
Update configuration schema for a component
@spec update_config_value(atom(), config_key(), config_value()) :: :ok | {:error, term()}
Update a specific configuration value
Validate configuration against schema
Watch configuration changes for a component