Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Processors = make(map[string]ProcessorConstructor)
Processors are the constructors to build processor plugins.
Functions ¶
func Register ¶
func Register(name string, constructor ProcessorConstructor)
Register is used to register ProcessorConstructor implementations. This mechanism allows for loose coupling between the configuration and the implementation. It is extremely similar to the way sql.DB drivers are configured and used.
Types ¶
type Processor ¶
type Processor interface { // PluginMetadata implement this interface. conduit.PluginMetadata // Config returns the configuration options used to create the Processor. Config() string // Init will be called during initialization, before block data starts going through the pipeline. // Typically, used for things like initializing network connections. // The Context passed to Init() will be used for deadlines, cancel signals and other early terminations // The Config passed to Init() will contain the unmarshalled config file specific to this plugin. Init(ctx context.Context, initProvider data.InitProvider, cfg plugins.PluginConfig, logger *logrus.Logger) error // Close will be called during termination of the Indexer process. Close() error // Process will be called with provided optional inputs. It is up to the plugin to check that required inputs are provided. Process(input data.BlockData) (data.BlockData, error) }
Processor an interface that defines an object that can filter and process transactions
type ProcessorConstructor ¶
type ProcessorConstructor interface { // New should return an instantiation of a Processor. // Configuration values should be passed and can be processed during `Init()`. New() Processor }
ProcessorConstructor must be implemented by each Processor. It provides a basic no-arg constructor for instances of an ProcessorImpl.
func ProcessorBuilderByName ¶
func ProcessorBuilderByName(name string) (ProcessorConstructor, error)
ProcessorBuilderByName returns a Processor constructor for the name provided
type ProcessorConstructorFunc ¶
type ProcessorConstructorFunc func() Processor
ProcessorConstructorFunc is Constructor implementation for processors
func (ProcessorConstructorFunc) New ¶
func (f ProcessorConstructorFunc) New() Processor
New initializes a processor constructor