This commit is contained in:
netscrawler
2024-07-04 00:44:15 +03:00
parent c99f477e35
commit 5b11756af6
15 changed files with 354 additions and 23 deletions
+7
View File
@@ -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 == "" {