plugins

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2024 License: MIT Imports: 4 Imported by: 7

README

Plugins

External Plugins

See listing here.

Importers

Processors

Exporters

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metadata added in v1.1.0

type Metadata struct {
	Name         string
	Description  string
	Deprecated   bool
	SampleConfig string
}

Metadata returns fields relevant to identification and description of plugins.

type Plugin added in v1.2.0

type Plugin interface {
	// Metadata associated with the plugin.
	Metadata() Metadata

	// Init will be called during initialization, before block data starts going through the pipeline.
	// Typically this is used for things like initializing network connections.
	// The Context passed to Init() will be used for deadlines, cancelling signals and other early terminations.
	// The InitProvider passed to Init() will be used to determine the initial next round for consideration.
	// The Config passed to Init() will contain the unmarshalled config file specific to this plugin.
	// If any of these fail an error is returned --this will result in the Conduit process terminating.
	Init(ctx context.Context, initProvider data.InitProvider, cfg PluginConfig, logger *logrus.Logger) error

	// Close will be called during termination of the Conduit process.
	// There is no guarantee that plugin lifecycle hooks will be invoked in any specific order in relation to one another.
	// Returns an error if it fails which will be surfaced in the logs, but the process is already terminating.
	Close() error
}

Plugin is the common interface for all Conduit plugins.

type PluginConfig

type PluginConfig struct {
	// DataDir available to this plugin.
	DataDir string
	// Config specific to this plugin.
	Config string
}

PluginConfig is a generic string which can be deserialized by each individual Plugin

func MakePluginConfig

func MakePluginConfig(config string) PluginConfig

MakePluginConfig is a helper to create the struct.

func (PluginConfig) UnmarshalConfig

func (pc PluginConfig) UnmarshalConfig(config interface{}) error

UnmarshalConfig attempts to Unmarshal the plugin config into an object.

type PluginType

type PluginType string

PluginType is defined for each plugin category

const (
	// Exporter PluginType
	Exporter PluginType = "exporter"

	// Processor PluginType
	Processor PluginType = "processor"

	// Importer PluginType
	Importer PluginType = "importer"
)

Jump to

Keyboard shortcuts

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