processor

package
v1.0.13 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Plugin

func Plugin(
	module string,
	factory Factory,
) map[string][]interface{}

func Register

func Register(name string, factory Factory) error

func Validate

func Validate(processor Processor) error

Types

type Factory

type Factory interface {
	// 处理器示例配置
	SampleConfig() string

	// 处理器描述
	Description() string

	// 处理器示例
	Example() Processor

	// 创建实例
	New(config string) (Processor, error)
}

func GetFactory

func GetFactory(name string) (Factory, error)

func NewFactory

func NewFactory(sampleConfig interface{}, description string, example interface{}, factoryFunc FactoryFunc) Factory

func NewFactoryWithProcessor

func NewFactoryWithProcessor(sampleConfig interface{}, description string, p Processor) Factory

type FactoryFunc

type FactoryFunc func(config string) (Processor, error)

type FactoryTemplate

type FactoryTemplate struct {
	// contains filtered or unexported fields
}

func (FactoryTemplate) Description

func (f FactoryTemplate) Description() string

func (FactoryTemplate) Example added in v1.0.4

func (f FactoryTemplate) Example() Processor

func (FactoryTemplate) New

func (f FactoryTemplate) New(config string) (Processor, error)

func (FactoryTemplate) SampleConfig

func (f FactoryTemplate) SampleConfig() string

type NamedFactory

type NamedFactory struct {
	Name    string
	Factory Factory
}

func ListFactory

func ListFactory() []NamedFactory

type Processor

type Processor interface{}

Jump to

Keyboard shortcuts

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