mirror of
https://github.com/netscrawler/changeAPI.git
synced 2026-09-05 08:29:36 +00:00
v0.1
This commit is contained in:
@@ -11,6 +11,7 @@ type Config struct {
|
||||
Env string `yaml:"env" env-default:"local"`
|
||||
TokenTTL time.Duration `yaml:"token_ttl" env-required:"true"`
|
||||
GRPC GRPCConfig `yaml:"grpc"`
|
||||
Redis RedisConfig `yaml:"redis"`
|
||||
}
|
||||
|
||||
type GRPCConfig struct {
|
||||
@@ -18,6 +19,12 @@ type GRPCConfig struct {
|
||||
Timeout time.Duration `yaml:"timeout"`
|
||||
}
|
||||
|
||||
type RedisConfig struct {
|
||||
Addr string `yaml:"addr"`
|
||||
Password string `yaml:"password"`
|
||||
DB int `yaml:"db"`
|
||||
}
|
||||
|
||||
func MustLoad() *Config {
|
||||
path := fetchConfigPath()
|
||||
if path == "" {
|
||||
|
||||
Reference in New Issue
Block a user