Documentation
¶
Index ¶
- type Plugin
- func (p *Plugin) CapBrokenError() error
- func (p *Plugin) Fields() []sdk.FieldEntry
- func (p *Plugin) HasCapBroken() bool
- func (p *Plugin) HasCapExtraction() bool
- func (p *Plugin) HasCapSourcing() bool
- func (p *Plugin) Info() *plugins.Info
- func (p *Plugin) Init(config string) error
- func (p *Plugin) InitSchema() *sdk.SchemaInfo
- func (p *Plugin) OpenParams() ([]sdk.OpenParam, error)
- func (p *Plugin) Unload()
- func (p *Plugin) Validate() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
Plugin represents a Falcosecurity Plugin loaded from an external shared dynamic library
func NewPlugin ¶
NewPlugin loads a Falcosecurity plugin from the dynamic library present in the local filesystem at the given path. If successful, returns a *loader.Plugin representing the loaded plugin and a nil error. Otherwise, returns a non-nil error containing the failure condition.
Although this reads the content of the dynamic library, this does not check that the returned Plugin is valid and complies to the currently supported plugin API version. This does not initialize the plugin either. For those purposes, refer to the Validate() and Init() functions of the returned *loader.Plugin.
Separating the loading step from the validation one allows developers to open plugins that are either corrupted or developed towards an older API version. This can be useful to inspect static descriptive data of those plugins too, such as the name or the version.
func NewValidPlugin ¶
NewValidPlugin is the same as NewPlugin(), but returns an error if the loaded plugin is not valid. It is equivalent to invoking NewPlugin() and Plugin.Validate() in sequence.
func (*Plugin) CapBrokenError ¶ added in v0.7.0
CapBrokenError returns a non-nil error if HasCapBroken returns true.
func (*Plugin) Fields ¶
func (p *Plugin) Fields() []sdk.FieldEntry
Fields return the list of extractor fields exported by this plugin. If the plugin does not support the field extraction capability, this returns an empty list.
func (*Plugin) HasCapBroken ¶ added in v0.7.0
HasCapBroken returns true if the plugin has any of its capabilities broken.
func (*Plugin) HasCapExtraction ¶
HasCapExtraction returns true if the plugin supports the field extraction capability.
func (*Plugin) HasCapSourcing ¶
HasCapSourcing returns true if the plugin supports the event sourcing capability.
func (*Plugin) Info ¶
Info returns a pointer to a Info struct, containing all the general information about this plugin. Can return nil if info are not available.
func (*Plugin) Init ¶
Init initializes this plugin with a given config string. A successful call to init returns a nil error.
If the plugin supports an init config schema (e.g. Plugin.InitSchema returns a non-nil value), the config string is validated with the schema and a non-nil error is returned for validation failures.
The plugin get validated before getting initialized, and a non-nil error is returned in case of validation errors. Invoking Init() multiple times on the same plugin returns an error.
Once initalized, the plugin gets destroyed when calling Unload().
func (*Plugin) InitSchema ¶
func (p *Plugin) InitSchema() *sdk.SchemaInfo
InitSchema implements the sdk.InitSchema interface. Returns a schema describing the data expected to be passed as a configuration during the plugin initialization. Can return nil if the schema is not available.
func (*Plugin) OpenParams ¶
OpenParams implements the sdk.OpenParams interface. Returns a list of suggested open parameters. Returns a non-nil error in one of the following conditions:
- Plugin is not initialized
- Plugin does not support the event sourcing capability