diff --git a/cache/redis.go b/cache/redis.go index 3354ee0..2430f1b 100644 --- a/cache/redis.go +++ b/cache/redis.go @@ -22,6 +22,11 @@ func NewCoreRedis(serverName string, poolSize int) (*RedisClient, error) { return newRedisClient("core.codis.pri.ibanyu.com:19000", serverName, poolSize) } +// NewRedisByAddr ... +func NewRedisByAddr(addr, serverName string, poolSize int) (*RedisClient, error) { + return newRedisClient(addr, serverName, poolSize) +} + func NewRedisByNamespace(ctx context.Context, namespace string) (*RedisClient, error) { fun := "NewRedisByNamespace -->" client, err := redis.DefaultInstanceManager.GetInstance(ctx, getInstanceConf(ctx, namespace)) diff --git a/cache/redis_test.go b/cache/redis_test.go index 88759c7..acd641e 100644 --- a/cache/redis_test.go +++ b/cache/redis_test.go @@ -1,9 +1,10 @@ package cache import ( - "github.com/stretchr/testify/assert" "testing" "time" + + "github.com/stretchr/testify/assert" ) var client, _ = NewCommonRedis("test/test", 1024)