mirror of
https://github.com/go-eagle/eagle.git
synced 2025-11-03 11:30:56 +08:00
21 lines
470 B
Go
21 lines
470 B
Go
package cache
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/go-eagle/eagle/internal/model"
|
|
"github.com/go-eagle/eagle/pkg/cache"
|
|
"github.com/go-eagle/eagle/pkg/encoding"
|
|
"github.com/go-eagle/eagle/pkg/redis"
|
|
)
|
|
|
|
func getCacheClient(ctx context.Context) cache.Cache {
|
|
jsonEncoding := encoding.JSONEncoding{}
|
|
cachePrefix := ""
|
|
client := cache.NewRedisCache(redis.RedisClient, cachePrefix, jsonEncoding, func() interface{} {
|
|
return &model.UserBaseModel{}
|
|
})
|
|
|
|
return client
|
|
}
|