redis

package
v0.0.0-...-a93d61e Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2021 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyPrefix        = "bluebell:"
	KeyPostTime      = "post:time"         //zset; postId:publishTime,eg: 12347:11889901
	KeyPostScore     = "post:score"        //zset; postId:voteNum,eg:12347:1000
	KeyPostVoted     = "post:voted:%s"     //zset; 参数为 postId
	KeyCommunityPost = "post:community:%s" //set 参数为社区id
)

Variables

This section is empty.

Functions

func Close

func Close()

func GetCommunityPostIds

func GetCommunityPostIds(communityKey string, orderType int8, page, pageSize int64) ([]string, error)

GetCommunityPostIds 根据社区筛选postId

func GetKeyCommunityPost

func GetKeyCommunityPost(communityId string) string

GetKeyPostVoted 获取文章下用户投票记录

func GetKeyPostScore

func GetKeyPostScore() string

GetKeyPostScore 获取文章得票数redis key

func GetKeyPostTime

func GetKeyPostTime() string

GetKeyPostTime 获取文章发布时间redis key

func GetKeyPostVoted

func GetKeyPostVoted(postId string) string

GetKeyPostVoted 获取文章下用户投票记录

func GetPostIdsByScore

func GetPostIdsByScore(start, stop int64) []string

GetPostIdsByScore 根据分数获取帖子指定范围的ids

func GetPostIdsByTime

func GetPostIdsByTime(start, stop int64) []string

GetPostIdsByTime 根据时间获取帖子指定范围的ids

func GetPostPublishTime

func GetPostPublishTime(postId string) float64

GetPostPublishTime 获取文章发布时间

func GetPostVoteNums

func GetPostVoteNums(postIds []string) ([]int64, error)

GetPostVoteNums 获取帖子投赞成票的数量

func GetPostVoteUser

func GetPostVoteUser(postId int64, userId string) float64

GetPostVoteUser 获取文章投票记录

func Init

func Init(redisConf *settings.RedisConf)

func RemUserVoteRecord

func RemUserVoteRecord(postId, userId int64) error

RemUserVoteRecord 移除用户投票记录

func SaveCommunityPost

func SaveCommunityPost(communityId string, postId int64) error

SaveCommunityPost 保存社区下的帖子数据

func SavePostPublishTime

func SavePostPublishTime(postId int64) error

SavePostPublishTime 保存帖子发布时间

func SaveUserVoteRecord

func SaveUserVoteRecord(postId, userId int64, direction float64) error

SaveUserVoteRecord 保存用户投票记录

func SetPostScore

func SetPostScore(postId string, score float64) error

SetPostScore 设置文章分数

Types

This section is empty.

Jump to

Keyboard shortcuts

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