Documentation ¶
Index ¶
Constants ¶
View Source
const (
// PrefixUserFollowerCacheKey cache prefix
PrefixUserFollowerCacheKey = "user:follower:%d_%d"
)
View Source
const (
// PrefixUserFollowingCacheKey cache prefix
PrefixUserFollowingCacheKey = "user:following:%d_%d"
)
Variables ¶
View Source
var ProviderSet = wire.NewSet(redis.Init, NewUserFollowerCache, NewUserFollowingCache)
ProviderSet is cache providers.
Functions ¶
This section is empty.
Types ¶
type UserFollowerCache ¶
type UserFollowerCache interface { SetUserFollowerCache(ctx context.Context, userID, followedUID int64, data *model.UserFollowerModel, duration time.Duration) error GetUserFollowerCache(ctx context.Context, userID, followedUID int64) (data *model.UserFollowerModel, err error) DelUserFollowerCache(ctx context.Context, userID, followedUID int64) error }
UserFollower define cache interface
func NewUserFollowerCache ¶
func NewUserFollowerCache(rdb *redis.Client) UserFollowerCache
NewUserFollowerCache new a cache
type UserFollowingCache ¶
type UserFollowingCache interface { SetUserFollowingCache(ctx context.Context, userID, followedUID int64, data *model.UserFollowingModel, duration time.Duration) error GetUserFollowingCache(ctx context.Context, userID, followedUID int64) (data *model.UserFollowingModel, err error) DelUserFollowingCache(ctx context.Context, userID, followedUID int64) error }
UserFollowing define cache interface
func NewUserFollowingCache ¶
func NewUserFollowingCache(rdb *redis.Client) UserFollowingCache
NewUserFollowingCache new a cache
Click to show internal directories.
Click to hide internal directories.