Пример #1
0
func (e *Engine) pluginInstance(name string) *Instance {
	if ins, ok := e.plugins[name]; ok {
		return ins
	}
	ins := NewInstance(name, e)
	e.plugins[name] = ins

	if f, ok := plugin.EmbeddedPlugins[name]; ok {
		p1 := pipe.NewInProcess()
		p2 := pipe.NewInProcess()
		ins.rp = p1
		ins.wp = p2
		go plugin.New(name, f).RunWithPipe(p2, p1)
		e.embeds = append(e.embeds, ins)
	} else {
		e.pm.Add(process.New("fluxion-"+name, prepareFuncFactory(ins), func(err error) {
			e.log.Criticalf("%s plugin crashed: %v", name, err)
		}))
	}
	return ins
}
Пример #2
0
func main() {
	plugin.New("out-file", out_file.Factory).Run()
}
Пример #3
0
func main() {
	plugin.New("out-forward", out_forward.Factory).Run()
}
Пример #4
0
func main() {
	plugin.New("filter-js", filter_js.Factory).Run()
}
Пример #5
0
func main() {
	plugin.New("out-elasticsearch", out_elasticsearch.Factory).Run()
}
Пример #6
0
func main() {
	plugin.New("in-tail", in_tail.Factory).Run()
}
Пример #7
0
func main() {
	plugin.New("in-forward", in_forward.Factory).Run()
}
Пример #8
0
func main() {
	plugin.New("out-stdout", out_stdout.Factory).Run()
}
Пример #9
0
func main() {
	plugin.New("out-postgres", func() plugin.Plugin {
		return &OutPostgres{}
	}).Run()
}