i18n翻译
This commit is contained in:
28
internal/util/cache.go
Normal file
28
internal/util/cache.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package util
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gcache"
|
||||
)
|
||||
|
||||
var RedisCache = func() *gcache.Cache {
|
||||
cache := gcache.New()
|
||||
cache.SetAdapter(gcache.NewAdapterRedis(g.Redis()))
|
||||
return cache
|
||||
}()
|
||||
|
||||
// Info 全局Info日志
|
||||
func Info(ctx context.Context, args ...interface{}) {
|
||||
g.Log().Info(ctx, args...)
|
||||
}
|
||||
|
||||
// Debug 全局Debug日志
|
||||
func Debug(ctx context.Context, args ...interface{}) {
|
||||
g.Log().Debug(ctx, args...)
|
||||
}
|
||||
|
||||
// Error 全局Error日志
|
||||
func Error(ctx context.Context, args ...interface{}) {
|
||||
g.Log().Error(ctx, args...)
|
||||
}
|
||||
Reference in New Issue
Block a user