Documentation ¶
Index ¶
- Constants
- Variables
- func InitRedis()
- type Collect
- func (c Collect) CheckCollectCt(aHashId string) (error, bool)
- func (c Collect) CollectCtAssign(aHashId string, count int64) error
- func (c Collect) CountCollect(aHashId string) (error, int64)
- func (c Collect) DecrCollect(aHashId string) error
- func (c Collect) DelCollectCt(aHashId string) error
- func (c Collect) GetCollectClient() *redis.Client
- func (c Collect) IncrCollect(aHashId string) error
- type Comment
- func (c Comment) CheckCommentCt(aHashId string) (error, bool)
- func (c Comment) CommentCtAssign(aHashId string, count int64) error
- func (c Comment) CountComment(aHashId string) (error, int64)
- func (c Comment) DecrComment(aHashId string) error
- func (c Comment) DelCommentCt(aHashId string) error
- func (c Comment) GetCommentClient() *redis.Client
- func (c Comment) IncrComment(aHashId string) error
- type Favorite
- func (f Favorite) CancerHate(uHashId, aHashId string) error
- func (f Favorite) CancerLike(uHashId, aHashId string) error
- func (f Favorite) CheckHate(aHashId string) (error, bool)
- func (f Favorite) CheckHateCt(aHashId string) (error, bool)
- func (f Favorite) CheckLike(aHashId string) (error, bool)
- func (f Favorite) CheckLikeCt(aHashId string) (error, bool)
- func (f Favorite) CountHate(aHashId string) (error, int64)
- func (f Favorite) CountLike(aHashId string) (error, int64)
- func (f Favorite) DecrHate(aHashId string) error
- func (f Favorite) DecrLike(aHashId string) error
- func (f Favorite) ExistHate(uHashId, aHashId string) (error, bool)
- func (f Favorite) ExistLike(uHashId, aHashId string) (error, bool)
- func (f Favorite) GetFavoriteClient() *redis.Client
- func (f Favorite) Hate(uHashId, aHashId string) error
- func (f Favorite) HateCtAssign(aHashId string, count int64) error
- func (f Favorite) IncrHate(aHashId string) error
- func (f Favorite) IncrLike(aHashId string) error
- func (f Favorite) Like(uHashId, aHashId string) error
- func (f Favorite) LikeCtAssign(aHashId string, count int64) error
- func (f Favorite) TruncateHateStatus(aHashId string) error
- func (f Favorite) TruncateLikeStatus(aHashId string) error
- type View
- func (c View) CheckViewCt(aHashId string) (error, bool)
- func (c View) CountView(aHashId string) (error, int64)
- func (c View) DecrView(aHashId string) error
- func (c View) DelViewCt(aHashId string) error
- func (c View) GetViewClient() *redis.Client
- func (c View) GetViewMap(aHashIds []string) (error, map[string]int64)
- func (c View) IncrView(aHashId string) error
- func (c View) ViewCtAssign(aHashId string, count int64) error
Constants ¶
View Source
const ( LikeCountSuffix = ":liked_count" HateCountSuffix = ":hated_count" )
View Source
const CollectCountSuffix = ":collect_count"
View Source
const CommentCountSuffix = ":comment_count"
View Source
const ViewCountSuffix = ":view_count"
Variables ¶
View Source
var (
ExpireTime = time.Hour * 3
)
Functions ¶
Types ¶
type Collect ¶
type Collect struct{}
func (Collect) CollectCtAssign ¶
func (Collect) DecrCollect ¶
func (Collect) DelCollectCt ¶
func (Collect) GetCollectClient ¶
func (c Collect) GetCollectClient() *redis.Client
func (Collect) IncrCollect ¶
type Comment ¶
type Comment struct{}
func (Comment) CommentCtAssign ¶
func (Comment) DecrComment ¶
func (Comment) DelCommentCt ¶
func (Comment) GetCommentClient ¶
func (c Comment) GetCommentClient() *redis.Client
func (Comment) IncrComment ¶
type Favorite ¶
type Favorite struct{}
func (Favorite) CancerHate ¶
func (Favorite) CancerLike ¶
func (Favorite) GetFavoriteClient ¶
func (f Favorite) GetFavoriteClient() *redis.Client
func (Favorite) TruncateHateStatus ¶
func (Favorite) TruncateLikeStatus ¶
用户删除文章后,文章点赞依赖删除逻辑:
type View ¶
type View struct{}
func (View) GetViewClient ¶
func (c View) GetViewClient() *redis.Client
Click to show internal directories.
Click to hide internal directories.