models

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MigrateTargets []any

Functions

func DetectContestID

func DetectContestID(taskID ids.TaskID) (ids.ContestID, error)

Types

type Contest

type Contest struct {
	ID         ids.ContestID `gorm:"primaryKey"`
	RatedType  null.String   `gorm:"index"`
	Title      string        `gorm:"not null"`
	StartAt    time.Time     `gorm:"not null"`
	Duration   time.Duration `gorm:"not null"`
	TargetRate string        `gorm:"not null"`
	Loaded     bool          `gorm:"type:integer;not null"`

	ContestTasks []ContestTask `gorm:"constraint:OnDelete:CASCADE"`
}

func (Contest) ContestTaskURL

func (c Contest) ContestTaskURL() string

func (Contest) ContestURL

func (c Contest) ContestURL() string

type ContestTask

type ContestTask struct {
	ID        ids.ContestTaskID `gorm:"primaryKey"`
	ContestID ids.ContestID     `gorm:"not null"`
	TaskID    ids.TaskID        `gorm:"not null"`
	Order     int               `gorm:"not null"`
	Index     string            `gorm:"not null"`

	Task Task `gorm:"constraint:OnDelete:CASCADE"`
}

func (ContestTask) TaskURL

func (ct ContestTask) TaskURL() string

type RatedType

type RatedType struct {
	Type string `gorm:"primary_key"`

	Contests []Contest `gorm:"foreignKey:RatedType;constraint:OnDelete:CASCADE"`
}

type Task

type Task struct {
	ID        ids.TaskID    `gorm:"primaryKey"`
	Title     string        `gorm:"not null"`
	TimeLimit time.Duration `gorm:"type:integer;not null"`
	Memory    int           `gorm:"not null"`
	Score     null.Int
	Loaded    bool `gorm:"type:integer;not null"`

	Samples []TaskSample `gorm:"foreignKey:TaskID;constraint:OnDelete:CASCADE"`
}

type TaskInfo

type TaskInfo struct {
	ContestID ids.ContestID `yaml:"contest-id"`
	TaskID    ids.TaskID    `yaml:"task-id"`
}

func (TaskInfo) CanRestore

func (ti TaskInfo) CanRestore() bool

func (TaskInfo) MoveFromTemp added in v0.0.4

func (ti TaskInfo) MoveFromTemp(tmpDir string) error

func (*TaskInfo) Read

func (t *TaskInfo) Read(r io.Reader) error

func (*TaskInfo) ReadFile

func (t *TaskInfo) ReadFile(file string) error

func (TaskInfo) RequiredStore

func (ti TaskInfo) RequiredStore() bool

func (TaskInfo) RestoreFiles

func (ti TaskInfo) RestoreFiles() error

func (TaskInfo) StoreFiles

func (ti TaskInfo) StoreFiles() error

func (TaskInfo) TaskDir

func (ti TaskInfo) TaskDir() string

func (TaskInfo) TaskURL

func (ti TaskInfo) TaskURL() string

func (TaskInfo) Write

func (t TaskInfo) Write(w io.Writer) error

func (TaskInfo) WriteFile

func (t TaskInfo) WriteFile(file string) error

type TaskSample

type TaskSample struct {
	ID     ids.TaskSampleID `gorm:"primaryKey"`
	TaskID ids.TaskID       `gorm:"not null"`
	Index  string           `gorm:"not null"`
	Input  string           `gorm:"not null"`
	Output string           `gorm:"not null"`
	Type   TaskSampleType   `gorm:"not null"`
}

type TaskSampleType

type TaskSampleType int
const (
	TaskSampleTypeSystem TaskSampleType = iota + 1
	TaskSampleTypeUser
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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