2015-04-01 16:34:32 +00:00
|
|
|
package plugins
|
|
|
|
|
2015-04-06 16:32:10 +00:00
|
|
|
type Accumulator interface {
|
|
|
|
Add(name string, value interface{}, tags map[string]string)
|
|
|
|
}
|
2015-04-01 16:34:32 +00:00
|
|
|
|
|
|
|
type Plugin interface {
|
2015-05-18 22:10:11 +00:00
|
|
|
SampleConfig() string
|
|
|
|
Description() string
|
2015-04-06 16:32:10 +00:00
|
|
|
Gather(Accumulator) error
|
2015-04-01 16:34:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type Creator func() Plugin
|
|
|
|
|
|
|
|
var Plugins = map[string]Creator{}
|
|
|
|
|
|
|
|
func Add(name string, creator Creator) {
|
|
|
|
Plugins[name] = creator
|
|
|
|
}
|