Files
eagle/internal/cache/cache_client.go
vv06161 1e0d1f1c4f chore: improve template gen (#192)
* chore: improve repo template gen
* chore: import cache template gen
* chore: import protoc-gen-go-gin template gen
* feat: add sonic json encoding

* docs: add feature

Co-authored-by: lvjiapeng <319161@myj.com.cn>
2025-07-19 09:30:48 +08:00

21 lines
473 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 {
sonicEncoding := encoding.SonicEncoding{}
cachePrefix := ""
client := cache.NewRedisCache(redis.RedisClient, cachePrefix, sonicEncoding, func() interface{} {
return &model.UserBaseModel{}
})
return client
}