Merge pull request #5992 from influxdata/nc-client-update

Add AddPoints method to v2 client
pull/5990/head
Nathaniel Cook 2016-03-11 12:14:40 -07:00
commit c57e404bfc
1 changed files with 6 additions and 0 deletions

View File

@ -229,6 +229,8 @@ type udpclient struct {
type BatchPoints interface {
// AddPoint adds the given point to the Batch of points
AddPoint(p *Point)
// AddPoints adds the given points to the Batch of points
AddPoints(ps []*Point)
// Points lists the points in the Batch
Points() []*Point
@ -282,6 +284,10 @@ func (bp *batchpoints) AddPoint(p *Point) {
bp.points = append(bp.points, p)
}
func (bp *batchpoints) AddPoints(ps []*Point) {
bp.points = append(bp.points, ps...)
}
func (bp *batchpoints) Points() []*Point {
return bp.points
}