Documentation
¶
Index ¶
- func Score(scores ...int64) []num
- type ErrorUnMarshalRead
- type Member
- type Rank
- func (r *Rank) Add(key string, scores []num) *Rank
- func (r *Rank) Del(key string) *Rank
- func (r *Rank) Get(rankSection ...int) []Member
- func (r *Rank) GetByKey(key string) (int, Member)
- func (r *Rank) GetByScore(floorScores, roofScores []int64) []Member
- func (r *Rank) Len() int
- func (r *Rank) Marshal() []byte
- func (r *Rank) UnMarshal(data []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ErrorUnMarshalRead ¶
type ErrorUnMarshalRead struct {
// contains filtered or unexported fields
}
func (ErrorUnMarshalRead) Error ¶
func (s ErrorUnMarshalRead) Error() string
type Rank ¶
type Rank struct {
// contains filtered or unexported fields
}
func (*Rank) Add ¶
Add 例子: Rank.Add("xxxx",rank.Score(999)) 单分排行 Rank.Add("xxxx",rank.Score(999,123,456)) 多分排行
func (*Rank) Get ¶
Get rankSection 名次区间 例子: members := Rank.Get() 获得全部名次 members := Rank.Get(1) 获得1名 members := Rank.Get(3) 获得3名 members := Rank.Get(1,100) 获得1~100名
func (*Rank) GetByScore ¶
GetByScore scoreSection 分数区间 例子: Rank.GetByScore([]int64{100},[]int64{900}) 获得分数为100~999区间的集合
Click to show internal directories.
Click to hide internal directories.