rediscache

package
v0.0.0-...-24b49fa Latest Latest
Warning

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

Go to latest
Published: May 22, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoCodeExp = errors.New("verification code exists but has no expiration date")

Functions

func NewArticleRedisCache

func NewArticleRedisCache(client redis.Cmdable) cache.ArticleCache

func NewCodeRedisCache

func NewCodeRedisCache(cmd redis.Cmdable) cache.CodeCache

func NewRankingRedisCache

func NewRankingRedisCache(client redis.Cmdable) cache.RankingCache

func NewUserRedisCache

func NewUserRedisCache(cmd redis.Cmdable) cache.UserCache

Types

type ArticleRedisCache

type ArticleRedisCache struct {
	cache.BaseArticleCache
	// contains filtered or unexported fields
}

func (*ArticleRedisCache) BatchGetPub

func (a *ArticleRedisCache) BatchGetPub(
	ctx context.Context,
	ids []int64,
) ([]domain.Article, error)

BatchGetPub implements cache.ArticleCache.

func (*ArticleRedisCache) BatchSetPub

func (a *ArticleRedisCache) BatchSetPub(ctx context.Context, articles []domain.Article) error

BatchSetPub implements cache.ArticleCache.

func (*ArticleRedisCache) DelFirstPage

func (a *ArticleRedisCache) DelFirstPage(ctx context.Context, uid int64) error

DelFirstPage implements cache.ArticleCache.

func (*ArticleRedisCache) Get

Get implements cache.ArticleCache.

func (*ArticleRedisCache) GetFirstPage

func (a *ArticleRedisCache) GetFirstPage(ctx context.Context, uid int64) ([]domain.Article, error)

GetFirstPage implements cache.ArticleCache.

func (*ArticleRedisCache) GetPub

func (a *ArticleRedisCache) GetPub(ctx context.Context, id int64) (domain.Article, error)

GetPub implements cache.ArticleCache.

func (*ArticleRedisCache) Set

func (a *ArticleRedisCache) Set(ctx context.Context, article domain.Article) error

Set implements cache.ArticleCache.

func (*ArticleRedisCache) SetFirstPage

func (a *ArticleRedisCache) SetFirstPage(
	ctx context.Context,
	uid int64,
	articles []domain.Article,
) error

SetFirstPage implements cache.ArticleCache.

func (*ArticleRedisCache) SetPub

func (a *ArticleRedisCache) SetPub(ctx context.Context, article domain.Article) error

SetPub implements cache.ArticleCache.

type CodeRedisCache

type CodeRedisCache struct {
	cache.BaseCodeCache
	// contains filtered or unexported fields
}

func (*CodeRedisCache) Set

func (c *CodeRedisCache) Set(ctx context.Context, biz, phone, code string) error

func (*CodeRedisCache) Verify

func (c *CodeRedisCache) Verify(ctx context.Context, biz, phone, code string) (bool, error)

type RankingRedisCache

type RankingRedisCache struct {
	cache.BaseRankingCache
	// contains filtered or unexported fields
}

func (*RankingRedisCache) Get

Get implements cache.RankingCache.

func (*RankingRedisCache) Set

func (r *RankingRedisCache) Set(ctx context.Context, arts []domain.Article) error

Set implements cache.RankingCache.

type UserRedisCache

type UserRedisCache struct {
	cache.BaseUserCache
	// contains filtered or unexported fields
}

func (*UserRedisCache) BatchGet

func (c *UserRedisCache) BatchGet(ctx context.Context, uids []int64) ([]domain.User, error)

BatchGet implements cache.UserCache.

func (*UserRedisCache) BatchSet

func (c *UserRedisCache) BatchSet(ctx context.Context, users []domain.User) error

BatchSet implements cache.UserCache.

func (*UserRedisCache) Get

func (c *UserRedisCache) Get(ctx context.Context, uid int64) (domain.User, error)

func (*UserRedisCache) Set

func (c *UserRedisCache) Set(ctx context.Context, user domain.User) error

Directories

Path Synopsis
Package redismock is a generated GoMock package.
Package redismock is a generated GoMock package.

Jump to

Keyboard shortcuts

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