diff options
| author | Smoke <[email protected]> | 2024-02-16 07:33:29 -1000 |
|---|---|---|
| committer | Smoke <[email protected]> | 2024-02-16 07:33:29 -1000 |
| commit | e8d65dbd875bfdf9e11e99370e24b9ee35c2c101 (patch) | |
| tree | d20f97768c3d293f0482b7b91f3e7d584e7c7e85 | |
| parent | 59d8f1e1d46abe92e114d50a7a1852bdb8baa608 (diff) | |
mode dedupe to own package
| -rw-r--r-- | dedupe/dedupe.go (renamed from dedupe.go) | 2 | ||||
| -rw-r--r-- | dedupe/dedupe_test.go (renamed from dedupe_test.go) | 8 | ||||
| -rw-r--r-- | go.mod | 3 | ||||
| -rw-r--r-- | go.sum | 4 |
4 files changed, 6 insertions, 11 deletions
diff --git a/dedupe.go b/dedupe/dedupe.go index 97934e0..44f02c5 100644 --- a/dedupe.go +++ b/dedupe/dedupe.go @@ -1,4 +1,4 @@ -package meshtastic +package dedupe import ( "encoding/hex" diff --git a/dedupe_test.go b/dedupe/dedupe_test.go index 6388360..cc6ce70 100644 --- a/dedupe_test.go +++ b/dedupe/dedupe_test.go @@ -1,8 +1,8 @@ -package meshtastic_test +package dedupe_test import ( "crypto/md5" - "github.com/crypto-smoke/meshtastic-go" + "github.com/crypto-smoke/meshtastic-go/dedupe" "testing" "time" ) @@ -10,7 +10,7 @@ import ( func TestPacketDeduplicatorSeen(t *testing.T) { hasher := md5.New() expiresAfter := 100 * time.Millisecond - dedup := meshtastic.NewDeduplicator(hasher, expiresAfter) + dedup := dedupe.NewDeduplicator(hasher, expiresAfter) sender := uint32(1) packetID := uint32(1) @@ -37,7 +37,7 @@ func TestPacketDeduplicatorSeen(t *testing.T) { func TestPacketDeduplicatorSeenData(t *testing.T) { hasher := md5.New() expiresAfter := 100 * time.Millisecond - dedup := meshtastic.NewDeduplicator(hasher, expiresAfter) + dedup := dedupe.NewDeduplicator(hasher, expiresAfter) data := []byte("test data") @@ -5,7 +5,7 @@ go 1.21 require ( github.com/charmbracelet/log v0.3.1 github.com/eclipse/paho.mqtt.golang v1.4.3 - github.com/meshnet-gophers/protobufs v2.2.22+incompatible + github.com/planetscale/vtprotobuf v0.6.0 github.com/stretchr/testify v1.8.4 go.bug.st/serial v1.6.1 golang.org/x/sync v0.6.0 @@ -24,7 +24,6 @@ require ( github.com/mattn/go-runewidth v0.0.15 // indirect github.com/muesli/reflow v0.3.0 // indirect github.com/muesli/termenv v0.15.2 // indirect - github.com/planetscale/vtprotobuf v0.6.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/rivo/uniseg v0.4.7 // indirect golang.org/x/exp v0.0.0-20240205201215-2c58cdc269a3 // indirect @@ -23,10 +23,6 @@ github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= -github.com/meshnet-gophers/protobufs v0.0.0-20240216150730-37862814df79 h1:DGGW63VDYWFbV1pX32iQqwJ+ASWgKflp5JaU/ARyblo= -github.com/meshnet-gophers/protobufs v0.0.0-20240216150730-37862814df79/go.mod h1:1FRbeHjF+DvD6od6oedTYUP6j8nIzeXGG1q9CcLAMw8= -github.com/meshnet-gophers/protobufs v2.2.22+incompatible h1:PqhnY9Tk4ounTqx3/lqffGOwip0nvvmSKXg3DneEEOQ= -github.com/meshnet-gophers/protobufs v2.2.22+incompatible/go.mod h1:1FRbeHjF+DvD6od6oedTYUP6j8nIzeXGG1q9CcLAMw8= github.com/muesli/reflow v0.3.0 h1:IFsN6K9NfGtjeggFP+68I4chLZV2yIKsXJFNZ+eWh6s= github.com/muesli/reflow v0.3.0/go.mod h1:pbwTDkVPibjO2kyvBQRBxTWEEGDGq0FlB1BIKtnHY/8= github.com/muesli/termenv v0.15.2 h1:GohcuySI0QmI3wN8Ok9PtKGkgkFIk7y6Vpb5PvrY+Wo= |
