1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-31 05:04:23 +03:00

Add Redis Cluster support.

This commit is contained in:
Dimitrij Denissenko
2015-01-24 12:12:48 +00:00
committed by Vladimir Mihailenco
parent 78cf6f5eae
commit c21e5f3255
19 changed files with 1262 additions and 325 deletions

25
crc16_test.go Normal file
View File

@ -0,0 +1,25 @@
package redis
import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("CRC16", func() {
// http://redis.io/topics/cluster-spec#keys-distribution-model
It("should calculate CRC16", func() {
tests := []struct {
s string
n uint16
}{
{"123456789", 0x31C3},
{string([]byte{83, 153, 134, 118, 229, 214, 244, 75, 140, 37, 215, 215}), 21847},
}
for _, test := range tests {
Expect(crc16sum(test.s)).To(Equal(test.n), "for %s", test.s)
}
})
})