Documentation ¶
Index ¶
- Constants
- func Create(path, name string) error
- func Disable(name string) error
- func Enable(name string) error
- func Inspect(name string) (pluginapi.Manifest, error)
- func Install(sifPath string) error
- func LoadCallbacks(cb pluginapi.Callback) ([]pluginapi.Callback, error)
- func LoadObject(path string) (*pluginapi.Plugin, error)
- func PrepareGoModules(pluginDir string, disableMinorCheck bool) ([]byte, error)
- func Uninstall(name string) error
- type GoMod
- type Meta
- type Module
- type Replace
- type Require
Constants ¶
const ApptainerSource = "apptainer_source"
ApptainerSource represents the symlink name which will point to the Apptainer source directory.
Variables ¶
This section is empty.
Functions ¶
func Create ¶
Create creates a skeleton plugin directory structure to start development of a new plugin.
func Inspect ¶
Inspect obtains information about the plugin "name".
"name" can be either the name of plugin installed under rootDir or the name of an image file corresponding to a plugin.
func Install ¶
Install installs a plugin from a SIF image under rootDir. It will:
- Check that the SIF is a valid plugin
- Use name from Manifest and calculate the installation path
- Copy the SIF into the plugin path
- Extract the binary object into the path
- Generate a default config file in the path
- Write the Meta struct onto disk in dirRoot
func LoadCallbacks ¶
LoadCallbacks loads plugins registered for the hook instance passed in parameter.
func LoadObject ¶
LoadObject loads a plugin object in memory and returns the Plugin object set within the plugin.
func PrepareGoModules ¶
PrepareGoModules returns a byte array containing a generated go.mod matching Apptainer modules in use in order to compile/load the plugin with same version of dependencies.
Types ¶
type GoMod ¶
GoMod describes a parsed go.mod file.
func GetModules ¶
GetModules parses the go.mod file found in directory and returns a GoMod instance.
func (GoMod) GetExclude ¶
GetExclude returns the exclude record for the provided module path.
func (GoMod) GetReplace ¶
GetReplace returns the replace record for the provided module path.
func (GoMod) GetRequire ¶
GetRequire returns the require record for the provided module path.
type Meta ¶
type Meta struct { // Name is the name of the plugin. Name string // Enabled reports whether or not the plugin should be loaded. Enabled bool // Callbacks contains callbacks name registered by the plugin. Callbacks []string }
Meta is an internal representation of a plugin binary and all of its artifacts. This represents the on-disk location of the SIF, shared library, config file, etc... This struct is written as JSON into the rootDir directory.