1 Star 0 Fork 0

sqos/beats

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
runnerfactory.go 989 Bytes
一键复制 编辑 原始数据 按行查看 历史
package prospector
import (
"github.com/elastic/beats/filebeat/channel"
"github.com/elastic/beats/filebeat/registrar"
"github.com/elastic/beats/libbeat/cfgfile"
"github.com/elastic/beats/libbeat/common"
)
// RunnerFactory is a factory for registrars
type RunnerFactory struct {
outlet channel.Factory
registrar *registrar.Registrar
beatDone chan struct{}
}
// NewRunnerFactory instantiates a new RunnerFactory
func NewRunnerFactory(outlet channel.Factory, registrar *registrar.Registrar, beatDone chan struct{}) *RunnerFactory {
return &RunnerFactory{
outlet: outlet,
registrar: registrar,
beatDone: beatDone,
}
}
// Create creates a prospector based on a config
func (r *RunnerFactory) Create(c *common.Config, meta *common.MapStrPointer) (cfgfile.Runner, error) {
p, err := New(c, r.outlet, r.beatDone, r.registrar.GetStates(), meta)
if err != nil {
// In case of error with loading state, prospector is still returned
return p, err
}
return p, nil
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/sqos/beats.git
git@gitee.com:sqos/beats.git
sqos
beats
beats
v6.1.1

搜索帮助