Switch plugin API to use an accumulator

This commit is contained in:
Evan Phoenix
2015-04-06 09:32:10 -07:00
parent f9250e8e39
commit d1cc82653a
12 changed files with 295 additions and 184 deletions

17
accumulator.go Normal file
View File

@@ -0,0 +1,17 @@
package tivan
import "github.com/influxdb/influxdb/client"
type BatchPoints struct {
client.BatchPoints
}
func (bp *BatchPoints) Add(name string, val interface{}, tags map[string]string) {
bp.Points = append(bp.Points, client.Point{
Name: name,
Tags: tags,
Fields: map[string]interface{}{
"value": val,
},
})
}