challenge

package
v0.0.0-...-fe0de53 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssignScores

func AssignScores(leaderboards map[string]*aoc.Leaderboard, users []*User) error

func AssignSubmissions

func AssignSubmissions(users []*User) error

func Execute

func Execute(session string) error

func UpdateReadme

func UpdateReadme(users []*User, teams []*Team) error

Types

type Participant

type Participant struct {
	ID   int    `yaml:"aoc_id"`
	Name string `yaml:"name"`
}

type Star

type Star int
const (
	NoStar Star = iota
	SilverStar
	GoldStar
)

type Stats

type Stats struct {
	Submissions int
	Score       int
	Stars       [25]Star
}

type Team

type Team struct {
	ID      string   `yaml:"id"`
	Members []string `yaml:"members"`
	Stats   map[string]Stats
}

type Teams

type Teams struct {
	Teams        []*Team       `yaml:"team"`
	Participants []Participant `yaml:"participants"`
}

func LoadTeams

func LoadTeams() (*Teams, error)

type User

type User struct {
	AocID      int
	Name       string
	Username   string
	AvatarURL  string
	Team       *Team
	ProfileURL string
	Stats      map[string]Stats
}

func GetUsersFromTeams

func GetUsersFromTeams(teams *Teams) []*User

func MergeUsers

func MergeUsers(leaderboard *aoc.Leaderboard, users []*User) []*User

MergeUsers will add the users in the leaderboard that are missing in the teams.yaml

type UserSubmissionsByYear

type UserSubmissionsByYear map[string]int

Jump to

Keyboard shortcuts

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