loader

package
v0.8.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 9, 2025 License: Apache-2.0 Imports: 9 Imported by: 2

Documentation

Index

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

func NewPlugin(path string) (*Plugin, error)

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

func NewValidPlugin(path string) (*Plugin, error)

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

func (p *Plugin) CapBrokenError() error

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

func (p *Plugin) HasCapBroken() bool

HasCapBroken returns true if the plugin has any of its capabilities broken.

func (*Plugin) HasCapExtraction

func (p *Plugin) HasCapExtraction() bool

HasCapExtraction returns true if the plugin supports the field extraction capability.

func (*Plugin) HasCapSourcing

func (p *Plugin) HasCapSourcing() bool

HasCapSourcing returns true if the plugin supports the event sourcing capability.

func (*Plugin) Info

func (p *Plugin) Info() *plugins.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

func (p *Plugin) Init(config string) error

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

func (p *Plugin) OpenParams() ([]sdk.OpenParam, error)

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

func (*Plugin) Unload

func (p *Plugin) Unload()

Unload unloads a Plugin and disposes it allocated resources. If the plugin was initialized, this invokes the plugin_destroy symbol.

The behavior of Unload() an already-unloaded Plugins is undefined.

func (*Plugin) Validate

func (p *Plugin) Validate() error

Validates returns nil if the Plugin is well-formed and compatible with the plugin API version supported by the loader. Otherwise, returns an error describing what makes the plugin invalid.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL