Raxol.Core.Runtime.Plugins.PluginCommandHelper.Behaviour behaviour (Raxol v0.5.0)
View SourceDefines the behaviour for plugin command registration and dispatch.
This behaviour is responsible for:
- Finding plugins for command handling
- Registering plugin commands
- Handling command dispatch
- Managing command unregistration
Summary
Callbacks
Finds the plugin responsible for handling a command.
Handles the dispatching of a command to the appropriate plugin.
Registers the commands exposed by a plugin.
Unregisters all commands associated with a specific plugin module.
Callbacks
@callback find_plugin_for_command( command_table :: atom(), command_name :: String.t(), namespace :: atom() | nil, arity :: integer() | :unknown ) :: {:ok, {module(), atom(), integer()}} | :not_found
Finds the plugin responsible for handling a command.
@callback handle_command( command_table :: atom(), command_name_str :: String.t(), namespace :: atom() | nil, args :: list(), state :: map() ) :: {:ok, map()} | :not_found | {:error, any()}
Handles the dispatching of a command to the appropriate plugin.
@callback register_plugin_commands( plugin_module :: module(), plugin_state :: map(), command_table :: atom() ) :: :ok
Registers the commands exposed by a plugin.
Unregisters all commands associated with a specific plugin module.