telegraf/registry/processors/registry.go

21 lines
404 B
Go
Raw Normal View History

package processors
2017-02-06 16:45:35 +00:00
import (
"log"
"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/registry"
)
type Creator func() telegraf.Processor
var Processors = map[string]Creator{}
func Add(name string, creator Creator) {
2017-02-06 16:45:35 +00:00
if override := registry.GetName(); override != "" {
name = override
}
log.Println("D! Loading plugin: [[processors." + name + "]]")
Processors[name] = creator
}