redis

package
v0.0.0-...-228285a Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2021 License: GPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyPreFix             = "idea."
	KeyPostTimeZSet       = "post.time"
	KeyPostScoreZSet      = "post.score"
	KeyPostVoteZSetPreFix = "post.vote."
	KeyCommunityIdSet     = "community."
)

key设计,方便查询和拆分

View Source
const (
	OrderTime  = "time"
	OrderScore = "score"
)

Variables

View Source
var (
	ErrVoteTimeExpire = ehandle.RedisVoteTimeExpire
	ErrReVote         = ehandle.RedisReVote
)

Functions

func Close

func Close()

func CreatePost

func CreatePost(p *model.Post) error

func GetPostByCommunityId

func GetPostByCommunityId(p *model.ParamOrder, cid int64) (ids []string, err error)

func GetPostId

func GetPostId(p *model.ParamOrder) (ids []string, err error)

GetPostId 在redis中去除对应的id集合

func GetVoteData

func GetVoteData(ids []string) (data []int64, err error)

GetVoteData 获取帖子的投票信息

func Init

func Init()

func VoteForPost

func VoteForPost(userId, postId string, value float64) error

VoteForPost 添加投票数据

Types

This section is empty.

Jump to

Keyboard shortcuts

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