zwpanel/service/global/global.go
2024-01-04 12:08:39 +08:00

41 lines
1.0 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package global
import (
"sun-panel/initialize/database"
"sun-panel/lib/cache"
"sun-panel/lib/cmn/systemSetting"
"sun-panel/lib/iniConfig"
"sun-panel/lib/language"
"sun-panel/models"
redis "github.com/redis/go-redis/v9"
"go.uber.org/zap"
"gorm.io/gorm"
)
var (
ISDOCKER = "" // 是否为docker模式运行
RUNCODE = "debug" // 运行模式debug | release
// DB_MYSQL = "mysql"
// DB_SQLITE = "sqlite"
DB_DRIVER = database.SQLITE
)
// var Log *cmn.LogStruct
var (
Lang *language.LangStructObj
UserToken cache.Cacher[models.User]
CUserToken cache.Cacher[string] // 用户token
Logger *zap.SugaredLogger
LoggerLevel = zap.NewAtomicLevel() // 支持通过http以及配置文件动态修改日志级别
VerifyCodeCachePool cache.Cacher[string]
Config *iniConfig.IniConfig
Db *gorm.DB
RedisDb *redis.Client
SystemSetting *systemSetting.SystemSettingCache
SystemMonitor cache.Cacher[interface{}]
RateLimit *RateLimiter
)