Documentation
¶
Overview ¶
Package plugin handles loading and management of check plugins.
Index ¶
- Variables
- type Registry
- func (r *Registry) All() map[string]check.Check
- func (r *Registry) Configs() map[string]map[string]any
- func (r *Registry) Filter(names []string) []check.Check
- func (r *Registry) Get(name string) check.Check
- func (r *Registry) GetConfig(name string) map[string]any
- func (r *Registry) LoadDirectory(dir string) error
- func (r *Registry) LoadPlugin(path string) error
- func (r *Registry) Names() []string
- func (r *Registry) Register(c check.Check)
- func (r *Registry) SetConfig(name string, cfg map[string]any)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNoPluginsDirectory is returned when the plugins directory does not exist. ErrNoPluginsDirectory = errors.New("plugins directory does not exist") // ErrNoPluginsLoaded is returned when no plugins were successfully loaded. ErrNoPluginsLoaded = errors.New("no plugins loaded") )
Functions ¶
This section is empty.
Types ¶
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry holds all loaded plugins.
func NewRegistry ¶
NewRegistry creates a new plugin registry.
func (*Registry) LoadDirectory ¶
LoadDirectory loads all plugins from a directory. Returns ErrNoPluginsDirectory if the directory does not exist.
func (*Registry) LoadPlugin ¶
LoadPlugin loads a single plugin from a .so file.
Click to show internal directories.
Click to hide internal directories.