1
0
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:
Gerasimos (Makis) Maropoulos
2019-08-09 08:24:58 +03:00
parent eb29a80753
commit b7bc89335d
4 changed files with 119 additions and 33 deletions

View File

@@ -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()
})