Documentation ¶
Overview ¶
工厂模式生产具体的类
Index ¶
- func AddCheck(key string, value reflect.Type)
- func AddFilter(key string, value reflect.Type)
- func AddInput(key string, value reflect.Type)
- func AddOutput(key string, value reflect.Type)
- func Builder() *builder
- type Check
- type CheckFactory
- type Config
- type Data
- type Env
- type Factory
- type Filter
- type FilterFactory
- type Input
- type InputFactory
- type Message
- type Output
- type OutputFactory
- type Plugin
- type PluginType
- type StatusPlugin
- type StatusType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Env ¶
type Env struct {
Type PluginType
}
type FilterFactory ¶
type FilterFactory struct{}
filter插件工厂对象,实现Factory接口
func (*FilterFactory) Create ¶
func (i *FilterFactory) Create(conf Config) Plugin
读取配置,通过反射机制进行对象实例化
type OutputFactory ¶
type OutputFactory struct{}
output插件工厂对象,实现Factory接口
func (*OutputFactory) Create ¶
func (i *OutputFactory) Create(conf Config) Plugin
读取配置,通过反射机制进行对象实例化
type Plugin ¶
type Plugin interface { // 启动插件 Start() // 停止插件 Stop() // 返回插件当前的运行状态 Status() StatusPlugin // 新增初始化方法,在插件工厂返回实例前调用 Init(interface{}) }
接口定义 Check、Input、Filter、Output三类插件接口的定义 插件抽象接口定义
type PluginType ¶
type PluginType uint8
插件类型定义
const ( CheckType PluginType = iota InputType FilterType OutputType )
Click to show internal directories.
Click to hide internal directories.