-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.go
33 lines (28 loc) · 984 Bytes
/
types.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
package qgoconf
import "errors"
const (
DefaultConfigType = "yaml"
EvnPrefix = "FLUENT"
DefaultConfigFile = "config.yaml"
TestConfigFile = "config.test.yaml"
DevConfigFile = "config.dev.yaml"
ProdConfigFile = "config.prod.yaml"
)
var ErrConfigNotPtrToStruct = errors.New("config must be a pointer to struct")
// DBConfig is the configurations for connecting database
type DBConfig struct {
Driver string // db driver name: sqlite, mysql, postgres
DSN string // db connection string
}
// HTTPConfig is the configurations for HTTP server
type HTTPConfig struct {
Address string // listen address: ":8080"
//Https bool `json:"https"` // enable https?
//TLSCertPath string `json:"tls_cert_path"` // path to tls cert file
//TLSKeyPath string `json:"tls_key_path"` // path to tls key file
}
type BaseConfig struct {
DB DBConfig // database config
HTTP HTTPConfig // http listen config
LogLevel string // logging level
}