diff --git a/main.go b/main.go index 63e9086..2c77d3f 100644 --- a/main.go +++ b/main.go @@ -14,6 +14,7 @@ import ( "eosio-ship-trace-reader/abi" "eosio-ship-trace-reader/app" "eosio-ship-trace-reader/config" + "eosio-ship-trace-reader/transport/redis_common" "eosio-ship-trace-reader/transport/redis_pubsub" "github.com/nikoksr/notify" @@ -221,7 +222,7 @@ func main() { app.SpawnProccessor( shClient, - redis_pubsub.NewPublisher(rdb, redis_pubsub.Namespace{ + redis_pubsub.NewPublisher(rdb, redis_common.Namespace{ Prefix: conf.Redis.Prefix, ChainID: chainInfo.ChainID.String(), }), diff --git a/transport/redis_pubsub/key.go b/transport/redis_common/key.go similarity index 93% rename from transport/redis_pubsub/key.go rename to transport/redis_common/key.go index 36d940f..0a27e94 100644 --- a/transport/redis_pubsub/key.go +++ b/transport/redis_common/key.go @@ -1,4 +1,4 @@ -package redis_pubsub +package redis_common import ( "fmt" diff --git a/transport/redis_pubsub/key_test.go b/transport/redis_common/key_test.go similarity index 98% rename from transport/redis_pubsub/key_test.go rename to transport/redis_common/key_test.go index 757bcf5..dba49cc 100644 --- a/transport/redis_pubsub/key_test.go +++ b/transport/redis_common/key_test.go @@ -1,4 +1,4 @@ -package redis_pubsub +package redis_common import ( "testing" diff --git a/transport/redis_pubsub/namespace.go b/transport/redis_common/namespace.go similarity index 98% rename from transport/redis_pubsub/namespace.go rename to transport/redis_common/namespace.go index aee84a5..e51e076 100644 --- a/transport/redis_pubsub/namespace.go +++ b/transport/redis_common/namespace.go @@ -1,4 +1,4 @@ -package redis_pubsub +package redis_common import ( "strings" diff --git a/transport/redis_pubsub/namespace_test.go b/transport/redis_common/namespace_test.go similarity index 97% rename from transport/redis_pubsub/namespace_test.go rename to transport/redis_common/namespace_test.go index 7c9eef9..44edfcb 100644 --- a/transport/redis_pubsub/namespace_test.go +++ b/transport/redis_common/namespace_test.go @@ -1,4 +1,4 @@ -package redis_pubsub +package redis_common import "testing" diff --git a/transport/redis_pubsub/publisher.go b/transport/redis_pubsub/publisher.go index ce22f34..599ba1c 100644 --- a/transport/redis_pubsub/publisher.go +++ b/transport/redis_pubsub/publisher.go @@ -4,6 +4,7 @@ import ( "context" "eosio-ship-trace-reader/transport" + . "eosio-ship-trace-reader/transport/redis_common" "github.com/go-redis/redis/v8" ) diff --git a/transport/redis_pubsub/publisher_test.go b/transport/redis_pubsub/publisher_test.go index 3c29c52..e9a2b83 100644 --- a/transport/redis_pubsub/publisher_test.go +++ b/transport/redis_pubsub/publisher_test.go @@ -4,6 +4,7 @@ import ( "testing" "eosio-ship-trace-reader/transport" + . "eosio-ship-trace-reader/transport/redis_common" "github.com/go-redis/redismock/v8" "github.com/stretchr/testify/assert" diff --git a/transport/redis_pubsub/subscriber.go b/transport/redis_pubsub/subscriber.go index 41afddc..dfdcac3 100644 --- a/transport/redis_pubsub/subscriber.go +++ b/transport/redis_pubsub/subscriber.go @@ -6,6 +6,7 @@ import ( "time" "eosio-ship-trace-reader/transport" + . "eosio-ship-trace-reader/transport/redis_common" "github.com/go-redis/redis/v8" ) diff --git a/transport/redis_pubsub/subscriber_test.go b/transport/redis_pubsub/subscriber_test.go index 25473f2..7ce2b70 100644 --- a/transport/redis_pubsub/subscriber_test.go +++ b/transport/redis_pubsub/subscriber_test.go @@ -5,6 +5,7 @@ import ( "time" "eosio-ship-trace-reader/transport" + . "eosio-ship-trace-reader/transport/redis_common" "github.com/alicebob/miniredis/v2" "github.com/go-redis/redis/v8"