2016-09-08 14:22:10 +00:00
|
|
|
package processors
|
|
|
|
|
2017-02-06 16:45:35 +00:00
|
|
|
import (
|
|
|
|
"log"
|
|
|
|
|
|
|
|
"github.com/influxdata/telegraf"
|
|
|
|
"github.com/influxdata/telegraf/registry"
|
|
|
|
)
|
2016-09-08 14:22:10 +00:00
|
|
|
|
|
|
|
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 + "]]")
|
2016-09-08 14:22:10 +00:00
|
|
|
Processors[name] = creator
|
|
|
|
}
|