Raxol.Plugins.Manager.Core (Raxol v2.0.1)

View Source

Core functionality for the plugin manager. Handles basic plugin management operations and state.

Summary

Functions

Disables a plugin by name. Delegates to Raxol.Plugins.Lifecycle.disable_plugin/2.

Enables a plugin by name. Delegates to Raxol.Plugins.Lifecycle.enable_plugin/2.

Gets the current API version of the plugin manager.

Gets a plugin by name.

Gets a plugin's state by name.

Gets a list of all loaded plugins.

Loads a plugin module and initializes it. Delegates to Raxol.Plugins.Lifecycle.load_plugin/3.

Loads a plugin module with specific configuration and initializes it. Delegates to Raxol.Plugins.Lifecycle.load_plugin/3.

Loads multiple plugins in the correct dependency order. Delegates to Raxol.Plugins.Lifecycle.load_plugins/2.

Returns a map of loaded plugin names to plugin structs (for test compatibility).

Creates a new plugin manager with default configuration.

Sets a plugin's state by name.

Unloads a plugin by name and cleans up its resources. Delegates to Raxol.Plugins.Lifecycle.unload_plugin/2.

Updates the configuration in the manager.

Updates a plugin's state using a function.

Updates the plugins map in the manager and keeps loaded_plugins in sync.

Types

t()

@type t() :: %Raxol.Plugins.Manager.Core{
  api_version: String.t(),
  config: map(),
  event_handler: function() | nil,
  load_order: [String.t()],
  loaded_plugins: %{required(String.t()) => Raxol.Plugins.Plugin.t()},
  metadata: map(),
  plugin_config: Raxol.Plugins.PluginConfig.t(),
  plugin_states: %{required(String.t()) => any()},
  plugins: %{required(String.t()) => Raxol.Plugins.Plugin.t()}
}

Functions

disable_plugin(manager, plugin_name)

Disables a plugin by name. Delegates to Raxol.Plugins.Lifecycle.disable_plugin/2.

enable_plugin(manager, plugin_name)

Enables a plugin by name. Delegates to Raxol.Plugins.Lifecycle.enable_plugin/2.

get_api_version(manager)

Gets the current API version of the plugin manager.

get_plugin(manager, name)

Gets a plugin by name.

get_plugin_state(manager, name)

Gets a plugin's state by name.

list_plugins(manager)

Gets a list of all loaded plugins.

load_plugin(manager, module)

Loads a plugin module and initializes it. Delegates to Raxol.Plugins.Lifecycle.load_plugin/3.

load_plugin(manager, module, config)

Loads a plugin module with specific configuration and initializes it. Delegates to Raxol.Plugins.Lifecycle.load_plugin/3.

load_plugins(manager, modules)

Loads multiple plugins in the correct dependency order. Delegates to Raxol.Plugins.Lifecycle.load_plugins/2.

loaded_plugins(manager)

Returns a map of loaded plugin names to plugin structs (for test compatibility).

new(opts \\ [])

Creates a new plugin manager with default configuration.

set_plugin_state(manager, name, state)

Sets a plugin's state by name.

unload_plugin(manager, plugin_name)

Unloads a plugin by name and cleans up its resources. Delegates to Raxol.Plugins.Lifecycle.unload_plugin/2.

update_config(manager, config)

Updates the configuration in the manager.

update_plugin_state(manager, name, update_fun)

Updates a plugin's state using a function.

update_plugins(manager, plugins)

Updates the plugins map in the manager and keeps loaded_plugins in sync.