/
config.go
55 lines (48 loc) · 1.03 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package db
// Config 数据库配置
type Config struct {
// 数据库驱动
Driver string `json:"driver,omitempty"`
// 数据库连接
Source string `json:"source,omitempty"`
ConnMaxLifetimeSeconds int64 `json:"conn_max_lifetime_seconds,omitempty"`
MaxOpenConns int32 `json:"max_open_conns,omitempty"`
MinIdleConns int32 `json:"min_idle_conns,omitempty"`
MaxRetries int32 `json:"max_retries,omitempty"`
}
func (x *Config) GetDriver() string {
if x != nil {
return x.Driver
}
return ""
}
func (x *Config) GetSource() string {
if x != nil {
return x.Source
}
return ""
}
func (x *Config) GetConnMaxLifetimeSeconds() int64 {
if x != nil {
return x.ConnMaxLifetimeSeconds
}
return 0
}
func (x *Config) GetMaxOpenConns() int32 {
if x != nil {
return x.MaxOpenConns
}
return 0
}
func (x *Config) GetMinIdleConns() int32 {
if x != nil {
return x.MinIdleConns
}
return 0
}
func (x *Config) GetMaxRetries() int32 {
if x != nil {
return x.MaxRetries
}
return 0
}