Refactor configuration management by migrating to a modular config system
- Removed the old `infra.Config` structure and replaced it with a new modular configuration system in `pkg/config`. - Introduced a `Config` struct in `cmd/web/config.go` to hold command-specific configurations. - Updated configuration loading functions to utilize the new `LoadConfig` method with generics for type safety. - Adjusted various initialization functions in `cmd/web/bootstrap.go` and `cmd/web/main.go` to reflect the new configuration structure. - Cleaned up the `config.yaml` by removing obsolete fields and ensuring it aligns with the new configuration schema.
This commit is contained in:
+2
-2
@@ -80,8 +80,8 @@ func main() {
|
||||
}()
|
||||
|
||||
// Initialize authorization service
|
||||
userAuthService := initAuthorizationService(conf.UserAuthorization.JWT, redisClient, logger)
|
||||
customerAuthService := initAuthorizationService(conf.CustomerAuthorization.JWT, redisClient, logger)
|
||||
userAuthService := initAuthorizationService(conf.UserAuth.JWT, redisClient, logger)
|
||||
customerAuthService := initAuthorizationService(conf.CustomerAuth.JWT, redisClient, logger)
|
||||
|
||||
// Initialize repositories with MongoDB connection manager
|
||||
userRepository := user.NewUserRepository(mongoManager, logger)
|
||||
|
||||
Reference in New Issue
Block a user