cache

package
v0.0.0-...-fca9ab1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 14, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL