mirror of
https://github.com/kataras/iris.git
synced 2026-01-25 21:05:56 +00:00
extract the Delim for redis sessiondb as requested at https://github.com/kataras/iris/issues/1256 and add a mvc/regexp example and some other trivial changes
Former-commit-id: f9e09320bfe07ae10ac74f54a78272cf21d21cc7
This commit is contained in:
@@ -5,32 +5,36 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
// DefaultRedisNetwork the redis network option, "tcp"
|
||||
// DefaultRedisNetwork the redis network option, "tcp".
|
||||
DefaultRedisNetwork = "tcp"
|
||||
// DefaultRedisAddr the redis address option, "127.0.0.1:6379"
|
||||
// DefaultRedisAddr the redis address option, "127.0.0.1:6379".
|
||||
DefaultRedisAddr = "127.0.0.1:6379"
|
||||
// DefaultRedisIdleTimeout the redis idle timeout option, time.Duration(5) * time.Minute
|
||||
// DefaultRedisIdleTimeout the redis idle timeout option, time.Duration(5) * time.Minute.
|
||||
DefaultRedisIdleTimeout = time.Duration(5) * time.Minute
|
||||
// DefaultDelim ths redis delim option, "-".
|
||||
DefaultDelim = "-"
|
||||
)
|
||||
|
||||
// Config the redis configuration used inside sessions
|
||||
type Config struct {
|
||||
// Network "tcp"
|
||||
// Network protocol. Defaults to "tcp".
|
||||
Network string
|
||||
// Addr "127.0.0.1:6379"
|
||||
// Addr of the redis server. Defaults to "127.0.0.1:6379".
|
||||
Addr string
|
||||
// Password string .If no password then no 'AUTH'. Default ""
|
||||
// Password string .If no password then no 'AUTH'. Defaults to "".
|
||||
Password string
|
||||
// If Database is empty "" then no 'SELECT'. Default ""
|
||||
// If Database is empty "" then no 'SELECT'. Defaults to "".
|
||||
Database string
|
||||
// MaxIdle 0 no limit
|
||||
// MaxIdle 0 no limit.
|
||||
MaxIdle int
|
||||
// MaxActive 0 no limit
|
||||
// MaxActive 0 no limit.
|
||||
MaxActive int
|
||||
// IdleTimeout time.Duration(5) * time.Minute
|
||||
// IdleTimeout time.Duration(5) * time.Minute.
|
||||
IdleTimeout time.Duration
|
||||
// Prefix "myprefix-for-this-website". Default ""
|
||||
// Prefix "myprefix-for-this-website". Defaults to "".
|
||||
Prefix string
|
||||
// Delim the delimeter for the values. Defaults to "-".
|
||||
Delim string
|
||||
}
|
||||
|
||||
// DefaultConfig returns the default configuration for Redis service.
|
||||
@@ -44,5 +48,6 @@ func DefaultConfig() Config {
|
||||
MaxActive: 0,
|
||||
IdleTimeout: DefaultRedisIdleTimeout,
|
||||
Prefix: "",
|
||||
Delim: DefaultDelim,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user