Skip to content

Commit 1e0d140

Browse files
authored
Merge pull request #131 from sansmoraxz/patch-1
nit fixes and pg driver
2 parents 621f918 + dd0521e commit 1e0d140

File tree

5 files changed

+16
-5
lines changed

5 files changed

+16
-5
lines changed

go.mod

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ require (
1818
github.com/hashicorp/raft v1.7.3
1919
github.com/hashicorp/raft-boltdb/v2 v2.3.1
2020
github.com/hashicorp/serf v0.10.2
21+
github.com/jackc/pgx/v5 v5.7.5
2122
github.com/jinzhu/copier v0.4.0
2223
github.com/jmoiron/sqlx v1.4.0
23-
github.com/lib/pq v1.10.9
2424
github.com/panjf2000/ants/v2 v2.11.3
2525
github.com/redis/go-redis/v9 v9.9.0
2626
github.com/rs/xid v1.6.0
@@ -69,6 +69,9 @@ require (
6969
github.com/hashicorp/go-msgpack/v2 v2.1.2 // indirect
7070
github.com/hashicorp/go-multierror v1.1.1 // indirect
7171
github.com/hashicorp/golang-lru v1.0.2 // indirect
72+
github.com/jackc/pgpassfile v1.0.0 // indirect
73+
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
74+
github.com/jackc/puddle/v2 v2.2.2 // indirect
7275
github.com/klauspost/compress v1.17.9 // indirect
7376
github.com/mattn/go-colorable v0.1.12 // indirect
7477
github.com/mattn/go-isatty v0.0.14 // indirect

go.sum

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,14 @@ github.com/hashicorp/raft-boltdb/v2 v2.3.1/go.mod h1:n4S+g43dXF1tqDT+yzcXHhXM6y7
170170
github.com/hashicorp/serf v0.10.2 h1:m5IORhuNSjaxeljg5DeQVDlQyVkhRIjJDimbkCa8aAc=
171171
github.com/hashicorp/serf v0.10.2/go.mod h1:T1CmSGfSeGfnfNy/w0odXQUR1rfECGd2Qdsp84DjOiY=
172172
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
173+
github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
174+
github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
175+
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo=
176+
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM=
177+
github.com/jackc/pgx/v5 v5.7.5 h1:JHGfMnQY+IEtGM63d+NGMjoRpysB2JBwDr5fsngwmJs=
178+
github.com/jackc/pgx/v5 v5.7.5/go.mod h1:aruU7o91Tc2q2cFp5h4uP3f6ztExVpyVv88Xl/8Vl8M=
179+
github.com/jackc/puddle/v2 v2.2.2 h1:PR8nw+E/1w0GLuRFSmiioY6UooMp6KJv0/61nB7icHo=
180+
github.com/jackc/puddle/v2 v2.2.2/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4=
173181
github.com/jinzhu/copier v0.4.0 h1:w3ciUoD19shMCRargcpm0cm91ytaBhDvuRpz1ODO/U8=
174182
github.com/jinzhu/copier v0.4.0/go.mod h1:DfbEm0FYsaqBcKcFuvmOZb218JkPGtvSHsKg8S8hyyg=
175183
github.com/jmoiron/sqlx v1.4.0 h1:1PLqN7S1UYp5t4SrVVnt4nUVNemrDAtxlulVe+Qgm3o=

plugin/auth/http/http.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func (a *Auth) Provides(b byte) bool {
5454
}
5555

5656
func (a *Auth) Init(config any) error {
57-
if _, ok := config.(*Options); config == nil || (!ok && config != nil) {
57+
if _, ok := config.(*Options); !ok || config == nil {
5858
return mqtt.ErrInvalidConfigType
5959
}
6060

plugin/auth/mysql/mysql.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ func (a *Auth) Provides(b byte) bool {
7272
}
7373

7474
func (a *Auth) Init(config any) error {
75-
if _, ok := config.(*Options); config == nil || (!ok && config != nil) {
75+
if _, ok := config.(*Options); !ok || config == nil {
7676
return mqtt.ErrInvalidConfigType
7777
}
7878

plugin/auth/postgresql/postgresql.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
"bytes"
55
"fmt"
66

7+
_ "github.com/jackc/pgx/v5/stdlib"
78
"github.com/jmoiron/sqlx"
8-
_ "github.com/lib/pq"
99
"github.com/wind-c/comqtt/v2/mqtt"
1010
"github.com/wind-c/comqtt/v2/mqtt/hooks/auth"
1111
"github.com/wind-c/comqtt/v2/mqtt/packets"
@@ -72,7 +72,7 @@ func (a *Auth) Provides(b byte) bool {
7272
}
7373

7474
func (a *Auth) Init(config any) error {
75-
if _, ok := config.(*Options); config == nil || (!ok && config != nil) {
75+
if _, ok := config.(*Options); !ok || config == nil {
7676
return mqtt.ErrInvalidConfigType
7777
}
7878

0 commit comments

Comments
 (0)