1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-24 05:17:03 +00:00

add cluster driver

Former-commit-id: 1ca87c78690a3c7a5bb40d8d669de4371bd3932c
This commit is contained in:
will
2020-06-27 17:33:02 +08:00
parent 7f9e664b90
commit b8218df789
5 changed files with 302 additions and 24 deletions

View File

@@ -31,7 +31,7 @@ type Config struct {
Addr string
// Clusters a list of network addresses for clusters.
// If not empty "Addr" is ignored.
// Currently only Radix() Driver supports it.
// Currently only RadixCluster() Driver supports it.
Clusters []string
// Password string .If no password then no 'AUTH'. Defaults to "".
Password string
@@ -51,7 +51,7 @@ type Config struct {
// See https://golang.org/pkg/crypto/tls/#Config
TLSConfig *tls.Config
// Driver supports `Redigo()` or `Radix()` go clients for redis.
// Driver supports `Redigo()` or `Radix()` or `RadixCluster()` go clients for redis.
// Configure each driver by the return value of their constructors.
//
// Defaults to `Redigo()`.
@@ -119,8 +119,7 @@ func New(cfg ...Config) *Database {
db := &Database{c: c}
_, err := db.c.Driver.PingPong()
if err != nil {
golog.Debugf("error connecting to redis: %v", err)
return nil
panic(err)
}
// runtime.SetFinalizer(db, closeDB)
return db