Documentation
¶
Overview ¶
Package plugins and its subpackages provide high-level constructs to easily develop plugins, abstracting all the low-level details of the plugin framework. This bundles the main plugin developer tools provided by the SDK. Plugin developers are encouraged to use the constructs of the plugins package for their plugins.
This packages depends on the lower-level prebuilt C symbols implementations of the sdk/symbols package. For some use cases, developers can consider using the the sdk/symbols package to customize their usage of the SDK. This is meaningful only if developers wish to manually write part of the low-level C details of the plugin framework, but still want to use some parts of the SDK. This is discouraged if not for advanced use cases only, and developers are instead encouraged to rely on the plugins package to build their plugins.
Most of the time, a plugin author only needs to import the following packages, which provide the "default" streamlined interfaces to implementing plugins:
"github.com/falcosecurity/plugin-sdk-go/pkg/sdk" "github.com/falcosecurity/plugin-sdk-go/pkg/sdk/plugins" "github.com/falcosecurity/plugin-sdk-go/pkg/sdk/plugins/{source,extractor}"
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetFactory ¶ added in v0.4.0
func SetFactory(f FactoryFunc)
SetFactory sets the FactoryFunc to be used by the SDK when creating a new Plugin
SetFactory should be called in the Go init() function of the plugin main package. It hooks the plugin framework initialization stage to create a new Plugin and to set up common facilities provided by this SDK. The given FactoryFunc must create a Plugin and can optionally enable plugin capabilities by using the Register functions provided by sub-packages. This function is idempotent.
Usage example:
package main import ( "github.com/falcosecurity/plugin-sdk-go/pkg/sdk/plugins" "github.com/falcosecurity/plugin-sdk-go/pkg/sdk/plugins/extractor" "github.com/falcosecurity/plugin-sdk-go/pkg/sdk/plugins/source" ) func init() { plugins.SetFactory(func() plugins.Plugin { p := &MyPlugin{} // create a new Plugin source.Register(p) // enable event sourcing capability extractor.Register(p) // enable field extraction capability return p }) }
Types ¶
type BaseEvents ¶
type BaseEvents struct {
// contains filtered or unexported fields
}
BaseEvents is a base implementation of the sdk.Events interface.
func (*BaseEvents) Events ¶
func (b *BaseEvents) Events() sdk.EventWriters
func (*BaseEvents) SetEvents ¶
func (b *BaseEvents) SetEvents(events sdk.EventWriters)
type BaseExtractRequests ¶
type BaseExtractRequests struct {
// contains filtered or unexported fields
}
BaseExtractRequests is a base implementation of the sdk.ExtractRequests interface.
func (*BaseExtractRequests) ExtractRequests ¶
func (b *BaseExtractRequests) ExtractRequests() sdk.ExtractRequestPool
func (*BaseExtractRequests) SetExtractRequests ¶
func (b *BaseExtractRequests) SetExtractRequests(pool sdk.ExtractRequestPool)
type BaseLastError ¶
type BaseLastError struct {
// contains filtered or unexported fields
}
BaseLastError is a base implementation of the sdk.LastError interface.
func (*BaseLastError) LastError ¶
func (b *BaseLastError) LastError() error
func (*BaseLastError) LastErrorBuffer ¶
func (b *BaseLastError) LastErrorBuffer() sdk.StringBuffer
func (*BaseLastError) SetLastError ¶
func (b *BaseLastError) SetLastError(err error)
type BaseOpenParams ¶
type BaseOpenParams struct {
// contains filtered or unexported fields
}
BaseOpenParams is a base implementation of the sdk.OpenParamsBuffer interface.
func (*BaseOpenParams) OpenParamsBuffer ¶
func (b *BaseOpenParams) OpenParamsBuffer() sdk.StringBuffer
type BasePlugin ¶
type BasePlugin struct { BaseLastError BaseStringer BaseExtractRequests BaseOpenParams }
BasePlugin is a base implementation of the Plugin interface. Developer-defined Plugin implementations should be composed with BasePlugin to have out-of-the-box compliance with all the required interfaces.
type BaseProgress ¶
type BaseProgress struct {
// contains filtered or unexported fields
}
BaseProgress is a base implementation of the sdk.ProgressBuffer interface.
func (*BaseProgress) ProgressBuffer ¶
func (b *BaseProgress) ProgressBuffer() sdk.StringBuffer
type BaseStringer ¶
type BaseStringer struct {
// contains filtered or unexported fields
}
BaseStringer is a base implementation of the sdk.StringerBuffer interface.
func (*BaseStringer) StringerBuffer ¶
func (b *BaseStringer) StringerBuffer() sdk.StringBuffer
type Info ¶
type Info struct { ID uint32 Name string Description string EventSource string Contact string Version string RequiredAPIVersion string ExtractEventSources []string }
Info is a struct containing the general information about a plugin.
type Plugin ¶
type Plugin interface { // (optional): sdk.Destroyer // (optional): sdk.InitSchema sdk.LastError sdk.LastErrorBuffer // // Info returns a pointer to a Info struct, containing // all the general information about this plugin. Info() *Info // // Init initializes this plugin with a given config string. // A successful call to init returns a nil error. Init(config string) error }
Plugin is an interface representing a plugin. Implementations of this interface can optionally implement the sdk.Destroy interface to specify a Destroy method will be called during the plugin deinitialization.
Directories
¶
Path | Synopsis |
---|---|
Package extractor provides high-level constructs to easily build plugins with field extraction capability.
|
Package extractor provides high-level constructs to easily build plugins with field extraction capability. |
Package source provides high-level constructs to easily build plugins with event sourcing capability.
|
Package source provides high-level constructs to easily build plugins with event sourcing capability. |