forked from flyteorg/datacatalog
/
database.go
27 lines (24 loc) · 896 Bytes
/
database.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
package config
//go:generate pflags DbConfigSection
// This struct corresponds to the database section of in the config
type DbConfigSection struct {
Host string `json:"host"`
Port int `json:"port"`
DbName string `json:"dbname"`
User string `json:"username"`
// Either Password or PasswordPath must be set.
Password string `json:"password"`
PasswordPath string `json:"passwordPath"`
// See http://gorm.io/docs/connecting_to_the_database.html for available options passed, in addition to the above.
ExtraOptions string `json:"options"`
}
// Database config. Contains values necessary to open a database connection.
type DbConfig struct {
BaseConfig
Host string `json:"host"`
Port int `json:"port"`
DbName string `json:"dbname"`
User string `json:"user"`
Password string `json:"password"`
ExtraOptions string `json:"options"`
}