Use new influx db lib path. Make Points() work with an interface.
This commit is contained in:
parent
a6afe62ff2
commit
483480a4eb
|
|
@ -10,26 +10,16 @@
|
|||
version = "v1.1.1"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:718c57979a9197414a044fff2028e57cb9fe145069e4f507059755bfe87f1bfe"
|
||||
name = "github.com/influxdata/influxdb"
|
||||
packages = [
|
||||
"client/v2",
|
||||
"models",
|
||||
"pkg/escape",
|
||||
]
|
||||
pruneopts = "UT"
|
||||
revision = "698dbc789aff13c2678357a6b93ff73dd7136571"
|
||||
version = "v1.7.3"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:937258f1293bc9295b4789b0abea5b4ec030e3caecb65a4e1dc0b6999957a5ed"
|
||||
name = "github.com/influxdata/platform"
|
||||
branch = "master"
|
||||
digest = "1:50708c8fc92aec981df5c446581cf9f90ba9e2a5692118e0ce75d4534aaa14a2"
|
||||
name = "github.com/influxdata/influxdb1-client"
|
||||
packages = [
|
||||
"models",
|
||||
"pkg/escape",
|
||||
"v2",
|
||||
]
|
||||
pruneopts = "UT"
|
||||
revision = "0f79e4ea3248354c789cba274542e0a8e55971db"
|
||||
revision = "16c852ea613fa2d42fcdccc9a8b0802a8bdc6140"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:cf31692c14422fa27c83a05292eb5cbe0fb2775972e8f1f8446a71549bd8980b"
|
||||
|
|
@ -59,7 +49,7 @@
|
|||
analyzer-name = "dep"
|
||||
analyzer-version = 1
|
||||
input-imports = [
|
||||
"github.com/influxdata/influxdb/client/v2",
|
||||
"github.com/influxdata/influxdb1-client/v2",
|
||||
"github.com/pkg/errors",
|
||||
"github.com/stretchr/testify/assert",
|
||||
]
|
||||
|
|
|
|||
|
|
@ -26,8 +26,8 @@
|
|||
|
||||
|
||||
[[constraint]]
|
||||
name = "github.com/influxdata/influxdb"
|
||||
version = "1.7.3"
|
||||
branch = "master"
|
||||
name = "github.com/influxdata/influxdb1-client"
|
||||
|
||||
[[constraint]]
|
||||
name = "github.com/pkg/errors"
|
||||
|
|
|
|||
|
|
@ -4,12 +4,12 @@ import (
|
|||
"strconv"
|
||||
"time"
|
||||
|
||||
influx "github.com/influxdata/influxdb/client/v2"
|
||||
influx "github.com/influxdata/influxdb1-client/v2"
|
||||
)
|
||||
|
||||
// Points generates Unifi Client datapoints for InfluxDB.
|
||||
// These points can be passed directly to influx.
|
||||
func (c *UCL) Points() ([]*influx.Point, error) {
|
||||
func (c UCL) Points() ([]*influx.Point, error) {
|
||||
var points []*influx.Point
|
||||
// Fix name and hostname fields. Sometimes one or the other is blank.
|
||||
if c.Name == "" && c.Hostname != "" {
|
||||
|
|
|
|||
|
|
@ -4,12 +4,12 @@ import (
|
|||
"strconv"
|
||||
"time"
|
||||
|
||||
influx "github.com/influxdata/influxdb/client/v2"
|
||||
influx "github.com/influxdata/influxdb1-client/v2"
|
||||
)
|
||||
|
||||
// Points generates Wireless-Access-Point datapoints for InfluxDB.
|
||||
// These points can be passed directly to influx.
|
||||
func (u *UAP) Points() ([]*influx.Point, error) {
|
||||
func (u UAP) Points() ([]*influx.Point, error) {
|
||||
/* I generally suck at InfluxDB, so if I got the tags/fields wrong,
|
||||
please send me a PR or open an Issue to address my faults. Thanks!
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ func TestAuthController(t *testing.T) {
|
|||
t.Parallel()
|
||||
a := assert.New(t)
|
||||
url := "http://127.0.0.1:64431"
|
||||
authReq, err := AuthController("user1", "pass2", url, false)
|
||||
authReq, err := GetController("user1", "pass2", url, false)
|
||||
a.NotNil(err)
|
||||
a.EqualValues(url, authReq.baseURL)
|
||||
a.Contains(err.Error(), "authReq.Do(req):", "an invalid destination should product a .Do(req) error.")
|
||||
|
|
|
|||
|
|
@ -4,12 +4,12 @@ import (
|
|||
"strconv"
|
||||
"time"
|
||||
|
||||
influx "github.com/influxdata/influxdb/client/v2"
|
||||
influx "github.com/influxdata/influxdb1-client/v2"
|
||||
)
|
||||
|
||||
// Points generates Unifi Gateway datapoints for InfluxDB.
|
||||
// These points can be passed directly to influx.
|
||||
func (u *USG) Points() ([]*influx.Point, error) {
|
||||
func (u USG) Points() ([]*influx.Point, error) {
|
||||
var points []*influx.Point
|
||||
tags := map[string]string{
|
||||
"id": u.ID,
|
||||
|
|
|
|||
|
|
@ -4,12 +4,12 @@ import (
|
|||
"strconv"
|
||||
"time"
|
||||
|
||||
influx "github.com/influxdata/influxdb/client/v2"
|
||||
influx "github.com/influxdata/influxdb1-client/v2"
|
||||
)
|
||||
|
||||
// Points generates Unifi Switch datapoints for InfluxDB.
|
||||
// These points can be passed directly to influx.
|
||||
func (u *USW) Points() ([]*influx.Point, error) {
|
||||
func (u USW) Points() ([]*influx.Point, error) {
|
||||
var points []*influx.Point
|
||||
tags := map[string]string{
|
||||
"id": u.ID,
|
||||
|
|
|
|||
Loading…
Reference in New Issue