Add cursor rules and initial configuration for Tender Management Go Backend
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"tm/infra"
|
||||
"tm/pkg/logger"
|
||||
)
|
||||
|
||||
// Init Application Configuration
|
||||
func intiConfig() infra.Config {
|
||||
config, err := infra.LoadConfig("./")
|
||||
if err != nil {
|
||||
panic(fmt.Sprintf("Failed to load config: %v", err))
|
||||
}
|
||||
|
||||
return *config
|
||||
}
|
||||
|
||||
// Init Logger Service
|
||||
func initLogger(conf infra.LoggingConfig) logger.Logger {
|
||||
return logger.NewLogger(&logger.Config{
|
||||
Level: conf.Level,
|
||||
Format: conf.Format,
|
||||
Output: conf.Output,
|
||||
File: logger.FileConfig{
|
||||
Path: conf.File.Path,
|
||||
MaxSize: conf.File.MaxSize,
|
||||
MaxBackups: conf.File.MaxBackups,
|
||||
MaxAge: conf.File.MaxAge,
|
||||
Compress: conf.File.Compress,
|
||||
},
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user