mirror of
https://github.com/kataras/iris.git
synced 2025-02-02 15:30:36 +01:00
add the new Driver config field on the wiki
parent
3b0faa1f64
commit
f2b6c50e11
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue
Block a user