mirror of
https://github.com/go-eagle/eagle.git
synced 2025-10-05 08:36:51 +08:00

* 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>
21 lines
473 B
Go
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
|
|
}
|