add the new Driver config field on the wiki

Gerasimos (Makis) Maropoulos 2019-08-06 18:43:39 +03:00
parent 3b0faa1f64
commit f2b6c50e11
No known key found for this signature in database
GPG Key ID: F169457BBDA4ACF4

@ -22,7 +22,8 @@ import (
)
// 2. Initialize the database.
// Replace with your running redis' server settings:
// These are the default values,
// you can replace them based on your running redis' server settings:
db := redis.New(redis.Config{
Network: "tcp",
Addr: "127.0.0.1:6379",
@ -31,8 +32,17 @@ db := redis.New(redis.Config{
Password: "",
Database: "",
Prefix: "",
Delim: "-",
Driver: redis.Redigo(), // redis.Radix() can be used instead.
})
// Optionally configure the underline driver:
// driver := redis.Redigo()
// driver.MaxIdle = ...
// driver.IdleTimeout = ...
// driver.Wait = ...
// redis.Config {Driver: driver}
// Close connection when control+C/cmd+C
iris.RegisterOnInterrupt(func() {
db.Close()