init
This commit is contained in:
44
global/global.go
Normal file
44
global/global.go
Normal file
@@ -0,0 +1,44 @@
|
||||
package global
|
||||
|
||||
import (
|
||||
"go.uber.org/zap"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
var (
|
||||
Config Configuration
|
||||
Logger *zap.Logger
|
||||
Mdb *gorm.DB
|
||||
)
|
||||
|
||||
type Configuration struct {
|
||||
Server ServerConfig
|
||||
Database DatabaseConfig
|
||||
Logger LoggerConfig
|
||||
}
|
||||
|
||||
type ServerConfig struct {
|
||||
Port string
|
||||
AppEnv string
|
||||
}
|
||||
|
||||
type DatabaseConfig struct {
|
||||
Host string
|
||||
Port string
|
||||
Database string
|
||||
Username string
|
||||
Password string
|
||||
RootPassword string
|
||||
MaxIdleConns int
|
||||
MaxOpenConns int
|
||||
ConnMaxLifetime int
|
||||
}
|
||||
|
||||
type LoggerConfig struct {
|
||||
LogLevel string
|
||||
FileLogName string
|
||||
MaxSize int
|
||||
MaxBackups int
|
||||
MaxAge int
|
||||
Compress bool
|
||||
}
|
Reference in New Issue
Block a user