Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type ArticleCache ¶
type ArticleCache interface { SetFirstPage(ctx context.Context, arts []domain.Article, authorId int64) error GetFirstPage(ctx context.Context, authorId int64) ([]domain.Article, error) EraseFirstPage(ctx context.Context, authorId int64) error Set(ctx context.Context, art domain.Article) error Get(ctx context.Context, id int64) (domain.Article, error) SetPub(ctx context.Context, art domain.PublishedArticle) error GetPub(ctx context.Context, id int64) (domain.PublishedArticle, error) }
func NewArticleCache ¶
func NewArticleCache(cmd redis.Cmdable) ArticleCache
type CodeCache ¶
type CodeCache interface { Set(ctx context.Context, biz, phone, code string) error Verify(ctx context.Context, biz, phone, input string) (bool, error) }
func NewRedisCodeCache ¶
func NewRedisCodeCache(cmd redis.Cmdable) CodeCache
type LocalCodeCache ¶
type LocalCodeCache struct {
// contains filtered or unexported fields
}
func NewLocalCodeCache ¶
func NewLocalCodeCache(cache *lru.Cache, expiry time.Duration) *LocalCodeCache
type RankingCache ¶
type RankingCache interface {
ReplaceTopN(ctx context.Context, arts []domain.PublishedArticle) error
}
func NewRankingCache ¶
func NewRankingCache(client redis.Cmdable, key string, expiration time.Duration) RankingCache
type RedisCodeCache ¶
type RedisCodeCache struct {
// contains filtered or unexported fields
}
type UserActivityCache ¶
type UserActivityCache interface {
IncrReadCntIfPresent(ctx context.Context, biz string, bizId int64) error
}
func NewUserActivityCache ¶
func NewUserActivityCache(client redis.Cmdable) UserActivityCache
type UserCache ¶
type UserCache interface { Get(context.Context, int64) (domain.User, error) Set(context.Context, domain.User) error }
func NewRedisUserCache ¶
type UserRedisCache ¶
type UserRedisCache struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.