Remove deprecated funcs.

This commit is contained in:
Vladimir Mihailenco 2015-05-02 16:19:22 +03:00
parent f7a1636422
commit 121cfc5792
9 changed files with 12 additions and 24 deletions

View File

@ -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()

View File

@ -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,
})
})

View File

@ -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,
})

View File

@ -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

View File

@ -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,
})
})

View File

@ -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,
})
})

View File

@ -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,
})
})

View File

@ -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)
}

View File

@ -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,
})