Update go mod and imports to v2

This commit is contained in:
mochi-co
2022-12-11 11:50:36 +00:00
parent be164fa715
commit 74ed8cd046
41 changed files with 109 additions and 109 deletions

View File

@@ -78,7 +78,7 @@ docker run -p 1883:1883 -p 1882:1882 -p 8080:8080 mochi:latest
Importing Mochi MQTT as a package requires just a few lines of code to get started.
``` go
import (
"github.com/mochi-co/mqtt"
"github.com/mochi-co/mqtt/v2"
)
func main() {

View File

@@ -15,7 +15,7 @@ import (
"github.com/rs/xid"
"github.com/mochi-co/mqtt/packets"
"github.com/mochi-co/mqtt/v2/packets"
)
const (

View File

@@ -11,8 +11,8 @@ import (
"testing"
"time"
"github.com/mochi-co/mqtt/packets"
"github.com/mochi-co/mqtt/system"
"github.com/mochi-co/mqtt/v2/packets"
"github.com/mochi-co/mqtt/v2/system"
"github.com/stretchr/testify/require"
)

View File

@@ -10,9 +10,9 @@ import (
"os/signal"
"syscall"
"github.com/mochi-co/mqtt"
"github.com/mochi-co/mqtt/hooks/auth"
"github.com/mochi-co/mqtt/listeners"
"github.com/mochi-co/mqtt/v2"
"github.com/mochi-co/mqtt/v2/hooks/auth"
"github.com/mochi-co/mqtt/v2/listeners"
)
func main() {

View File

@@ -9,9 +9,9 @@ import (
"os/signal"
"syscall"
"github.com/mochi-co/mqtt"
"github.com/mochi-co/mqtt/hooks/auth"
"github.com/mochi-co/mqtt/listeners"
"github.com/mochi-co/mqtt/v2"
"github.com/mochi-co/mqtt/v2/hooks/auth"
"github.com/mochi-co/mqtt/v2/listeners"
)
func main() {

View File

@@ -10,9 +10,9 @@ import (
"os/signal"
"syscall"
"github.com/mochi-co/mqtt"
"github.com/mochi-co/mqtt/hooks/auth"
"github.com/mochi-co/mqtt/listeners"
"github.com/mochi-co/mqtt/v2"
"github.com/mochi-co/mqtt/v2/hooks/auth"
"github.com/mochi-co/mqtt/v2/listeners"
)
func main() {

View File

@@ -9,10 +9,10 @@ import (
"os/signal"
"syscall"
"github.com/mochi-co/mqtt"
"github.com/mochi-co/mqtt/hooks/auth"
"github.com/mochi-co/mqtt/hooks/debug"
"github.com/mochi-co/mqtt/listeners"
"github.com/mochi-co/mqtt/v2"
"github.com/mochi-co/mqtt/v2/hooks/auth"
"github.com/mochi-co/mqtt/v2/hooks/debug"
"github.com/mochi-co/mqtt/v2/listeners"
"github.com/rs/zerolog"
)

View File

@@ -11,10 +11,10 @@ import (
"syscall"
"time"
"github.com/mochi-co/mqtt"
"github.com/mochi-co/mqtt/hooks/auth"
"github.com/mochi-co/mqtt/listeners"
"github.com/mochi-co/mqtt/packets"
"github.com/mochi-co/mqtt/v2"
"github.com/mochi-co/mqtt/v2/hooks/auth"
"github.com/mochi-co/mqtt/v2/listeners"
"github.com/mochi-co/mqtt/v2/packets"
)
func main() {

View File

@@ -10,9 +10,9 @@ import (
"os/signal"
"syscall"
"github.com/mochi-co/mqtt"
"github.com/mochi-co/mqtt/listeners"
"github.com/mochi-co/mqtt/packets"
"github.com/mochi-co/mqtt/v2"
"github.com/mochi-co/mqtt/v2/listeners"
"github.com/mochi-co/mqtt/v2/packets"
)
func main() {

View File

@@ -9,10 +9,10 @@ import (
"os/signal"
"syscall"
"github.com/mochi-co/mqtt"
"github.com/mochi-co/mqtt/hooks/auth"
"github.com/mochi-co/mqtt/hooks/storage/badger"
"github.com/mochi-co/mqtt/listeners"
"github.com/mochi-co/mqtt/v2"
"github.com/mochi-co/mqtt/v2/hooks/auth"
"github.com/mochi-co/mqtt/v2/hooks/storage/badger"
"github.com/mochi-co/mqtt/v2/listeners"
)
func main() {

View File

@@ -10,10 +10,10 @@ import (
"syscall"
"time"
"github.com/mochi-co/mqtt"
"github.com/mochi-co/mqtt/hooks/auth"
"github.com/mochi-co/mqtt/hooks/storage/bolt"
"github.com/mochi-co/mqtt/listeners"
"github.com/mochi-co/mqtt/v2"
"github.com/mochi-co/mqtt/v2/hooks/auth"
"github.com/mochi-co/mqtt/v2/hooks/storage/bolt"
"github.com/mochi-co/mqtt/v2/listeners"
"go.etcd.io/bbolt"
)

View File

@@ -9,10 +9,10 @@ import (
"os/signal"
"syscall"
"github.com/mochi-co/mqtt"
"github.com/mochi-co/mqtt/hooks/auth"
"github.com/mochi-co/mqtt/hooks/storage/redis"
"github.com/mochi-co/mqtt/listeners"
"github.com/mochi-co/mqtt/v2"
"github.com/mochi-co/mqtt/v2/hooks/auth"
"github.com/mochi-co/mqtt/v2/hooks/storage/redis"
"github.com/mochi-co/mqtt/v2/listeners"
"github.com/rs/zerolog"
rv8 "github.com/go-redis/redis/v8"

View File

@@ -9,9 +9,9 @@ import (
"os/signal"
"syscall"
"github.com/mochi-co/mqtt"
"github.com/mochi-co/mqtt/hooks/auth"
"github.com/mochi-co/mqtt/listeners"
"github.com/mochi-co/mqtt/v2"
"github.com/mochi-co/mqtt/v2/hooks/auth"
"github.com/mochi-co/mqtt/v2/listeners"
)
func main() {

View File

@@ -10,9 +10,9 @@ import (
"os/signal"
"syscall"
"github.com/mochi-co/mqtt"
"github.com/mochi-co/mqtt/hooks/auth"
"github.com/mochi-co/mqtt/listeners"
"github.com/mochi-co/mqtt/v2"
"github.com/mochi-co/mqtt/v2/hooks/auth"
"github.com/mochi-co/mqtt/v2/listeners"
)
var (

View File

@@ -9,9 +9,9 @@ import (
"os/signal"
"syscall"
"github.com/mochi-co/mqtt"
"github.com/mochi-co/mqtt/hooks/auth"
"github.com/mochi-co/mqtt/listeners"
"github.com/mochi-co/mqtt/v2"
"github.com/mochi-co/mqtt/v2/hooks/auth"
"github.com/mochi-co/mqtt/v2/listeners"
)
func main() {

2
go.mod
View File

@@ -1,4 +1,4 @@
module github.com/mochi-co/mqtt
module github.com/mochi-co/mqtt/v2
go 1.19

View File

@@ -9,9 +9,9 @@ import (
"sync"
"sync/atomic"
"github.com/mochi-co/mqtt/hooks/storage"
"github.com/mochi-co/mqtt/packets"
"github.com/mochi-co/mqtt/system"
"github.com/mochi-co/mqtt/v2/hooks/storage"
"github.com/mochi-co/mqtt/v2/packets"
"github.com/mochi-co/mqtt/v2/system"
"github.com/rs/zerolog"
)

View File

@@ -6,8 +6,8 @@ package auth
import (
"bytes"
"github.com/mochi-co/mqtt"
"github.com/mochi-co/mqtt/packets"
"github.com/mochi-co/mqtt/v2"
"github.com/mochi-co/mqtt/v2/packets"
)
// AllowHook is an authentication hook which allows connection access

View File

@@ -6,8 +6,8 @@ package auth
import (
"testing"
"github.com/mochi-co/mqtt"
"github.com/mochi-co/mqtt/packets"
"github.com/mochi-co/mqtt/v2"
"github.com/mochi-co/mqtt/v2/packets"
"github.com/stretchr/testify/require"
)

View File

@@ -6,8 +6,8 @@ package auth
import (
"bytes"
"github.com/mochi-co/mqtt"
"github.com/mochi-co/mqtt/packets"
"github.com/mochi-co/mqtt/v2"
"github.com/mochi-co/mqtt/v2/packets"
)
// Options contains the configuration/rules data for the auth ledger.

View File

@@ -7,8 +7,8 @@ import (
"os"
"testing"
"github.com/mochi-co/mqtt"
"github.com/mochi-co/mqtt/packets"
"github.com/mochi-co/mqtt/v2"
"github.com/mochi-co/mqtt/v2/packets"
"github.com/rs/zerolog"
"github.com/stretchr/testify/require"
)

View File

@@ -8,8 +8,8 @@ import (
"strings"
"sync"
"github.com/mochi-co/mqtt"
"github.com/mochi-co/mqtt/packets"
"github.com/mochi-co/mqtt/v2"
"github.com/mochi-co/mqtt/v2/packets"
"gopkg.in/yaml.v3"
)

View File

@@ -6,8 +6,8 @@ package auth
import (
"testing"
"github.com/mochi-co/mqtt"
"github.com/mochi-co/mqtt/packets"
"github.com/mochi-co/mqtt/v2"
"github.com/mochi-co/mqtt/v2/packets"
"github.com/stretchr/testify/require"
)

View File

@@ -6,9 +6,9 @@ package debug
import (
"strings"
"github.com/mochi-co/mqtt"
"github.com/mochi-co/mqtt/hooks/storage"
"github.com/mochi-co/mqtt/packets"
"github.com/mochi-co/mqtt/v2"
"github.com/mochi-co/mqtt/v2/hooks/storage"
"github.com/mochi-co/mqtt/v2/packets"
"github.com/rs/zerolog"
)

View File

@@ -8,10 +8,10 @@ import (
"errors"
"strings"
"github.com/mochi-co/mqtt"
"github.com/mochi-co/mqtt/hooks/storage"
"github.com/mochi-co/mqtt/packets"
"github.com/mochi-co/mqtt/system"
"github.com/mochi-co/mqtt/v2"
"github.com/mochi-co/mqtt/v2/hooks/storage"
"github.com/mochi-co/mqtt/v2/packets"
"github.com/mochi-co/mqtt/v2/system"
"github.com/timshannon/badgerhold"
)

View File

@@ -11,10 +11,10 @@ import (
"time"
"github.com/asdine/storm/v3"
"github.com/mochi-co/mqtt"
"github.com/mochi-co/mqtt/hooks/storage"
"github.com/mochi-co/mqtt/packets"
"github.com/mochi-co/mqtt/system"
"github.com/mochi-co/mqtt/v2"
"github.com/mochi-co/mqtt/v2/hooks/storage"
"github.com/mochi-co/mqtt/v2/packets"
"github.com/mochi-co/mqtt/v2/system"
"github.com/rs/zerolog"
"github.com/stretchr/testify/require"
"github.com/timshannon/badgerhold"

View File

@@ -9,10 +9,10 @@ import (
"errors"
"time"
"github.com/mochi-co/mqtt"
"github.com/mochi-co/mqtt/hooks/storage"
"github.com/mochi-co/mqtt/packets"
"github.com/mochi-co/mqtt/system"
"github.com/mochi-co/mqtt/v2"
"github.com/mochi-co/mqtt/v2/hooks/storage"
"github.com/mochi-co/mqtt/v2/packets"
"github.com/mochi-co/mqtt/v2/system"
sgob "github.com/asdine/storm/codec/gob"
"github.com/asdine/storm/v3"

View File

@@ -9,10 +9,10 @@ import (
"testing"
"time"
"github.com/mochi-co/mqtt"
"github.com/mochi-co/mqtt/hooks/storage"
"github.com/mochi-co/mqtt/packets"
"github.com/mochi-co/mqtt/system"
"github.com/mochi-co/mqtt/v2"
"github.com/mochi-co/mqtt/v2/hooks/storage"
"github.com/mochi-co/mqtt/v2/packets"
"github.com/mochi-co/mqtt/v2/system"
"github.com/asdine/storm/v3"
"github.com/rs/zerolog"

View File

@@ -9,10 +9,10 @@ import (
"errors"
"fmt"
"github.com/mochi-co/mqtt"
"github.com/mochi-co/mqtt/hooks/storage"
"github.com/mochi-co/mqtt/packets"
"github.com/mochi-co/mqtt/system"
"github.com/mochi-co/mqtt/v2"
"github.com/mochi-co/mqtt/v2/hooks/storage"
"github.com/mochi-co/mqtt/v2/packets"
"github.com/mochi-co/mqtt/v2/system"
redis "github.com/go-redis/redis/v8"
)

View File

@@ -9,10 +9,10 @@ import (
"testing"
"time"
"github.com/mochi-co/mqtt"
"github.com/mochi-co/mqtt/hooks/storage"
"github.com/mochi-co/mqtt/packets"
"github.com/mochi-co/mqtt/system"
"github.com/mochi-co/mqtt/v2"
"github.com/mochi-co/mqtt/v2/hooks/storage"
"github.com/mochi-co/mqtt/v2/packets"
"github.com/mochi-co/mqtt/v2/system"
miniredis "github.com/alicebob/miniredis/v2"
redis "github.com/go-redis/redis/v8"

View File

@@ -7,8 +7,8 @@ import (
"encoding/json"
"errors"
"github.com/mochi-co/mqtt/packets"
"github.com/mochi-co/mqtt/system"
"github.com/mochi-co/mqtt/v2/packets"
"github.com/mochi-co/mqtt/v2/system"
)
const (

View File

@@ -7,8 +7,8 @@ import (
"testing"
"time"
"github.com/mochi-co/mqtt/packets"
"github.com/mochi-co/mqtt/system"
"github.com/mochi-co/mqtt/v2/packets"
"github.com/mochi-co/mqtt/v2/system"
"github.com/stretchr/testify/require"
)

View File

@@ -10,9 +10,9 @@ import (
"testing"
"time"
"github.com/mochi-co/mqtt/hooks/storage"
"github.com/mochi-co/mqtt/packets"
"github.com/mochi-co/mqtt/system"
"github.com/mochi-co/mqtt/v2/hooks/storage"
"github.com/mochi-co/mqtt/v2/packets"
"github.com/mochi-co/mqtt/v2/system"
"github.com/stretchr/testify/require"
)

View File

@@ -8,7 +8,7 @@ import (
"sync"
"sync/atomic"
"github.com/mochi-co/mqtt/packets"
"github.com/mochi-co/mqtt/v2/packets"
)
// Inflight is a map of InflightMessage keyed on packet id.

View File

@@ -7,7 +7,7 @@ import (
"sync/atomic"
"testing"
"github.com/mochi-co/mqtt/packets"
"github.com/mochi-co/mqtt/v2/packets"
"github.com/stretchr/testify/require"
)

View File

@@ -12,7 +12,7 @@ import (
"sync/atomic"
"time"
"github.com/mochi-co/mqtt/system"
"github.com/mochi-co/mqtt/v2/system"
"github.com/rs/zerolog"
)

View File

@@ -10,7 +10,7 @@ import (
"testing"
"time"
"github.com/mochi-co/mqtt/system"
"github.com/mochi-co/mqtt/v2/system"
"github.com/stretchr/testify/require"
)

View File

@@ -16,10 +16,10 @@ import (
"sync/atomic"
"time"
"github.com/mochi-co/mqtt/hooks/storage"
"github.com/mochi-co/mqtt/listeners"
"github.com/mochi-co/mqtt/packets"
"github.com/mochi-co/mqtt/system"
"github.com/mochi-co/mqtt/v2/hooks/storage"
"github.com/mochi-co/mqtt/v2/listeners"
"github.com/mochi-co/mqtt/v2/packets"
"github.com/mochi-co/mqtt/v2/system"
"github.com/rs/zerolog"
)

View File

@@ -14,10 +14,10 @@ import (
"testing"
"time"
"github.com/mochi-co/mqtt/hooks/storage"
"github.com/mochi-co/mqtt/listeners"
"github.com/mochi-co/mqtt/packets"
"github.com/mochi-co/mqtt/system"
"github.com/mochi-co/mqtt/v2/hooks/storage"
"github.com/mochi-co/mqtt/v2/listeners"
"github.com/mochi-co/mqtt/v2/packets"
"github.com/mochi-co/mqtt/v2/system"
"github.com/rs/zerolog"
"github.com/stretchr/testify/require"

View File

@@ -8,7 +8,7 @@ import (
"sync"
"sync/atomic"
"github.com/mochi-co/mqtt/packets"
"github.com/mochi-co/mqtt/v2/packets"
)
var (

View File

@@ -6,7 +6,7 @@ package mqtt
import (
"testing"
"github.com/mochi-co/mqtt/packets"
"github.com/mochi-co/mqtt/v2/packets"
"github.com/stretchr/testify/require"
)