Skip to content

Commit

Permalink
add addr redis (#178)
Browse files Browse the repository at this point in the history
  • Loading branch information
brzyangg authored Jan 13, 2021
1 parent 4ca0589 commit 0516428
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions cache/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
3 changes: 2 additions & 1 deletion cache/redis_test.go
Original file line number Diff line number Diff line change
@@ -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)
Expand Down

0 comments on commit 0516428

Please sign in to comment.