Raxol.Core.Runtime.Plugins.CommandHelper.Behaviour behaviour (Raxol v0.4.0)
View SourceDefines the behaviour for plugin command management.
This behaviour is responsible for:
- Registering plugin commands
- Managing command handlers
- Validating command specifications
- Handling command execution
Summary
Callbacks
Executes a command for a plugin.
Gets all registered commands for a plugin.
Registers commands for a plugin.
Unregisters commands for a plugin.
Validates a plugin's command specifications.
Callbacks
@callback execute_command( command :: atom(), args :: list(), plugin_module :: module(), plugin_state :: map() ) :: {:ok, map()} | {:error, any()}
Executes a command for a plugin.
@callback get_plugin_commands( plugin_id :: String.t(), command_table :: atom() ) :: {:ok, [map()]} | {:error, any()}
Gets all registered commands for a plugin.
@callback register_plugin_commands( plugin_module :: module(), plugin_state :: map(), command_table :: atom() ) :: :ok | {:error, any()}
Registers commands for a plugin.
@callback unregister_plugin_commands( plugin_id :: String.t(), command_table :: atom() ) :: :ok | {:error, any()}
Unregisters commands for a plugin.
Validates a plugin's command specifications.