Started upgrading the redis driver

This commit is contained in:
Trial97
2020-07-31 17:15:19 +03:00
committed by Dan Christian Bogos
parent 14ea06842f
commit 858bd61b81
4 changed files with 1560 additions and 27 deletions

View File

@@ -53,33 +53,6 @@ type sentinelInst struct {
conn *sentinel.Client
}
// Redis commands
const (
redis_AUTH = "AUTH"
redis_SELECT = "SELECT"
redis_FLUSHDB = "FLUSHDB"
redis_DEL = "DEL"
redis_HGETALL = "HGETALL"
redis_KEYS = "KEYS"
redis_SADD = "SADD"
redis_SMEMBERS = "SMEMBERS"
redis_SREM = "SREM"
redis_EXISTS = "EXISTS"
redis_GET = "GET"
redis_SET = "SET"
redis_LRANGE = "LRANGE"
redis_LLEN = "LLEN"
redis_RPOP = "RPOP"
redis_LPUSH = "LPUSH"
redis_RPUSH = "RPUSH"
redis_LPOP = "LPOP"
redis_HMGET = "HMGET"
redis_HDEL = "HDEL"
redis_HGET = "HGET"
redis_RENAME = "RENAME"
redis_HMSET = "HMSET"
)
func NewRedisStorage(address string, db int, pass, mrshlerStr string,
maxConns int, sentinelName string) (*RedisStorage, error) {

1557
engine/storage_redisv3.go Normal file

File diff suppressed because it is too large Load Diff

1
go.mod
View File

@@ -37,6 +37,7 @@ require (
github.com/lib/pq v1.8.0
github.com/mattn/go-runewidth v0.0.9 // indirect
github.com/mediocregopher/radix.v2 v0.0.0-20181115013041-b67df6e626f9
github.com/mediocregopher/radix/v3 v3.5.2 // indirect
github.com/miekg/dns v1.1.30
github.com/mitchellh/mapstructure v1.3.3
github.com/nyaruka/phonenumbers v1.0.56

2
go.sum
View File

@@ -222,6 +222,8 @@ github.com/mattn/go-sqlite3 v1.14.0 h1:mLyGNKR8+Vv9CAU7PphKa2hkEqxxhn8i32J6FPj1/
github.com/mattn/go-sqlite3 v1.14.0/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus=
github.com/mediocregopher/radix.v2 v0.0.0-20181115013041-b67df6e626f9 h1:ViNuGS149jgnttqhc6XQNPwdupEMBXqCx9wtlW7P3sA=
github.com/mediocregopher/radix.v2 v0.0.0-20181115013041-b67df6e626f9/go.mod h1:fLRUbhbSd5Px2yKUaGYYPltlyxi1guJz1vCmo1RQL50=
github.com/mediocregopher/radix/v3 v3.5.2 h1:A9u3G7n4+fWmDZ2ZDHtlK+cZl4q55T+7RjKjR0/MAdk=
github.com/mediocregopher/radix/v3 v3.5.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8=
github.com/miekg/dns v1.1.30 h1:Qww6FseFn8PRfw07jueqIXqodm0JKiiKuK0DeXSqfyo=
github.com/miekg/dns v1.1.30/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM=
github.com/mitchellh/mapstructure v1.3.3 h1:SzB1nHZ2Xi+17FP0zVQBHIZqvwRN9408fJO8h+eeNA8=