job

package
v0.0.0-...-65ea52f Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2024 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DiyRankingsKey = "diy_rankings"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EventData

type EventData struct {
	Event          string `json:"event"`
	CountryRank    string `json:"country_rank"`
	ContinentRank  string `json:"continent_rank"`
	WorldRank      string `json:"world_rank"`
	Single         string `json:"single"`
	Average        string `json:"average"`
	WorldRank2     string `json:"world_rank_2"`
	ContinentRank2 string `json:"continent_rank_2"`
	CountryRank2   string `json:"country_rank_2"`
}

type Job

type Job struct {
	JobI
	Time time.Duration
}

type JobI

type JobI interface {
	Run() error
	Name() string
}

type Jobs

type Jobs []Job

func (Jobs) RunLoop

func (jobs Jobs) RunLoop(ctx context.Context)

func (Jobs) RunWithName

func (jobs Jobs) RunWithName(name string) error

type PersonBestResults

type PersonBestResults struct {
	PersonName string             `json:"PersonName"`
	Best       map[string]Results `json:"Best"`
	Avg        map[string]Results `json:"Avg"`
}

type PersonResult

type PersonResult struct {
	WCA    string
	Name   string
	Events []EventData
}

type Persons

type Persons struct {
	WcaId string `gorm:"column:wca_id"`
	Name  string `gorm:"column:name"`
}

type RecordUpdateJob

type RecordUpdateJob struct {
	DB *gorm.DB
}

func (*RecordUpdateJob) Name

func (c *RecordUpdateJob) Name() string

func (*RecordUpdateJob) Run

func (c *RecordUpdateJob) Run() error

type Results

type Results struct {
	EventId    string  `json:"eventId"`
	Best       float64 `json:"best"`
	BestStr    string  `json:"bestStr"`
	Average    float64 `json:"average"`
	AverageStr string  `json:"averageStr"`
	PersonName string  `json:"personName"`
	PersonId   string  `json:"personId"`
}

type UpdateDiyRankings

type UpdateDiyRankings struct {
	DB *gorm.DB
}

func (*UpdateDiyRankings) Name

func (u *UpdateDiyRankings) Name() string

func (*UpdateDiyRankings) Run

func (u *UpdateDiyRankings) Run() error

type WcaResult

type WcaResult struct {
	BestRank        int    `json:"BestRank"`
	BestStr         string `json:"BestStr"`
	BestPersonName  string `json:"BestPersonName"`
	BestPersonWCAID string `json:"BestPersonWCAID"`
	AvgRank         int    `json:"AvgRank"`
	AvgStr          string `json:"AvgStr"`
	AvgPersonName   string `json:"AvgPersonName"`
	AvgPersonWCAID  string `json:"AvgPersonWCAID"`
}

Jump to

Keyboard shortcuts

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