Raxol.Core.Runtime.Plugins.Loader (Raxol v0.2.0)
View SourcePlaceholder for the plugin loader. Handles loading plugin code and dependencies.
Summary
Functions
Discovers potential plugin modules in a given directory.
Extracts metadata for a given plugin module.
Ensures the code for a given plugin module is loaded.
Returns :ok
or {:error, :module_not_found}
.
Loads a plugin module based on its ID.
Sorts plugins based on dependencies (Placeholder).
Functions
Discovers potential plugin modules in a given directory.
Scans for .ex
files and attempts to derive module names.
Returns a list of {potential_module_atom, file_path}
tuples.
Extracts metadata for a given plugin module.
Checks if the plugin implements Raxol.Core.Runtime.Plugins.PluginMetadataProvider
.
If so, it calls get_metadata/0
on the module.
Otherwise, it returns a default metadata map derived from the module name.
Ensures the code for a given plugin module is loaded.
Returns :ok
or {:error, :module_not_found}
.
Loads a plugin module based on its ID.
Assumes the plugin ID corresponds to an existing module atom. Returns the module atom, placeholder metadata, and config.
Sorts plugins based on dependencies (Placeholder).
Currently returns the input list unsorted.
Requires metadata extraction to be implemented first for actual sorting.
Returns {:ok, sorted_plugin_ids}
or {:error, reason}
.