feat config
This commit is contained in:
37
Server/common/config/config.go
Normal file
37
Server/common/config/config.go
Normal file
@@ -0,0 +1,37 @@
|
||||
package config
|
||||
|
||||
type AppConfig struct {
|
||||
Name string `yaml:"name"`
|
||||
}
|
||||
|
||||
type LogConfig struct {
|
||||
Debug bool `yaml:"debug"`
|
||||
MaxSize int `yaml:"maxSize"`
|
||||
MaxBackups int `yaml:"maxBackups"`
|
||||
MaxAge int `yaml:"maxAge"`
|
||||
Level string `yaml:"level"`
|
||||
}
|
||||
|
||||
type DBConfig struct {
|
||||
Etcd *struct {
|
||||
Address []string `yaml:"address"`
|
||||
} `yaml:"etcd"`
|
||||
}
|
||||
|
||||
type ServeConfig struct {
|
||||
Grpc *struct {
|
||||
Address string `yaml:"address"`
|
||||
Port int `yaml:"port"`
|
||||
TTL int64 `yaml:"ttl"`
|
||||
} `yaml:"grpc"`
|
||||
Socket *struct {
|
||||
Web *AddressConfig `yaml:"web"`
|
||||
Raw *AddressConfig `yaml:"raw"`
|
||||
} `yaml:"socket"`
|
||||
Http *AddressConfig `yaml:"http"`
|
||||
}
|
||||
|
||||
type AddressConfig struct {
|
||||
Address string `yaml:"address"`
|
||||
Port int `yaml:"port"`
|
||||
}
|
||||
Reference in New Issue
Block a user