Documentation
¶
Index ¶
- Variables
- type ArticleCache
- type CodeCache
- type InteractiveCache
- type LocalCodeCache
- type RedisCodeCache
- type RedisInteractiveCache
- func (cache *RedisInteractiveCache) DecrLikeCntIfPresent(ctx context.Context, bizID int64, biz string) error
- func (cache *RedisInteractiveCache) Get(ctx context.Context, id int64, biz string) (domain.Interactive, error)
- func (cache *RedisInteractiveCache) IncrCollectCntIfPresent(ctx context.Context, bizID int64, id int64, biz string) error
- func (cache *RedisInteractiveCache) IncrLikeCntIfPresent(ctx context.Context, bizID int64, biz string) error
- func (cache *RedisInteractiveCache) IncrReadCntIfPresent(ctx context.Context, bizID int64, biz string) error
- func (cache *RedisInteractiveCache) Set(ctx context.Context, id int64, biz string, int domain.Interactive) error
- type RedisUserCache
- type UserCache
Constants ¶
This section is empty.
Variables ¶
View Source
var SetCodeScript string
View Source
var VerifyCodeScript string
Functions ¶
This section is empty.
Types ¶
type ArticleCache ¶
type ArticleCache interface { SetDetail(ctx context.Context, uid, id int64, art domain.Article) error GetDetail(ctx context.Context, uid, id int64) (domain.Article, error) GetPubDetail(ctx context.Context, uid int64, id int64) (domain.Article, error) SetPubDetail(ctx context.Context, uid int64, id int64, art domain.Article) error }
func NewRedisArticleCache ¶
func NewRedisArticleCache(cmd redis.Cmdable) ArticleCache
type CodeCache ¶
type CodeCache interface { Set(ctx context.Context, biz, phone, code string) error Verify(ctx context.Context, biz, phone, code string) (bool, error) }
func NewRedisCodeCache ¶
func NewRedisCodeCache(cmd redis.Cmdable) CodeCache
type InteractiveCache ¶
type InteractiveCache interface { IncrReadCntIfPresent(ctx context.Context, bizID int64, biz string) error IncrLikeCntIfPresent(ctx context.Context, bizID int64, biz string) error DecrLikeCntIfPresent(ctx context.Context, bizID int64, biz string) error IncrCollectCntIfPresent(ctx context.Context, bizID int64, id int64, biz string) error Get(ctx context.Context, id int64, biz string) (domain.Interactive, error) Set(ctx context.Context, id int64, biz string, int domain.Interactive) error }
func NewInteractiveCache ¶
func NewInteractiveCache(client redis.Cmdable) InteractiveCache
type LocalCodeCache ¶
type LocalCodeCache struct {
// contains filtered or unexported fields
}
type RedisCodeCache ¶
type RedisCodeCache struct {
// contains filtered or unexported fields
}
type RedisInteractiveCache ¶
type RedisInteractiveCache struct {
// contains filtered or unexported fields
}
func (*RedisInteractiveCache) DecrLikeCntIfPresent ¶
func (*RedisInteractiveCache) Get ¶
func (cache *RedisInteractiveCache) Get(ctx context.Context, id int64, biz string) (domain.Interactive, error)
func (*RedisInteractiveCache) IncrCollectCntIfPresent ¶
func (*RedisInteractiveCache) IncrLikeCntIfPresent ¶
func (*RedisInteractiveCache) IncrReadCntIfPresent ¶
func (*RedisInteractiveCache) Set ¶
func (cache *RedisInteractiveCache) Set(ctx context.Context, id int64, biz string, int domain.Interactive) error
type RedisUserCache ¶
type RedisUserCache struct {
// contains filtered or unexported fields
}
func (*RedisUserCache) Key ¶
func (cache *RedisUserCache) Key(id int64) string
Click to show internal directories.
Click to hide internal directories.