Merge pull request #786 from unpoller/upgrade-unifi

Upgrade Major Versions of Dependencies
This commit is contained in:
Cody Lee 2024-12-31 15:07:32 -06:00 committed by GitHub
commit 7e3484f80e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
50 changed files with 195 additions and 150 deletions

View File

@ -48,4 +48,4 @@ jobs:
uses: golangci/golangci-lint-action@v6
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.60
version: v1.62

3
.gitignore vendored
View File

@ -38,4 +38,5 @@ github_deploy_key*
/before-remove-rendered.sh
/gpg.signing.key
dist/
.vscode/
.vscode/
.idea/

50
go.mod
View File

@ -2,56 +2,52 @@ module github.com/unpoller/unpoller
go 1.23
toolchain go1.23.1
toolchain go1.23.4
require (
github.com/DataDog/datadog-go v4.8.3+incompatible
github.com/DataDog/datadog-go/v5 v5.6.0
github.com/gorilla/mux v1.8.1
github.com/influxdata/influxdb1-client v0.0.0-20200827194710-b269163b24ab
github.com/influxdata/influxdb1-client v0.0.0-20220302092344-a9ab5670611c
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.20.5
github.com/prometheus/common v0.61.0
github.com/spf13/pflag v1.0.6-0.20201009195203-85dd5c8bc61c
github.com/stretchr/testify v1.10.0
github.com/unpoller/unifi/v5 v5.0.4
golang.org/x/crypto v0.31.0
golang.org/x/net v0.33.0
golang.org/x/term v0.27.0
golift.io/cnfg v0.2.3
golift.io/cnfgfile v0.0.0-20230531075023-f880041cc0a0
golift.io/cnfgfile v0.0.0-20240713024420-a5436d84eb48
golift.io/version v0.0.2
)
require (
github.com/klauspost/compress v1.17.9 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
)
require (
github.com/Microsoft/go-winio v0.6.0 // indirect
github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect
github.com/brianvoe/gofakeit/v6 v6.28.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/google/uuid v1.3.1 // indirect
github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/oapi-codegen/runtime v1.0.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/unpoller/unifi v0.4.3
golang.org/x/mod v0.7.0 // indirect
golang.org/x/tools v0.3.0 // indirect
gopkg.in/yaml.v3 v3.0.1
)
require github.com/unpoller/unifi v0.4.3 // indirect
require (
github.com/BurntSushi/toml v1.3.2 // indirect
github.com/BurntSushi/toml v1.4.0 // indirect
github.com/Microsoft/go-winio v0.6.0 // indirect
github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/brianvoe/gofakeit/v6 v6.28.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/influxdata/influxdb-client-go/v2 v2.14.0
github.com/influxdata/line-protocol v0.0.0-20210922203350-b1ad95c89adf // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/oapi-codegen/runtime v1.1.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
golang.org/x/mod v0.7.0 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/tools v0.3.0 // indirect
google.golang.org/protobuf v1.35.2 // indirect
)
// for local iterative development only
// replace github.com/unpoller/unifi => ../unifi
// replace github.com/unpoller/unifi/v5 => ../unifi

65
go.sum
View File

