ranker

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Poll

func Poll(ctx context.Context) (bool, error)

Types

type ByTotalScoreAndTime

type ByTotalScoreAndTime []ParticipantView

func (ByTotalScoreAndTime) Len

func (a ByTotalScoreAndTime) Len() int

func (ByTotalScoreAndTime) Less

func (a ByTotalScoreAndTime) Less(i, j int) bool

func (ByTotalScoreAndTime) Swap

func (a ByTotalScoreAndTime) Swap(i, j int)

type Participant

type Participant struct {
	Id        string                       `bson:"_id"`
	UserId    string                       `bson:"userId"`
	Tags      []string                     `bson:"tags"`
	ContestId string                       `bson:"contestId"`
	Results   map[string]ParticipantResult `bson:"results"`
	UpdatedAt int                          `bson:"updatedAt"`
}

type ParticipantResult

type ParticipantResult struct {
	SolutionCount  int                       `bson:"solutionCount"`
	LastSolutionId string                    `bson:"lastSolutionId"`
	LastSolution   ParticipantResultSolution `bson:"lastSolution"`
}

type ParticipantResultSolution

type ParticipantResultSolution struct {
	Score       float64 `bson:"score"`
	Status      string  `bson:"status"`
	CompletedAt int     `bson:"completedAt"`
}

type ParticipantView

type ParticipantView struct {
	TotalScore       int
	LastSolutionTime int
	Raw              *Participant
}

Jump to

Keyboard shortcuts

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