forked from bpowers/radix
/
config.go
38 lines (30 loc) · 810 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
package redis
import "time"
// Config is a configuration of a database client.
type Config struct {
// Network and address
// "tcp" or "unix". Default: "tcp"
Network string
// eg. "173.194.32.33:6379". Default: "127.0.0.1:6379"
Address string
// Database number. Default: 0
Database int
// Password for authentication. Leave as "" to not use authentication.
// Default: ""
Password string
// Connection pool capacity. Default: 50
PoolCapacity int
// Socket timeout. Default: 0 (no timeouts)
Timeout time.Duration
// Retry on LOADING error? Default: true
RetryLoading bool
}
// DefaultConfig returns a new Config with default settings.
func DefaultConfig() Config {
return Config{
Network: "tcp",
Address: "127.0.0.1:6379",
PoolCapacity: 50,
RetryLoading: true,
}
}