Documentation
¶
Index ¶
- Variables
- func NewArticleRedisCache(client redis.Cmdable) cache.ArticleCache
- func NewCodeRedisCache(cmd redis.Cmdable) cache.CodeCache
- func NewRankingRedisCache(client redis.Cmdable) cache.RankingCache
- func NewUserRedisCache(cmd redis.Cmdable) cache.UserCache
- type ArticleRedisCache
- func (a *ArticleRedisCache) BatchGetPub(ctx context.Context, ids []int64) ([]domain.Article, error)
- func (a *ArticleRedisCache) BatchSetPub(ctx context.Context, articles []domain.Article) error
- func (a *ArticleRedisCache) DelFirstPage(ctx context.Context, uid int64) error
- func (a *ArticleRedisCache) Get(ctx context.Context, id int64) (domain.Article, error)
- func (a *ArticleRedisCache) GetFirstPage(ctx context.Context, uid int64) ([]domain.Article, error)
- func (a *ArticleRedisCache) GetPub(ctx context.Context, id int64) (domain.Article, error)
- func (a *ArticleRedisCache) Set(ctx context.Context, article domain.Article) error
- func (a *ArticleRedisCache) SetFirstPage(ctx context.Context, uid int64, articles []domain.Article) error
- func (a *ArticleRedisCache) SetPub(ctx context.Context, article domain.Article) error
- type CodeRedisCache
- type RankingRedisCache
- type UserRedisCache
- func (c *UserRedisCache) BatchGet(ctx context.Context, uids []int64) ([]domain.User, error)
- func (c *UserRedisCache) BatchSet(ctx context.Context, users []domain.User) error
- func (c *UserRedisCache) Get(ctx context.Context, uid int64) (domain.User, error)
- func (c *UserRedisCache) Set(ctx context.Context, user domain.User) error
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 NewRankingRedisCache ¶
func NewRankingRedisCache(client redis.Cmdable) cache.RankingCache
func NewUserRedisCache ¶
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 ¶
BatchSetPub implements cache.ArticleCache.
func (*ArticleRedisCache) DelFirstPage ¶
func (a *ArticleRedisCache) DelFirstPage(ctx context.Context, uid int64) error
DelFirstPage implements cache.ArticleCache.
func (*ArticleRedisCache) GetFirstPage ¶
GetFirstPage implements cache.ArticleCache.
func (*ArticleRedisCache) SetFirstPage ¶
func (a *ArticleRedisCache) SetFirstPage( ctx context.Context, uid int64, articles []domain.Article, ) error
SetFirstPage implements cache.ArticleCache.
type CodeRedisCache ¶
type CodeRedisCache struct { cache.BaseCodeCache // contains filtered or unexported fields }
type RankingRedisCache ¶
type RankingRedisCache struct { cache.BaseRankingCache // contains filtered or unexported fields }
type UserRedisCache ¶
type UserRedisCache struct { cache.BaseUserCache // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.