-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.go
24 lines (21 loc) · 800 Bytes
/
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
// Package config manages all app-level configs.
package config
// Config is the root struct that holds all app-level configs.
// One common use case is to create an empty value of Config
// and unmarshal values into it from sources like viper so that
// app-level configs don't vary throughout the whole lifecycle
// of the app.
type Config struct {
MySQL *MySQLConfig `json:"mysql" mapstructure:"mysql"`
REST *RESTServerConfig `json:"rest" mapstructure:"rest"`
GRPC *GRPCServerConfig `json:"grpc" mapstructure:"grpc"`
Config string `json:"config" mapstructure:"config"`
}
// NewEmptyConfig returns an empty value of Config.
func NewEmptyConfig() *Config {
return &Config{
MySQL: newEmptyMySQLConfig(),
REST: newEmptyRESTServerConfig(),
GRPC: newEmptyGRPCServerConfig(),
}
}