diff --git a/cluster.go b/cluster.go index f5fbaf7d..1189ba62 100644 --- a/cluster.go +++ b/cluster.go @@ -81,7 +81,7 @@ func (c *ClusterClient) getClient(addr string) (*Client, error) { if !ok { opt := c.opt.clientOptions() opt.Addr = addr - client = NewTCPClient(opt) + client = NewClient(opt) c.clients[addr] = client } c.clientsMx.Unlock() diff --git a/command_test.go b/command_test.go index 633c8a50..d07bbca3 100644 --- a/command_test.go +++ b/command_test.go @@ -15,7 +15,7 @@ var _ = Describe("Command", func() { var client *redis.Client BeforeEach(func() { - client = redis.NewTCPClient(&redis.Options{ + client = redis.NewClient(&redis.Options{ Addr: redisAddr, }) }) diff --git a/commands_test.go b/commands_test.go index 485b3e8a..b451c521 100644 --- a/commands_test.go +++ b/commands_test.go @@ -16,7 +16,7 @@ var _ = Describe("Commands", func() { var client *redis.Client BeforeEach(func() { - client = redis.NewTCPClient(&redis.Options{ + client = redis.NewClient(&redis.Options{ Addr: redisAddr, PoolTimeout: 30 * time.Second, }) diff --git a/example_test.go b/example_test.go index bf940407..230a5585 100644 --- a/example_test.go +++ b/example_test.go @@ -10,14 +10,14 @@ import ( var client *redis.Client func init() { - client = redis.NewTCPClient(&redis.Options{ + client = redis.NewClient(&redis.Options{ Addr: ":6379", }) client.FlushDb() } -func ExampleNewTCPClient() { - client := redis.NewTCPClient(&redis.Options{ +func ExampleNewClient() { + client := redis.NewClient(&redis.Options{ Addr: "localhost:6379", Password: "", // no password set DB: 0, // use default DB diff --git a/multi_test.go b/multi_test.go index eab870cb..0a8eac94 100644 --- a/multi_test.go +++ b/multi_test.go @@ -11,7 +11,7 @@ var _ = Describe("Multi", func() { var client *redis.Client BeforeEach(func() { - client = redis.NewTCPClient(&redis.Options{ + client = redis.NewClient(&redis.Options{ Addr: redisAddr, }) }) diff --git a/pipeline_test.go b/pipeline_test.go index d250d457..8a6c09d3 100644 --- a/pipeline_test.go +++ b/pipeline_test.go @@ -14,7 +14,7 @@ var _ = Describe("Pipelining", func() { var client *redis.Client BeforeEach(func() { - client = redis.NewTCPClient(&redis.Options{ + client = redis.NewClient(&redis.Options{ Addr: redisAddr, }) }) diff --git a/pubsub_test.go b/pubsub_test.go index d67f7455..408a42cc 100644 --- a/pubsub_test.go +++ b/pubsub_test.go @@ -14,7 +14,7 @@ var _ = Describe("PubSub", func() { var client *redis.Client BeforeEach(func() { - client = redis.NewTCPClient(&redis.Options{ + client = redis.NewClient(&redis.Options{ Addr: redisAddr, }) }) diff --git a/redis.go b/redis.go index d03425cb..e38098e3 100644 --- a/redis.go +++ b/redis.go @@ -188,15 +188,3 @@ func NewClient(clOpt *Options) *Client { } return newClient(opt, newConnPool(newConnFunc(dialer), opt)) } - -// Deprecated. Use NewClient instead. -func NewTCPClient(opt *Options) *Client { - opt.Network = "tcp" - return NewClient(opt) -} - -// Deprecated. Use NewClient instead. -func NewUnixClient(opt *Options) *Client { - opt.Network = "unix" - return NewClient(opt) -} diff --git a/redis_test.go b/redis_test.go index 62068d06..1457dad9 100644 --- a/redis_test.go +++ b/redis_test.go @@ -28,7 +28,7 @@ var _ = Describe("Client", func() { var client *redis.Client BeforeEach(func() { - client = redis.NewTCPClient(&redis.Options{ + client = redis.NewClient(&redis.Options{ Addr: redisAddr, }) }) @@ -98,7 +98,7 @@ var _ = Describe("Client", func() { }) It("should support idle-timeouts", func() { - idle := redis.NewTCPClient(&redis.Options{ + idle := redis.NewClient(&redis.Options{ Addr: redisAddr, IdleTimeout: 100 * time.Microsecond, }) @@ -110,7 +110,7 @@ var _ = Describe("Client", func() { }) It("should support DB selection", func() { - db1 := redis.NewTCPClient(&redis.Options{ + db1 := redis.NewClient(&redis.Options{ Addr: redisAddr, DB: 1, })