telegraf/plugins/registry.go

20 lines
341 B
Go
Raw Normal View History

package plugins
type Accumulator interface {
Add(name string, value interface{}, tags map[string]string)
}
type Plugin interface {
SampleConfig() string
Description() string
Gather(Accumulator) error
}
type Creator func() Plugin
var Plugins = map[string]Creator{}
func Add(name string, creator Creator) {
Plugins[name] = creator
}