diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index f9a7c5d..84ea4c4 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 + uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c with: egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs @@ -23,4 +23,8 @@ jobs: - name: Run coverage run: go test ./... -race -coverprofile=coverage.txt -covermode=atomic - name: Upload coverage to Codecov - run: bash <(curl -s https://codecov.io/bash) + uses: codecov/codecov-action@v4.0.1 + with: + verbose: true + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/go.mod b/go.mod index a383a52..5b5db35 100644 --- a/go.mod +++ b/go.mod @@ -3,14 +3,16 @@ module github.com/memsql/keyeddistributor go 1.18 require ( - github.com/muir/nject v1.7.1 - github.com/stretchr/testify v1.8.4 + github.com/memsql/refcountmap v0.1.1 + github.com/sharnoff/eventdistributor v0.1.1 + github.com/stretchr/testify v1.9.0 ) require ( github.com/davecgh/go-spew v1.1.1 // indirect - github.com/muir/reflectutils v0.7.0 // indirect - github.com/pkg/errors v0.9.1 // indirect + github.com/kr/text v0.1.0 // indirect + github.com/muir/gwrap v0.3.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect + golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..d2adf90 --- /dev/null +++ b/go.sum @@ -0,0 +1,22 @@ +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/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/memsql/refcountmap v0.1.1 h1:tcYPE9pRlVv7uwbDUY2E+sjhD/zBRRWvPQ0pz8IIujg= +github.com/memsql/refcountmap v0.1.1/go.mod h1:kJR6RIBAI4iZgNo7hqQZZSmWWHNv+5t9X3RbOku86nk= +github.com/muir/gwrap v0.3.0 h1:hB/e3CBIvb0KkYDvTbJdajxZH6eoUbgSF/TYWbIkec4= +github.com/muir/gwrap v0.3.0/go.mod h1:VOGKgjhrLZ2TDcmZ5n2Kzd9KXUzPAfL3IIW6c/EJiWE= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/sharnoff/eventdistributor v0.1.1 h1:7OOcn2f9w5zGCjHm8KcIYKyp6y+W7xTNvo7rgnhWvvg= +github.com/sharnoff/eventdistributor v0.1.1/go.mod h1:OEKtalwdvbR4ZSEkNzMUTcu5aSaW+jRHjmamBlyTcqk= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 h1:k/i9J1pBpvlfR+9QsetwPyERsqu1GIbi967PQMq3Ivc= +golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/keyed.go b/keyed.go index 156b6ca..ee8838d 100644 --- a/keyed.go +++ b/keyed.go @@ -1,9 +1,9 @@ -package keyed +package keyeddistributor import ( "github.com/sharnoff/eventdistributor" - "singlestore.com/helios/util/refcountmap" + "github.com/memsql/refcountmap" ) /* diff --git a/keyed_test.go b/keyed_test.go index fe0f70f..6eb861a 100644 --- a/keyed_test.go +++ b/keyed_test.go @@ -1,4 +1,4 @@ -package keyed_test +package keyeddistributor_test import ( "testing" @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "singlestore.com/helios/events/keyed" + "github.com/memsql/keyeddistributor" ) type MyEvent struct { @@ -14,7 +14,7 @@ type MyEvent struct { } func TestKeyed(t *testing.T) { - distributor := keyed.New(func(e MyEvent) int { + distributor := keyeddistributor.New(func(e MyEvent) int { return e.id % 4 })