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