@ -1,7 +1,8 @@
github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8=
github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
github.com/DataDog/datadog-go v4.8.3+incompatible h1:fNGaYSuObuQb5nzeTQqowRAd9bpDIRRV4/gUtIBjh8Q=
github.com/DataDog/datadog-go v4.8.3+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0=
github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/DataDog/datadog-go/v5 v5.6.0 h1:2oCLxjF/4htd55piM75baflj/KoE6VYS7alEUqFvRDw=
github.com/DataDog/datadog-go/v5 v5.6.0/go.mod h1:K9kcYBlxkcPP8tvvjZZKs/m1edNAUFzBbdpTUKfCsuw=
github.com/Microsoft/go-winio v0.5.0/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84=
github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg=
github.com/Microsoft/go-winio v0.6.0/go.mod h1:cTAf44im0RAYeL23bpB+fzCyDH2MJiz2BO69KH/soAE=
github.com/RaveNoX/go-jsoncommentstrip v1.0.0/go.mod h1:78ihd09MekBnJnxpICcwzCMzGrKSKYe4AqU6PDYYpjk=
@ -18,18 +19,19 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4=
github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY=
github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ=
github.com/influxdata/influxdb-client-go/v2 v2.14.0 h1:AjbBfJuq+QoaXNcrova8smSjwJdUHnwvfjMF71M1iI4=
github.com/influxdata/influxdb-client-go/v2 v2.14.0/go.mod h1:Ahpm3QXKMJslpXl3IftVLVezreAUtBOTZssDrjZEFHI=
github.com/influxdata/influxdb1-client v0.0.0-20200827194710-b269163b24ab h1:HqW4xhhynfjrtEiiSGcQUd6vrK23iMam1FO8rI7mwig=
github.com/influxdata/influxdb1-client v0.0.0-20200827194710-b269163b24ab/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo=
github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839 h1:W9WBk7wlPfJLvMCdtV4zPulc4uCPrlywQOmbFOhgQNU=
github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo=
github.com/influxdata/influxdb1-client v0.0.0-20220302092344-a9ab5670611c h1:qSHzRbhzK8RdXOsAdfDgO49TtqC1oZ+acxPrkfTxcCs=
github.com/influxdata/influxdb1-client v0.0.0-20220302092344-a9ab5670611c/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo=
github.com/influxdata/line-protocol v0.0.0-20210922203350-b1ad95c89adf h1:7JTmneyiNEwVBOHSjoMxiWAqB992atOeepeFYegn5RU=
github.com/influxdata/line-protocol v0.0.0-20210922203350-b1ad95c89adf/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo=
github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d/go.mod h1:2PavIy+JPciBPrBUjwbNvtwB6RQlve+hkpll6QSNmOE=
github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA=
github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
@ -41,8 +43,8 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/oapi-codegen/runtime v1.0.0 h1:P4rqFX5fMFWqRzY9M/3YF9+aPSPPB06IzP2P7oOxrWo=
github.com/oapi-codegen/runtime v1.0.0/go.mod h1:LmCUMQuPB4M/nLXilQXhHw+BLZdDb18B34OO356yJ/A=
github.com/oapi-codegen/runtime v1.1.1 h1:EXLHh0DXIJnWhdRPN2w4MXAzFyE4CskzhNLUmtpMYro=
github.com/oapi-codegen/runtime v1.1.1/go.mod h1:SK9X900oXmPWilYR5/WKPzt3Kqxn/uS/+lbpREv+eCg=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
@ -57,35 +59,69 @@ github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0leargg
github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/spf13/pflag v1.0.6-0.20201009195203-85dd5c8bc61c h1:zqmyTlQyufRC65JnImJ6H1Sf7BDj8bG31EV919NVEQc=
github.com/spf13/pflag v1.0.6-0.20201009195203-85dd5c8bc61c/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spkg/bom v0.0.0-20160624110644-59b7046e48ad/go.mod h1:qLr4V1qq6nMqFKkMo8ZTx3f+BZEkzsRUY10Xsm2mwU0=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/unpoller/unifi v0.4.3 h1:MyX27nf/Nq9a+p/o5qIjNJDJSS+jvxGC7BbxDk09BRg=
github.com/unpoller/unifi v0.4.3/go.mod h1:TWzPB/1SVbvoweS3RcknQj3Ds+MclHzGGE2weqI+vO0=
github.com/unpoller/unifi/v5 v5.0.4 h1:JkmNgEyAGc6Oy6siWC8nwBiu08uLB4I5dz54jRmwLOY=
github.com/unpoller/unifi/v5 v5.0.4/go.mod h1:G45KRuSH9PFrIUFmDTzWEEM/E/e7GuyXp36AVOfhm7I=
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U=
golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.7.0 h1:LapD9S96VoQRhi/GrNTqeBJFrUjs5UHCAtTlgwA5oZA=
golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I=
golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q=
golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.3.0 h1:SrNbZl6ECOS1qFzgTdQfWXZM9XBkiA6tkFrH9YSTPHM=
golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golift.io/cnfg v0.2.3 h1:cQsC4JS20njJyu5drtGefNmgN7M4HrLaRDNBPLit3pQ=
golift.io/cnfg v0.2.3/go.mod h1:T4t8MFa8aZilCdIk1qQrN4mOGaFVPZ/qHQBBMbCIZJ0=
golift.io/cnfgfile v0.0.0-20230531075023-f880041cc0a0 h1:u14MTHfTGx7kLX2b3wFbaESrIm3YqL//HM92XA6wzH4=
golift.io/cnfgfile v0.0.0-20230531075023-f880041cc0a0/go.mod h1:dVC3N+72/nHNlBv3cwXb4FQTxMAor+JlNClAldwACkY=
golift.io/cnfgfile v0.0.0-20240713024420-a5436d84eb48 h1:c7cJWRr0cUnFHKtq072esKzhQHKlFA5YRY/hPzQrdko=
golift.io/cnfgfile v0.0.0-20240713024420-a5436d84eb48/go.mod h1:zHm9o8SkZ6Mm5DfGahsrEJPsogyR0qItP59s5lJ98/I=
golift.io/version v0.0.2 h1:i0gXRuSDHKs4O0sVDUg4+vNIuOxYoXhaxspftu2FRTE=
golift.io/version v0.0.2/go.mod h1:76aHNz8/Pm7CbuxIsDi97jABL5Zui3f2uZxDm4vB6hU=
google.golang.org/protobuf v1.35.2 h1:8Ar7bF+apOIoThw1EdZl0p1oWvMqTHmpA2fRTyZO8io=
@ -93,5 +129,6 @@ google.golang.org/protobuf v1.35.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojt
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

