20 lines
341 B
Go
20 lines
341 B
Go
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
|
|
}
|