Documentation
¶
Index ¶
- Variables
- type FollowCache
- type RedisFollowCache
- func (c *RedisFollowCache) CancelFollow(ctx context.Context, uid, followeeId int64) error
- func (c *RedisFollowCache) Follow(ctx context.Context, uid, followeeId int64) error
- func (c *RedisFollowCache) GetStatistic(ctx context.Context, uid int64) (domain.FollowStatistic, error)
- func (c *RedisFollowCache) GetStatisticBatch(ctx context.Context, uids []int64) (map[int64]domain.FollowStatistic, error)
- func (c *RedisFollowCache) SetStatistic(ctx context.Context, statistic domain.FollowStatistic) error
- func (c *RedisFollowCache) SetStatisticBatch(ctx context.Context, stats []domain.FollowStatistic) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrKeyNotFound = redis.Nil
Functions ¶
This section is empty.
Types ¶
type FollowCache ¶
type FollowCache interface { GetStatistic(ctx context.Context, uid int64) (domain.FollowStatistic, error) GetStatisticBatch(ctx context.Context, uids []int64) (map[int64]domain.FollowStatistic, error) SetStatistic(ctx context.Context, stats domain.FollowStatistic) error SetStatisticBatch(ctx context.Context, stats []domain.FollowStatistic) error Follow(ctx context.Context, uid, followeeId int64) error CancelFollow(ctx context.Context, uid, followeeId int64) error }
func NewRedisFollowCache ¶
func NewRedisFollowCache(cmd redis.Cmdable) FollowCache
type RedisFollowCache ¶
type RedisFollowCache struct {
// contains filtered or unexported fields
}
func (*RedisFollowCache) CancelFollow ¶
func (c *RedisFollowCache) CancelFollow(ctx context.Context, uid, followeeId int64) error
func (*RedisFollowCache) Follow ¶
func (c *RedisFollowCache) Follow(ctx context.Context, uid, followeeId int64) error
func (*RedisFollowCache) GetStatistic ¶
func (c *RedisFollowCache) GetStatistic(ctx context.Context, uid int64) (domain.FollowStatistic, error)
func (*RedisFollowCache) GetStatisticBatch ¶
func (c *RedisFollowCache) GetStatisticBatch(ctx context.Context, uids []int64) (map[int64]domain.FollowStatistic, error)
func (*RedisFollowCache) SetStatistic ¶
func (c *RedisFollowCache) SetStatistic(ctx context.Context, statistic domain.FollowStatistic) error
func (*RedisFollowCache) SetStatisticBatch ¶
func (c *RedisFollowCache) SetStatisticBatch(ctx context.Context, stats []domain.FollowStatistic) error
Click to show internal directories.
Click to hide internal directories.