1 Star 0 Fork 0

zhangjungang/beats

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
plugin.go 661 Bytes
一键复制 编辑 原始数据 按行查看 历史
Steffen Siering 提交于 2017-06-26 04:36 +08:00 . Update libbeat publisher pipeline (#4492)
package codec
import (
"errors"
"fmt"
"github.com/elastic/beats/libbeat/plugin"
)
type codecPlugin struct {
name string
factory Factory
}
var pluginKey = "libbeat.output.codec"
func Plugin(name string, f Factory) map[string][]interface{} {
return plugin.MakePlugin(name, codecPlugin{name, f})
}
func init() {
plugin.MustRegisterLoader(pluginKey, func(ifc interface{}) (err error) {
b, ok := ifc.(codecPlugin)
if !ok {
return errors.New("plugin does not match output codec plugin type")
}
defer func() {
if msg := recover(); msg != nil {
err = fmt.Errorf("%s", msg)
}
}()
RegisterType(b.name, b.factory)
return
})
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhangjungang/beats.git
git@gitee.com:zhangjungang/beats.git
zhangjungang
beats
beats
v6.1.2

搜索帮助