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