代码拉取完成,页面将自动刷新
package prospector
import (
"github.com/elastic/beats/filebeat/registrar"
"github.com/elastic/beats/libbeat/cfgfile"
"github.com/elastic/beats/libbeat/common"
"github.com/elastic/beats/libbeat/logp"
)
type Factory struct {
outlet Outlet
registrar *registrar.Registrar
beatDone chan struct{}
}
func NewFactory(outlet Outlet, registrar *registrar.Registrar, beatDone chan struct{}) *Factory {
return &Factory{
outlet: outlet,
registrar: registrar,
beatDone: beatDone,
}
}
func (r *Factory) Create(c *common.Config) (cfgfile.Runner, error) {
p, err := NewProspector(c, r.outlet, r.beatDone)
if err != nil {
logp.Err("Error creating prospector: %s", err)
return nil, err
}
err = p.LoadStates(r.registrar.GetStates())
if err != nil {
logp.Err("Error loading states for prospector %v: %v", p.ID(), err)
// In case of error with loading state, prospector is still returne
return p, err
}
return p, nil
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。