Raxol.Core.Runtime.Plugins.PluginCommandManager (Raxol v2.0.1)

View Source

Manages plugin command registration and dispatch. Coordinates between plugins and the command system.

Summary

Functions

Returns a specification to start this module under a supervisor.

Dispatch a command to the appropriate plugin.

Get all registered commands.

Get commands for a specific plugin.

Initialize command table with initial plugins.

Unregister all commands for a plugin.

Update command table with plugin commands.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

dispatch_command(command_name, args \\ [])

@spec dispatch_command(atom(), list()) :: {:ok, term()} | {:error, term()}

Dispatch a command to the appropriate plugin.

get_commands()

@spec get_commands() :: map()

Get all registered commands.

get_plugin_commands(plugin_id)

@spec get_plugin_commands(atom()) :: list()

Get commands for a specific plugin.

handle_manager_cast(msg, state)

Callback implementation for Raxol.Core.Behaviours.BaseManager.handle_manager_cast/2.

handle_manager_info(msg, state)

Callback implementation for Raxol.Core.Behaviours.BaseManager.handle_manager_info/2.

initialize_command_table(command_table, plugins)

@spec initialize_command_table(map(), list()) :: map()

Initialize command table with initial plugins.

register_commands(plugin_id, commands, metadata \\ %{})

@spec register_commands(atom(), list(), map()) :: :ok | {:error, term()}

Register commands for a plugin.

start_link(init_opts \\ [])

unregister_commands(plugin_id)

@spec unregister_commands(atom()) :: :ok

Unregister all commands for a plugin.

update_command_table(table, plugin)

@spec update_command_table(map(), map()) :: map()

Update command table with plugin commands.