Documentation
¶
Index ¶
Constants ¶
View Source
const ( // PrefixUserTokenCacheKey cache prefix PrefixUserTokenCacheKey = "user:token:%d" UserTokenExpireTime = 24 * time.Hour * 30 )
View Source
const (
// PrefixUserCacheKey cache prefix
PrefixUserCacheKey = "user:%d"
)
Variables ¶
View Source
var ProviderSet = wire.NewSet(redis.Init, NewUserCache)
ProviderSet is cache providers.
Functions ¶
This section is empty.
Types ¶
type UserCache ¶
type UserCache interface { SetUserCache(ctx context.Context, id int64, data *model.UserModel, duration time.Duration) error GetUserCache(ctx context.Context, id int64) (ret *model.UserModel, err error) MultiGetUserCache(ctx context.Context, ids []int64) (map[string]*model.UserModel, error) MultiSetUserCache(ctx context.Context, data []*model.UserModel, duration time.Duration) error DelUserCache(ctx context.Context, id int64) error SetCacheWithNotFound(ctx context.Context, id int64) error }
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.