Documentation
¶
Index ¶
Constants ¶
View Source
const ( URL = "https://adventofcode.com/" Favicon = URL + "favicon.png" )
View Source
const TotalDays = 25
Variables ¶
View Source
var Client = http.Client{ Timeout: 5 * time.Second, }
View Source
var DayDuration = 24 * time.Hour
DayDuration is one day, or 24 hours.
EST is the timezone for Eastern Time (no DST).
Functions ¶
Types ¶
type DayCompletedParts ¶
func (DayCompletedParts) Completed ¶
func (d DayCompletedParts) Completed() bool
type DaysCompleted ¶
type DaysCompleted []DayCompletedParts
Days start from 0, so 0-24
func (DaysCompleted) GetDay ¶
func (d DaysCompleted) GetDay(day int) (DayCompletedParts, bool)
func (DaysCompleted) Total ¶
func (d DaysCompleted) Total() (total int)
func (*DaysCompleted) UnmarshalJSON ¶
func (d *DaysCompleted) UnmarshalJSON(b []byte) error
type Leaderboard ¶
type Leaderboard struct { OwnerID int64 `json:"owner_id"` Event string `json:"event"` Members map[int64]LeaderboardMember `json:"members"` }
func (Leaderboard) SortMemberScores ¶
func (l Leaderboard) SortMemberScores() []LeaderboardMember
Highest to lowest
type LeaderboardMember ¶
type LeaderboardMember struct { ID int64 `json:"id"` Name string `json:"name"` LocalScore int64 `json:"local_score"` Stars int64 `json:"stars"` DaysCompleted DaysCompleted `json:"completion_day_level"` }
type Session ¶
func (*Session) CalculateLatestDay ¶
Range 1-25, 0 is not started/in the future
func (*Session) GetLatestDay ¶
func (*Session) GetLeaderboard ¶
func (s *Session) GetLeaderboard() (*Leaderboard, error)
func (*Session) LeaderboardURL ¶
Click to show internal directories.
Click to hide internal directories.