/
config.go
39 lines (34 loc) · 1.34 KB
/
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
package model
import "time"
type DBOption struct {
User string `mapstructure:"user"`
Passwd string `mapstructure:"passwd"`
Host string `mapstructure:"host"`
Port int `mapstructure:"port"`
Database string `mapstructure:"database"`
MaxOpenConnection int `mapstructure:"maxopenconnection"`
MaxIdleConnection int `mapstructure:"maxidleconnection"`
MaxConnectionLifeTime int `mapstructure:"maxconnectionlifetime"`
Log bool `mapstructure:"sql_log"`
}
type RedisOption struct {
Passwd string `mapstructure:"passwd"`
Host string `mapstructure:"host"`
Port int `mapstructure:"port"`
DbNum int `mapstructure:"db_num"`
Timeout int `mapstructure:"timeout"`
MaxIdleConns int `mapstructure:"max_idle_conns"`
MaxOpenConns int `mapstructure:"max_open_conns"`
InitialOpenConns int `mapstructure:"initial_open_conns"`
}
type LogOption struct {
Filename string `mapstructure:"filename"`
Level string `mapstructure:"level"`
MaxAge time.Duration `mapstructure:"maxage"`
}
type RPCOption struct {
User string `mapstructure:"user"`
Passwd string `mapstructure:"passwd"`
Host string `mapstructure:"host"`
Port int `mapstructure:"port"`
}