rank

package
v1.4.15 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorUnMarshalRead

type ErrorUnMarshalRead struct {
	// contains filtered or unexported fields
}

func (ErrorUnMarshalRead) Error

func (s ErrorUnMarshalRead) Error() string

type Member

type Member struct {
	Key    string
	Scores []num
}

func (Member) Less

func (s Member) Less(other interface{}) bool

type Rank

type Rank struct {
	// contains filtered or unexported fields
}

func New

func New() *Rank

func (*Rank) Add

func (r *Rank) Add(key string, scores ...int64) *Rank

Add Rank.Add("xxxx",999) 单分排行 Rank.Add("xxxx",999,123,456) 多分排行

func (*Rank) Del

func (r *Rank) Del(key string) *Rank

func (*Rank) Get

func (r *Rank) Get(rankSection ...int) []Member

Get rankSection 名次区间 Rank.Get() 获得全部名次 Rank.Get(1) 获得1名 Rank.Get(1,100) 获得1~100名

func (*Rank) GetByKey

func (r *Rank) GetByKey(key string) (int, Member)

GetByKey 查找key的名次、分数,找不到返回0

func (*Rank) GetByScore

func (r *Rank) GetByScore(floorScores, roofScores []int64) []Member

GetByScore scoreSection 分数区间 Rank.GetByScore([]int64{100},[]int64{900}) 获得分数为100~999区间的集合

func (*Rank) Len

func (r *Rank) Len() int

func (*Rank) Marshal

func (r *Rank) Marshal() []byte

func (*Rank) UnMarshal

func (r *Rank) UnMarshal(data []byte) error

Jump to

Keyboard shortcuts

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