/
config.go
40 lines (28 loc) · 867 Bytes
/
config.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package redis
// session redis config
type Config struct {
// Redis server host
Host string
// Redis server port
Port int64
// Maximum number of idle connections in the redis server pool.
MaxIdle int
// Close connections after remaining idle for this duration. If the value
// is zero, then idle connections are not closed. Applications should set
// the timeout to a value less than the server's timeout.
// (s)
IdleTimeout int64
// redis server conn auth, default ""
Password string
// select db number, default 0
DbNumber int
// sessionId as redis key prefix
KeyPrefix string
// session value serialize func
SerializeFunc func(data map[string]interface{}) ([]byte, error)
// session value unSerialize func
UnSerializeFunc func(data []byte) (map[string]interface{}, error)
}
func (mc *Config) Name() string {
return ProviderName
}