1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-04 10:47:20 +00:00

remove MaxAgeSeconds from redis sessiondb - now it derives from the sessions configuration automatically. Add option to use an existing BoltDB connection on boltdb sessiondb.

TODO: leveldb sessiondb

Former-commit-id: 8cb781bf089ab7b9a09dccc633454db9c6077610
This commit is contained in:
kataras
2017-08-08 12:31:42 +03:00
parent 48e352e1df
commit 92d0b146df
7 changed files with 70 additions and 43 deletions

View File

@@ -33,21 +33,18 @@ type Config struct {
IdleTimeout time.Duration
// Prefix "myprefix-for-this-website". Default ""
Prefix string
// MaxAgeSeconds how much long the redis should keep the session in seconds. Default 31556926.0 (1 year)
MaxAgeSeconds int
}
// DefaultConfig returns the default configuration for Redis service.
func DefaultConfig() Config {
return Config{
Network: DefaultRedisNetwork,
Addr: DefaultRedisAddr,
Password: "",
Database: "",
MaxIdle: 0,
MaxActive: 0,
IdleTimeout: DefaultRedisIdleTimeout,
Prefix: "",
MaxAgeSeconds: DefaultRedisMaxAgeSeconds,
Network: DefaultRedisNetwork,
Addr: DefaultRedisAddr,
Password: "",
Database: "",
MaxIdle: 0,
MaxActive: 0,
IdleTimeout: DefaultRedisIdleTimeout,
Prefix: "",
}
}