Esempio n. 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
}
Esempio n. 2
0
func main() {
	plugin.New("out-file", out_file.Factory).Run()
}
Esempio n. 3
0
func main() {
	plugin.New("out-forward", out_forward.Factory).Run()
}
Esempio n. 4
0
func main() {
	plugin.New("filter-js", filter_js.Factory).Run()
}
Esempio n. 5
0
func main() {
	plugin.New("out-elasticsearch", out_elasticsearch.Factory).Run()
}
Esempio n. 6
0
func main() {
	plugin.New("in-tail", in_tail.Factory).Run()
}
Esempio n. 7
0
func main() {
	plugin.New("in-forward", in_forward.Factory).Run()
}
Esempio n. 8
0
func main() {
	plugin.New("out-stdout", out_stdout.Factory).Run()
}
Esempio n. 9
0
func main() {
	plugin.New("out-postgres", func() plugin.Plugin {
		return &OutPostgres{}
	}).Run()
}