2015-08-11 20:02:04 +00:00
|
|
|
package outputs
|
|
|
|
|
|
|
|
import (
|
2015-10-16 22:13:32 +00:00
|
|
|
"github.com/influxdb/influxdb/client/v2"
|
2015-08-11 20:02:04 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type Output interface {
|
|
|
|
Connect() error
|
2015-08-12 17:04:25 +00:00
|
|
|
Close() error
|
2015-08-25 23:59:12 +00:00
|
|
|
Description() string
|
|
|
|
SampleConfig() string
|
2015-10-16 22:13:32 +00:00
|
|
|
Write(points []*client.Point) error
|
2015-08-11 20:02:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type Creator func() Output
|
|
|
|
|
|
|
|
var Outputs = map[string]Creator{}
|
|
|
|
|
|
|
|
func Add(name string, creator Creator) {
|
|
|
|
Outputs[name] = creator
|
|
|
|
}
|