Fetch the repository succeeded.
//+build linux,go1.8,cgo
package plugin
import (
"flag"
"strings"
"github.com/elastic/beats/libbeat/logp"
)
type pluginList struct {
paths []string
}
func (p *pluginList) String() string {
return strings.Join(p.paths, ",")
}
func (p *pluginList) Set(v string) error {
for _, path := range p.paths {
if path == v {
logp.Warn("%s is already a registered plugin")
return nil
}
}
p.paths = append(p.paths, v)
return nil
}
var plugins = &pluginList{}
func init() {
flag.Var(plugins, "plugin", "Load additional plugins")
}
func Initialize() error {
if len(plugins.paths) > 0 {
logp.Warn("EXPERIMENTAL: loadable plugin support is experimental")
}
for _, path := range plugins.paths {
logp.Info("loading plugin bundle: %v", path)
if err := LoadPlugins(path); err != nil {
return err
}
}
return nil
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。