View File

@ -5,7 +5,7 @@ import (
"strconv"
"time"
"github.com/unpoller/unifi"
"github.com/unpoller/unifi/v5"
)
const (

View File

@ -1,7 +1,7 @@
package datadogunifi
import (
"github.com/unpoller/unifi"
"github.com/unpoller/unifi/v5"
)
// batchClient generates Unifi Client datapoints for Datadog.
@ -37,12 +37,12 @@ func (u *DatadogUnifi) batchClient(r report, s *unifi.Client) { // nolint: funle
"bssid": s.Bssid,
"ip": s.IP,
}
powerSaveEnabled := 0.0
if s.PowersaveEnabled.Val {
powerSaveEnabled = 1.0
}
data := map[string]float64{
"anomalies": s.Anomalies.Val,
"channel": s.Channel.Val,

View File

@ -7,8 +7,8 @@ import (
"reflect"
"time"
"github.com/DataDog/datadog-go/statsd"
"github.com/unpoller/unifi"
"github.com/DataDog/datadog-go/v5/statsd"
"github.com/unpoller/unifi/v5"
"github.com/unpoller/unpoller/pkg/poller"
"golift.io/cnfg"
)
@ -58,11 +58,6 @@ type Config struct {
// BufferFlushInterval is the interval after which the current buffer will get flushed.
BufferFlushInterval *cnfg.Duration `json:"buffer_flush_interval" toml:"buffer_flush_interval" xml:"buffer_flush_interval,attr" yaml:"buffer_flush_interval"`
// BufferShardCount is the number of buffer "shards" that will be used.
// Those shards allows the use of multiple buffers at the same time to reduce
// lock contention.
BufferShardCount *int `json:"buffer_shard_count" toml:"buffer_shard_count" xml:"buffer_shard_count,attr" yaml:"buffer_shard_count"`
// SenderQueueSize is the size of the sender queue in number of buffers.
// The magic value 0 will set the option to the optimal size for the transport
// protocol used when creating the client: 2048 for UDP and 512 for UDS.
@ -71,27 +66,6 @@ type Config struct {
// WriteTimeoutUDS is the timeout after which a UDS packet is dropped.
WriteTimeoutUDS *cnfg.Duration `json:"write_timeout_uds" toml:"write_timeout_uds" xml:"write_timeout_uds,attr" yaml:"write_timeout_uds"`
// ReceiveMode determines the behavior of the client when receiving to many
// metrics. The client will either drop the metrics if its buffers are
// full (ChannelMode mode) or block the caller until the metric can be
// handled (MutexMode mode). By default the client will MutexMode. This
// option should be set to ChannelMode only when use under very high
// load.
//
// MutexMode uses a mutex internally which is much faster than
// channel but causes some lock contention when used with a high number
// of threads. Mutex are sharded based on the metrics name which
// limit mutex contention when goroutines send different metrics.
//
// ChannelMode: uses channel (of ChannelModeBufferSize size) to send
// metrics and drop metrics if the channel is full. Sending metrics in
// this mode is slower that MutexMode (because of the channel), but
// will not block the application. This mode is made for application
// using many goroutines, sending the same metrics at a very high
// volume. The goal is to not slow down the application at the cost of
// dropping metrics and having a lower max throughput.
ReceiveMode *statsd.ReceivingMode `json:"receive_mode" toml:"receive_mode" xml:"receive_mode,attr" yaml:"receive_mode"`
// ChannelModeBufferSize is the size of the channel holding incoming metrics
ChannelModeBufferSize *int `json:"channel_mode_buffer_size" toml:"channel_mode_buffer_size" xml:"channel_mode_buffer_size,attr" yaml:"channel_mode_buffer_size"`
@ -160,25 +134,12 @@ func (u *DatadogUnifi) setConfigDefaults() {
u.options = append(u.options, statsd.WithBufferFlushInterval((*u.BufferFlushInterval).Duration))
}
if u.BufferShardCount != nil {
u.options = append(u.options, statsd.WithBufferShardCount(*u.BufferShardCount))
}
if u.SenderQueueSize != nil {
u.options = append(u.options, statsd.WithSenderQueueSize(*u.SenderQueueSize))
}
if u.WriteTimeoutUDS != nil {
u.options = append(u.options, statsd.WithWriteTimeoutUDS((*u.WriteTimeoutUDS).Duration))
}
if u.ReceiveMode != nil {
switch *u.ReceiveMode {
case statsd.ChannelMode:
u.options = append(u.options, statsd.WithChannelMode())
case statsd.MutexMode:
u.options = append(u.options, statsd.WithMutexMode())
}
u.options = append(u.options, statsd.WithWriteTimeout((*u.WriteTimeoutUDS).Duration))
}
if u.ChannelModeBufferSize != nil {

View File

@ -5,7 +5,7 @@ import (
"strconv"
"time"
"github.com/unpoller/unifi"
"github.com/unpoller/unifi/v5"
)
// These constants are used as names for printed/logged counters.
@ -21,8 +21,8 @@ func (u *DatadogUnifi) batchIDs(r report, i *unifi.IDS) { // nolint:dupl
}
tagMap := map[string]string{
"dest_port": strconv.Itoa(i.DestPort),
"src_port": strconv.Itoa(i.SrcPort),
"dest_port": strconv.Itoa(i.DestPort.Int()),
"src_port": strconv.Itoa(i.SrcPort.Int()),
"dest_ip": i.DestIP,
"dst_mac": i.DstMAC,
"host": i.Host,

View File

@ -6,7 +6,7 @@ import (
"testing"
"time"
"github.com/DataDog/datadog-go/statsd"
"github.com/DataDog/datadog-go/v5/statsd"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/unpoller/unpoller/pkg/datadogunifi"
@ -34,6 +34,56 @@ type mockStatsd struct {
checks []string
}
// GaugeWithTimestamp mock interface
// nolint:all
func (m *mockStatsd) GaugeWithTimestamp(name string, value float64, tags []string, rate float64, timestamp time.Time) error {
// not supported
return nil
}
// CountWithTimestamp mock interface
// nolint:all
func (m *mockStatsd) CountWithTimestamp(name string, value int64, tags []string, rate float64, timestamp time.Time) error {
// not supported
return nil
}
// IsClosed mock interface
// nolint:all
func (m *mockStatsd) IsClosed() bool {
return false
}
// HistogramWithTimestamp mock interface
// nolint:all
func (m *mockStatsd) HistogramWithTimestamp(name string, value float64, tags []string, rate float64, timestamp time.Time) error {
return nil
}
// DistributionWithTimestamp mock interface
// nolint:all
func (m *mockStatsd) DistributionWithTimestamp(name string, value float64, tags []string, rate float64, timestamp time.Time) error {
return nil
}
// SetWithTimestamp mock interface
// nolint:all
func (m *mockStatsd) SetWithTimestamp(name string, value float64, tags []string, rate float64, timestamp time.Time) error {
return nil
}
// TimingWithTimestamp mock interface
// nolint:all
func (m *mockStatsd) TimingWithTimestamp(name string, value int64, tags []string, rate float64) error {
return nil
}
// GetTelemetry mock interface
// nolint:all
func (m *mockStatsd) GetTelemetry() statsd.Telemetry {
return statsd.Telemetry{}
}
// Gauge measures the value of a metric at a particular time.
func (m *mockStatsd) Gauge(name string, value float64, tags []string, _ float64) error {
m.Lock()

View File

@ -1,7 +1,7 @@
package datadogunifi
import (
"github.com/unpoller/unifi"
"github.com/unpoller/unifi/v5"
)
// pduT is used as a name for printed/logged counters.
@ -45,9 +45,9 @@ func (u *DatadogUnifi) batchPDU(r report, s *unifi.PDU) {
"user_num_sta": s.UserNumSta.Val,
"upgradeable": boolToFloat64(s.Upgradeable.Val),
})
r.addCount(pduT)
metricName := metricNamespace("pdu")
reportGaugeForFloat64Map(r, metricName, data, tags)

View File

@ -4,7 +4,7 @@ import (
"sync"
"time"
"github.com/DataDog/datadog-go/statsd"
"github.com/DataDog/datadog-go/v5/statsd"
"github.com/unpoller/unpoller/pkg/poller"
)
@ -111,7 +111,7 @@ func (r *Report) reportEvent(title string, date time.Time, message string, tags
if date.IsZero() {
date = time.Now()
}
return r.client.Event(&statsd.Event{
Title: title,
Text: message,

View File

@ -1,7 +1,7 @@
package datadogunifi
import (
"github.com/unpoller/unifi"
"github.com/unpoller/unifi/v5"
)
// reportSite generates Unifi Sites' datapoints for Datadog.

View File

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

View File

@ -4,7 +4,7 @@ import (
"regexp"
"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 datadogunifi
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 datadogunifi
import (
"github.com/unpoller/unifi"
"github.com/unpoller/unifi/v5"
)
// uswT is used as a name for printed/logged counters.
@ -43,9 +43,9 @@ func (u *DatadogUnifi) batchUSW(r report, s *unifi.USW) {
})
r.addCount(uswT)
metricName := metricNamespace("usw")
reportGaugeForFloat64Map(r, metricName, data, tags)
u.batchPortTable(r, tags, s.PortTable)

View File

@ -1,7 +1,7 @@
package datadogunifi
import (
"github.com/unpoller/unifi"
"github.com/unpoller/unifi/v5"
)
// uxgT is used as a name for printed/logged counters.
@ -26,17 +26,17 @@ func (u *DatadogUnifi) batchUXG(r report, s *unifi.UXG) { // nolint: funlen
"ip": s.IP,
"license_state": s.LicenseState,
})
var gw *unifi.Gw
if s.Stat != nil {
gw = s.Stat.Gw
}
var sw *unifi.Sw
if s.Stat != nil {
sw = s.Stat.Sw
}
data := CombineFloat64(
u.batchUDMstorage(s.Storage),
u.batchUDMtemps(s.Temperatures),

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

@ -507,7 +507,7 @@ points:
- usgip
fields:
dest_ip: string
dest_port: int
dest_port: string
dst_mac: string
dstip_asn: int
dstip_city: string
@ -521,7 +521,7 @@ points:
msg: string
src_ip: string
src_mac: string
src_port: int
src_port: string
srcip_asn: int
srcip_city: string
srcip_continent_code: string

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),

View File

@ -4,7 +4,7 @@ import (
"fmt"
"time"
"github.com/unpoller/unifi"
"github.com/unpoller/unifi/v5"
"github.com/unpoller/unpoller/pkg/webserver"
)

View File

@ -7,7 +7,7 @@ import (
"strings"
"time"
"github.com/unpoller/unifi"
"github.com/unpoller/unifi/v5"
"github.com/unpoller/unpoller/pkg/poller"
)

View File

@ -9,7 +9,7 @@ import (
"sync"
"time"
"github.com/unpoller/unifi"
"github.com/unpoller/unifi/v5"
"github.com/unpoller/unpoller/pkg/poller"
)

View File

@ -6,7 +6,7 @@ import (
"fmt"
"strings"
"github.com/unpoller/unifi"
"github.com/unpoller/unifi/v5"
"github.com/unpoller/unpoller/pkg/poller"
"github.com/unpoller/unpoller/pkg/webserver"
)

View File

@ -5,7 +5,7 @@ import (
"strconv"
"time"
"github.com/unpoller/unifi"
"github.com/unpoller/unifi/v5"
"github.com/unpoller/unpoller/pkg/webserver"
)

View File

@ -5,7 +5,7 @@ import (
"strings"
"time"
"github.com/unpoller/unifi"
"github.com/unpoller/unifi/v5"
"github.com/unpoller/unpoller/pkg/poller"
)

View File

@ -3,7 +3,7 @@ package lokiunifi
import (
"strconv"
"github.com/unpoller/unifi"
"github.com/unpoller/unifi/v5"
)
const typeAlarm = "Alarm"

View File

@ -3,7 +3,7 @@ package lokiunifi
import (
"strconv"
"github.com/unpoller/unifi"
"github.com/unpoller/unifi/v5"
)
const typeAnomaly = "Anomaly"

View File

@ -3,7 +3,7 @@ package lokiunifi
import (
"strconv"
"github.com/unpoller/unifi"
"github.com/unpoller/unifi/v5"
)
const typeEvent = "Event"

View File

@ -3,7 +3,7 @@ package lokiunifi
import (
"strconv"
"github.com/unpoller/unifi"
"github.com/unpoller/unifi/v5"
)
const typeIDs = "IDs"

View File

@ -2,7 +2,7 @@ package promunifi
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/unpoller/unifi"
"github.com/unpoller/unifi/v5"
)
type uclient struct {

View File

@ -14,7 +14,7 @@ import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
promver "github.com/prometheus/common/version"
"github.com/unpoller/unifi"
"github.com/unpoller/unifi/v5"
"github.com/unpoller/unpoller/pkg/poller"
"github.com/unpoller/unpoller/pkg/webserver"
"golift.io/version"

View File

@ -2,7 +2,7 @@ package promunifi
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/unpoller/unifi"
"github.com/unpoller/unifi/v5"
)
type pdu struct {

View File

@ -2,7 +2,7 @@ package promunifi
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/unpoller/unifi"
"github.com/unpoller/unifi/v5"
)
type site struct {
@ -79,7 +79,7 @@ func (u *promUnifi) exportSiteDPI(r report, v any) {
s, ok := v.(*unifi.DPITable)
if !ok {
u.LogErrorf("invalid type given to SiteDPI: %T", v)
return
}

View File

@ -2,7 +2,7 @@ package promunifi
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/unpoller/unifi"
"github.com/unpoller/unifi/v5"
)
type uap struct {

View File

@ -2,7 +2,7 @@ package promunifi
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/unpoller/unifi"
"github.com/unpoller/unifi/v5"
)
// These are shared by all four device types: UDM, UAP, USG, USW.

View File

@ -4,7 +4,7 @@ import (
"strings"
"github.com/prometheus/client_golang/prometheus"
"github.com/unpoller/unifi"
"github.com/unpoller/unifi/v5"
)
type usg struct {

View File

@ -2,7 +2,7 @@ package promunifi
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/unpoller/unifi"
"github.com/unpoller/unifi/v5"
)
type usw struct {

View File

@ -1,7 +1,7 @@
package promunifi
import (
"github.com/unpoller/unifi"
"github.com/unpoller/unifi/v5"
)
// exportUXG is a collection of stats from USG and USW. It has no unique stats.

View File

@ -3,7 +3,7 @@ package unittest
import (
"testing"
"github.com/unpoller/unifi/mocks"
"github.com/unpoller/unifi/v5/mocks"
"github.com/unpoller/unpoller/pkg/inputunifi"
"github.com/unpoller/unpoller/pkg/poller"
)

View File

@ -76,7 +76,7 @@ func (e Events) Groups(prefix string) (groups []string) {
}
// add adds a new event and makes sure the slice is not too big.
func (e *EventGroup) add(event *Event, max int) {
func (e *EventGroup) add(event *Event, maxValue int) {
if !e.Latest.Before(event.Ts) {
return // Ignore older events.
}
@ -84,7 +84,7 @@ func (e *EventGroup) add(event *Event, max int) {
e.Latest = event.Ts
e.Events = append(e.Events, event)
if i := len(e.Events) - max; i > 0 {
if i := len(e.Events) - maxValue; i > 0 {
e.Events = e.Events[i:]
}
}