Documentation
¶
Index ¶
Constants ¶
View Source
const ( // PrefixUserTokenCacheKey cache prefix PrefixUserTokenCacheKey = "user:token:%d" UserTokenExpireTime = 24 * time.Hour * 30 )
Variables ¶
View Source
var CacheSet = wire.NewSet( redis.Init, NewUserCache, )
CacheSet is cache providers.
View Source
var ( // PrefixUserCacheKey cache prefix PrefixUserCacheKey = utils.ConcatString(prefix, "user:%d") )
Functions ¶
This section is empty.
Types ¶
type UserCache ¶
type UserCache interface {
SetUserCache(ctx context.Context, id int64, data *model.UserInfoModel, duration time.Duration) error
GetUserCache(ctx context.Context, id int64) (data *model.UserInfoModel, err error)
MultiGetUserCache(ctx context.Context, ids []int64) (map[string]*model.UserInfoModel, error)
MultiSetUserCache(ctx context.Context, data []*model.UserInfoModel, duration time.Duration) error
DelUserCache(ctx context.Context, id int64) error
SetCacheWithNotFound(ctx context.Context, id int64) error
}
UserCache define cache interface
type UserTokenCache ¶
type UserTokenCache interface {
SetUserTokenCache(ctx context.Context, id int64, token string, duration time.Duration) error
GetUserTokenCache(ctx context.Context, id int64) (token string, err error)
DelUserTokenCache(ctx context.Context, id int64) error
}
UserToken define cache interface
Click to show internal directories.
Click to hide internal directories.