models

package
v0.0.0-...-226c3a4 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2020 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JudgeStatus

type JudgeStatus string
const (
	Pending JudgeStatus = "Pending"

	PartiallyCorrect JudgeStatus = "PartiallyCorrect"
	WrongAnswer      JudgeStatus = "WrongAnswer"
	Accepted         JudgeStatus = "Accepted"

	SystemError         JudgeStatus = "SystemError"
	JudgementFailed     JudgeStatus = "JudgementFailed"
	CompilationError    JudgeStatus = "CompilationError"
	FileError           JudgeStatus = "FileError"
	RuntimeError        JudgeStatus = "RuntimeError"
	TimeLimitExceeded   JudgeStatus = "TimeLimitExceeded"
	MemoryLimitExceeded JudgeStatus = "MemoryLimitExceeded"
	OutputLimitExceeded JudgeStatus = "OutputLimitExceeded"
	InvalidInteraction  JudgeStatus = "InvalidInteraction"

	ConfigurationError JudgeStatus = "ConfigurationError"
	Canceled           JudgeStatus = "Canceled"
)

func (*JudgeStatus) Scan

func (p *JudgeStatus) Scan(value interface{}) error

func (JudgeStatus) TableName

func (JudgeStatus) TableName() string

func (JudgeStatus) Value

func (p JudgeStatus) Value() (driver.Value, error)

type Judgement

type Judgement struct {
	Model

	JudgementId string
	Type        string
	Status      JudgeStatus `sql:"type:judge_status"`

	Property string

	Inputs  string
	Outputs string
}

type Model

type Model struct {
	ID        uint64     `json:"id" gorm:"primary_key" `
	CreatedAt time.Time  `json:"created_at"`
	UpdatedAt time.Time  `json:"updated_at"`
	DeletedAt *time.Time `json:"deleted_at" sql:"index" `
}

type Page

type Page struct {
	Model

	Title       string `json:"title" gorm: "index: title; not null"` // title
	TimeLimit   uint64 `json:"time_limit"`                           // in ms
	MemoryLimit uint64 `json:"memory_limit"`                         // in MB

	Description  string `json:"description"`
	InputFormat  string `json:"input_format"`
	OutputFormat string `json:"output_format"`
	Example      string `json:"example"`
	HintAndLimit string `json:"hint_and_limit"`

	FileIoInputName  string `json:"file_io_input_name"`
	FileIoOutputName string `json:"file_io_output_name"`
}

type Problem

type Problem struct {
	Model

	Group        int    `gorm:"not null; unique_index:idx2; default: 0"`
	Locale       string `json:"locale"`
	ProblemId    string `json:"pid" gorm:"unique_index:idx2"`
	PublicSpace  string `json:"pub_space"`
	PrivateSpace string `json:"pri_space"`
}

type Profile

type Profile struct {
	Model

	UserId uint64 `json:"uid"`
	Locale string `json:"locale" gorm:"default: 'en'"`
	Avatar string `json:"avatar"`
	Email  string `json:"email"`
	Gender string `json:"gender"`
}

type Review

type Review struct {
	ID          uint64    `json:"id"`
	ProductID   uint64    `json:"product_id"`
	Message     string    `json:"message"`
	CreatedTime time.Time `json:"created_time"`
}

type Submission

type Submission struct {
	Model

	SubmissionId string
	// submitter ID of this submission
	SubmitterId uint64
	Submitter   User

	ProblemID string
	UserSpace string

	Code string

	TimeUsed   uint
	MemoryUsed uint

	Score  uint
	Status JudgeStatus `sql:"type:judge_status"`
}

type User

type User struct {
	Model

	Group    int    `gorm:"not null; unique_index:idx1; default: 0"`
	Username string `gorm:"not null; unique_index:idx1"`
	Hash     string `gorm:"not null;"`
	Salt     string `gorm:"not null;"`
}

Jump to

Keyboard shortcuts

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