forked from lejianwen/rustdesk-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgorm.go
More file actions
30 lines (26 loc) · 864 Bytes
/
gorm.go
File metadata and controls
30 lines (26 loc) · 864 Bytes
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
package config
const (
TypeSqlite = "sqlite"
TypeMysql = "mysql"
TypePostgresql = "postgresql"
)
type Gorm struct {
Type string `mapstructure:"type"`
MaxIdleConns int `mapstructure:"max-idle-conns"`
MaxOpenConns int `mapstructure:"max-open-conns"`
}
type Mysql struct {
Addr string `mapstructure:"addr"`
Username string `mapstructure:"username"`
Password string `mapstructure:"password"`
Dbname string `mapstructure:"dbname"`
}
type Postgresql struct {
Host string `mapstructure:"host"`
Port string `mapstructure:"port"`
User string `mapstructure:"user"`
Password string `mapstructure:"password"`
Dbname string `mapstructure:"dbname"`
Sslmode string `mapstructure:"sslmode"` // "disable", "require", "verify-ca", "verify-full"
TimeZone string `mapstructure:"time-zone"` // e.g., "Asia/Shanghai"
}