adventofcode

package
v0.0.0-...-08d1441 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CachedLeaderboard

type CachedLeaderboard struct {
	Leaderboard Leaderboard
	RetrievedAt time.Time
}

type Client

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

Client is the client for the Advent of Code API.

func NewClient

func NewClient(session string) (*Client, error)

NewClient initializes a new client.

func (*Client) GetLeaderboard

func (client *Client) GetLeaderboard(leaderboardId string, event string) (CachedLeaderboard, error)

GetLeaderboard returns the leaderboard for a given private leaderboard ID and event.

type DayCompletionStats

type DayCompletionStats map[string]StarDetails

type Leaderboard

type Leaderboard struct {
	OwnerID json.Number                  `json:"owner_id"`
	Members map[string]LeaderboardMember `json:"members"`
	Event   string                       `json:"event"`
}

type LeaderboardMember

type LeaderboardMember struct {
	LastStarTS         json.Number                   `json:"last_star_ts"`
	Stars              int                           `json:"stars"`
	LocalScore         int                           `json:"local_score"`
	ID                 json.Number                   `json:"id"`
	GlobalScore        int                           `json:"global_score"`
	Name               string                        `json:"name"`
	CompletionDayLevel map[string]DayCompletionStats `json:"completion_day_level"`
}

type StarDetails

type StarDetails struct {
	GetStarTS json.Number `json:"get_star_ts"`
}

Jump to

Keyboard shortcuts

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