Documentation ¶
Index ¶
- Constants
- Variables
- func ResetRankTree(rtype int32)
- type RankInfo
- type RankTree
- func (rt *RankTree) AddRankInfo(uid int64, val int64, timestamp int64)
- func (rt *RankTree) IncrRankInfo(uid int64, val int64, timestamp int64)
- func (rt *RankTree) QueryByRank(rank int32) *RankInfo
- func (rt *RankTree) QueryByRankRange(min, max int32) []*RankInfo
- func (rt *RankTree) QueryRankInfo(uid int64) *RankInfo
- func (rt *RankTree) RemoveRankInfo(uid int64) bool
- func (rt *RankTree) UpdateRankInfo(uid int64, val int64, timestamp int64)
Constants ¶
View Source
const SKIPLIST_MAXLEVEL = 32
跳跃表最大层数
View Source
const SKIPLIST_P = 0.25
随机概率
Variables ¶
View Source
var (
RTS map[int32]*RankTree
)
Functions ¶
func ResetRankTree ¶
func ResetRankTree(rtype int32)
Types ¶
type RankTree ¶
func GetRankTree ¶
func NewRankTree ¶
func NewRankTree() *RankTree
func (*RankTree) AddRankInfo ¶
添加新排名信息
func (*RankTree) IncrRankInfo ¶
增加个人排行榜数据
func (*RankTree) QueryByRankRange ¶
查询指定范围排名
Click to show internal directories.
Click to hide internal directories.