mirror of
https://github.com/kataras/iris.git
synced 2025-12-17 18:07:01 +00:00
Former-commit-id: 221e01638b671586cdab2b84518bd6a1c8d07bda
This commit is contained in:
@@ -12,7 +12,8 @@ import (
|
||||
// tested with redis version 3.0.503.
|
||||
// for windows see: https://github.com/ServiceStack/redis-windows
|
||||
func main() {
|
||||
// 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",
|
||||
@@ -25,14 +26,14 @@ func main() {
|
||||
Driver: redis.Redigo(), // redis.Radix() can be used instead.
|
||||
})
|
||||
|
||||
// optionally configure the underline driver:
|
||||
// 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
|
||||
// Close connection when control+C/cmd+C
|
||||
iris.RegisterOnInterrupt(func() {
|
||||
db.Close()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user