painful upgrade for dumb go versioning

This commit is contained in:
Cody Lee
2024-12-31 14:44:10 -06:00
parent b9d668abee
commit b372198840
44 changed files with 63 additions and 73 deletions

View File

@@ -3,7 +3,7 @@ package influxunifi
import (
"time"
"github.com/unpoller/unifi"
"github.com/unpoller/unifi/v5"
)
const (

View File

@@ -1,7 +1,7 @@
package influxunifi
import (
"github.com/unpoller/unifi"
"github.com/unpoller/unifi/v5"
)
// batchClient generates Unifi Client datapoints for InfluxDB.
@@ -33,7 +33,7 @@ func (u *InfluxUnifi) batchClient(r report, s *unifi.Client) { // nolint: funlen
"channel": s.Channel.Txt,
"vlan": s.Vlan.Txt,
}
fields := map[string]any{
"anomalies": s.Anomalies.Int64(),
"ip": s.IP,
@@ -81,7 +81,7 @@ func (u *InfluxUnifi) batchClientDPI(r report, v any, appTotal, catTotal totalsD
s, ok := v.(*unifi.DPITable)
if !ok {
u.LogErrorf("invalid type given to batchClientDPI: %T", v)
return
}

View File

@@ -3,7 +3,7 @@ package influxunifi
import (
"time"
"github.com/unpoller/unifi"
"github.com/unpoller/unifi/v5"
)
// These constants are used as names for printed/logged counters.

View File

@@ -13,7 +13,7 @@ import (
influx "github.com/influxdata/influxdb-client-go/v2"
influxV1 "github.com/influxdata/influxdb1-client/v2"
"github.com/unpoller/unifi"
"github.com/unpoller/unifi/v5"
"github.com/unpoller/unpoller/pkg/poller"
"github.com/unpoller/unpoller/pkg/webserver"
"golang.org/x/net/context"

View File

@@ -1,7 +1,7 @@
package influxunifi
import (
"github.com/unpoller/unifi"
"github.com/unpoller/unifi/v5"
)
// pduT is used as a name for printed/logged counters.

View File

@@ -1,7 +1,7 @@
package influxunifi
import (
"github.com/unpoller/unifi"
"github.com/unpoller/unifi/v5"
)
// batchSite generates Unifi Sites' datapoints for InfluxDB.
@@ -61,7 +61,7 @@ func (u *InfluxUnifi) batchSiteDPI(r report, v any) {
s, ok := v.(*unifi.DPITable)
if !ok {
u.LogErrorf("invalid type given to batchSiteDPI: %T", v)
return
}

View File

@@ -3,7 +3,7 @@ package influxunifi
import (
"strings"
"github.com/unpoller/unifi"
"github.com/unpoller/unifi/v5"
)
// uapT is used as a name for printed/logged counters.

View File

@@ -3,7 +3,7 @@ package influxunifi
import (
"strings"
"github.com/unpoller/unifi"
"github.com/unpoller/unifi/v5"
)
// udmT is used as a name for printed/logged counters.

View File

@@ -1,7 +1,7 @@
package influxunifi
import (
"github.com/unpoller/unifi"
"github.com/unpoller/unifi/v5"
)
// usgT is used as a name for printed/logged counters.

View File

@@ -1,7 +1,7 @@
package influxunifi
import (
"github.com/unpoller/unifi"
"github.com/unpoller/unifi/v5"
)
// uswT is used as a name for printed/logged counters.

View File

@@ -1,7 +1,7 @@
package influxunifi
import (
"github.com/unpoller/unifi"
"github.com/unpoller/unifi/v5"
)
// uxgT is used as a name for printed/logged counters.
@@ -24,7 +24,7 @@ func (u *InfluxUnifi) batchUXG(r report, s *unifi.UXG) { // nolint: funlen
"serial": s.Serial,
"type": s.Type,
}
var gw *unifi.Gw
if s.Stat != nil {
gw = s.Stat.Gw
@@ -34,7 +34,7 @@ func (u *InfluxUnifi) batchUXG(r report, s *unifi.UXG) { // nolint: funlen
if s.Stat != nil {
sw = s.Stat.Sw
}
fields := Combine(
u.batchUDMstorage(s.Storage),
u.batchUDMtemps(s.Temperatures),