1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-28 06:42:00 +03:00

pipeline now has its own interface "Pipelineable"

This commit is contained in:
Felipe Cavalcanti
2017-05-01 12:42:58 -03:00
parent 4c6e2ad9a0
commit 6fca4d5ad0
16 changed files with 70 additions and 42 deletions

View File

@ -347,7 +347,7 @@ var _ = Describe("ClusterClient", func() {
return err
}
_, err = tx.Pipelined(func(pipe *redis.Pipeline) error {
_, err = tx.Pipelined(func(pipe redis.Pipelineable) error {
pipe.Set(key, strconv.FormatInt(n+1, 10), 0)
return nil
})
@ -449,7 +449,7 @@ var _ = Describe("ClusterClient", func() {
Describe("Pipeline", func() {
BeforeEach(func() {
pipe = client.Pipeline()
pipe = client.Pipeline().(*redis.Pipeline)
})
AfterEach(func() {
@ -461,7 +461,7 @@ var _ = Describe("ClusterClient", func() {
Describe("TxPipeline", func() {
BeforeEach(func() {
pipe = client.TxPipeline()
pipe = client.TxPipeline().(*redis.Pipeline)
})
AfterEach(func() {
@ -544,7 +544,7 @@ var _ = Describe("ClusterClient without nodes", func() {
})
It("pipeline returns an error", func() {
_, err := client.Pipelined(func(pipe *redis.Pipeline) error {
_, err := client.Pipelined(func(pipe redis.Pipelineable) error {
pipe.Ping()
return nil
})
@ -571,7 +571,7 @@ var _ = Describe("ClusterClient without valid nodes", func() {
})
It("pipeline returns an error", func() {
_, err := client.Pipelined(func(pipe *redis.Pipeline) error {
_, err := client.Pipelined(func(pipe redis.Pipelineable) error {
pipe.Ping()
return nil
})
@ -594,7 +594,7 @@ var _ = Describe("ClusterClient timeout", func() {
})
It("Pipeline timeouts", func() {
_, err := client.Pipelined(func(pipe *redis.Pipeline) error {
_, err := client.Pipelined(func(pipe redis.Pipelineable) error {
pipe.Ping()
return nil
})
@ -612,7 +612,7 @@ var _ = Describe("ClusterClient timeout", func() {
It("Tx Pipeline timeouts", func() {
err := client.Watch(func(tx *redis.Tx) error {
_, err := tx.Pipelined(func(pipe *redis.Pipeline) error {
_, err := tx.Pipelined(func(pipe redis.Pipelineable) error {
pipe.Ping()
return nil
})