leaderboard

package
v0.0.0-...-359cf57 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ByTimestamp

type ByTimestamp []Star

func (ByTimestamp) Len

func (s ByTimestamp) Len() int

func (ByTimestamp) Less

func (s ByTimestamp) Less(i, j int) bool

func (ByTimestamp) Swap

func (s ByTimestamp) Swap(i, j int)

type Leaderboard

type Leaderboard struct {
	Members map[string]MemberInfo `json:"members"`
	OwnerId string                `json:"owner_id"`
	Event   string                `json:"event"`
}

func FetchLeaderboard

func FetchLeaderboard(session string, leaderboardId string, year int) (*Leaderboard, error)

func LeaderboardFromJson

func LeaderboardFromJson(leaderboard []byte) (*Leaderboard, error)

func (*Leaderboard) Stars

func (l *Leaderboard) Stars() []Star

func (*Leaderboard) StarsByDay

func (l *Leaderboard) StarsByDay(day int) []Star

func (*Leaderboard) StarsByMemberId

func (l *Leaderboard) StarsByMemberId(id string) []Star

type MemberInfo

type MemberInfo struct {
	LastStarTimestamp  *time.Time               `json:"last_star_ts"`
	GlobalScore        int                      `json:"global_score"`
	LocalScore         int                      `json:"local_score"`
	Id                 string                   `json:"id"`
	CompletionDayLevel map[int]map[int]StarInfo `json:"completion_day_level"`
	Stars              int                      `json:"starts"`
	Name               string                   `json:"name"`
}

type Star

type Star struct {
	MemberId   string
	MemberName string
	Day        int
	Level      int
	Timestamp  time.Time
}

type StarInfo

type StarInfo struct {
	StarTimestamp time.Time `json:"get_star_ts"`
}

Jump to

Keyboard shortcuts

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