-
Notifications
You must be signed in to change notification settings - Fork 24
/
struct.go
42 lines (34 loc) · 928 Bytes
/
struct.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
package config
type datasourceType string
const (
Mysql datasourceType = "mysql"
BTree datasourceType = "btree"
)
type server struct {
Host string `mapstructure:"host"`
Port string `mapstructure:"port"`
TLS serverTLS `mapstructure:"tls"`
}
type serverTLS struct {
Cert string `mapstructure:"cert"`
Key string `mapstructure:"key"`
}
type log struct {
Level string `mapstructure:"level"`
}
type mysqlConfig struct {
Host string `mapstructure:"host"`
Port string `mapstructure:"port"`
Username string `mapstructure:"username"`
Password string `mapstructure:"password"`
Database string `mapstructure:"database"`
}
type datasource struct {
Type datasourceType `mapstructure:"type"`
MySQL mysqlConfig `mapstructure:"mysql"`
}
type config struct {
Server server `mapstructure:"server"`
Log log `mapstructure:"log"`
DataSource datasource `mapstructure:"datasource"`
}