mirror of
https://github.com/lejianwen/rustdesk-api.git
synced 2025-11-29 00:23:18 +00:00
41 lines
1.2 KiB
Go
41 lines
1.2 KiB
Go
package global
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
ut "github.com/go-playground/universal-translator"
|
|
"github.com/go-playground/validator/v10"
|
|
"github.com/go-redis/redis/v8"
|
|
"github.com/lejianwen/rustdesk-api/v2/config"
|
|
"github.com/lejianwen/rustdesk-api/v2/lib/cache"
|
|
"github.com/lejianwen/rustdesk-api/v2/lib/jwt"
|
|
"github.com/lejianwen/rustdesk-api/v2/lib/lock"
|
|
"github.com/lejianwen/rustdesk-api/v2/lib/upload"
|
|
"github.com/lejianwen/rustdesk-api/v2/utils"
|
|
"github.com/nicksnyder/go-i18n/v2/i18n"
|
|
"github.com/sirupsen/logrus"
|
|
"github.com/spf13/viper"
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
var (
|
|
DB *gorm.DB
|
|
Logger *logrus.Logger
|
|
ConfigPath string = ""
|
|
Config config.Config
|
|
Viper *viper.Viper
|
|
Redis *redis.Client
|
|
Cache cache.Handler
|
|
Validator struct {
|
|
Validate *validator.Validate
|
|
UT *ut.UniversalTranslator
|
|
VTrans ut.Translator
|
|
ValidStruct func(*gin.Context, interface{}) []string
|
|
ValidVar func(ctx *gin.Context, field interface{}, tag string) []string
|
|
}
|
|
Oss *upload.Oss
|
|
Jwt *jwt.Jwt
|
|
Lock lock.Locker
|
|
Localizer func(lang string) *i18n.Localizer
|
|
LoginLimiter *utils.LoginLimiter
|
|
)
|