models

package
v0.0.33 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2021 License: AGPL-3.0 Imports: 9 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Model

	Name     string `json:"name" gorm:"unique_index:account_name"`
	Nickname string `json:"nickname" gorm:"unique_index:account_nickname"`

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

type Actuator added in v0.0.6

type Actuator struct {
	Model

	Name  string `json:"name" gorm:"index: name"`
	Token string `json:"-"`
	Type  string `json:"type" gorm:"index: type"`

	Creator      string `json:"creator"`
	Introduction string `json:"introduction"`
}

type Args added in v0.0.12

type Args map[string]interface{}

func (*Args) Scan added in v0.0.12

func (args *Args) Scan(value interface{}) error

func (Args) Value added in v0.0.12

func (args Args) Value() (driver.Value, error)

type Blueprint added in v0.0.12

type Blueprint struct {
	Model

	Name  string `json:"name" gorm:"index: name"`
	Title string `json:"title"`

	Definition string `json:"definition"`
}

type Credential

type Credential struct {
	Model

	AccountId int64  `gorm:"not null"`
	Username  string `gorm:"not null; unique_index:idx1"`
	Hash      string `gorm:"not null;"`
	Salt      string `gorm:"not null;"`
}

type FileRecord

type FileRecord struct {
	Opt      string `json:"opt"` // Add Delete
	FileType string `json:"file_type"`
	FilePath string `json:"file_path"`

	VolumeName string `json:"volume"`
	VolumePath string `json:"volumePath"`
}

func (FileRecord) IsDir

func (f FileRecord) IsDir() bool

func (FileRecord) ModTime

func (f FileRecord) ModTime() time.Time

func (FileRecord) Mode

func (f FileRecord) Mode() os.FileMode

func (FileRecord) Name

func (f FileRecord) Name() string

func (FileRecord) Size

func (f FileRecord) Size() int64

func (FileRecord) Sys

func (f FileRecord) Sys() interface{}

type FileRecords

type FileRecords []*FileRecord

func (*FileRecords) Scan

func (fileRecords *FileRecords) Scan(value interface{}) error

func (FileRecords) Value

func (fileRecords FileRecords) Value() (driver.Value, error)

type Group

type Group struct {
	Model

	Name        string `json:"name"`
	Description string `json:"description"`
}

type JudgeStatus

type JudgeStatus string
const (
	Pending  JudgeStatus = "Pending"
	Running  JudgeStatus = "Running"
	Canceled JudgeStatus = "Canceled"
	Finished JudgeStatus = "Finished"

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

	TimeLimitExceeded   JudgeStatus = "TimeLimitExceeded"
	MemoryLimitExceeded JudgeStatus = "MemoryLimitExceeded"
	OutputLimitExceeded JudgeStatus = "OutputLimitExceeded"
	RuntimeError        JudgeStatus = "RuntimeError"
	FileError           JudgeStatus = "FileError"

	SystemError        JudgeStatus = "SystemError"
	JudgementFailed    JudgeStatus = "JudgementFailed"
	CompilationError   JudgeStatus = "CompilationError"
	ConfigurationError JudgeStatus = "ConfigurationError"
	InvalidInteraction JudgeStatus = "InvalidInteraction"
)

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

	SubmissionID uint64 `json:"-"`
	BlueprintId  uint64 `json:"blueprint_id"`
	Name         string `json:"name"`
	Args         Args   `gorm:"type:json" json:"args"`

	Status JudgeStatus `sql:"type:judge_status" json:"status"`
	Msg    string      `json:"msg"`
	Score  float64     `json:"score"`
}

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

	ProblemId uint64 `json:"problemId"`

	Locale string `json:"locale"`

	Title       string `json:"title" gorm:"not null"` // title
	Description string `json:"description"`

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

type Problem

type Problem struct {
	Model

	Name        string `json:"name" gorm:"unique_index:idx2"`
	Title       string `json:"title"`
	BlueprintID uint64

	PublicVolume  string `json:"public_volume"`
	PrivateVolume string `json:"-"`

	RankLists []RankList `json:"rank_lists"`
}

type Process

type Process struct {
	Model

	Type        string `json:"type"`
	ProcessId   string `json:"processId"`
	JudgementId string `json:"judgementId"`

	Properties map[string]interface{} `json:"properties" gorm:"type:json"`

	Inputs  Slots `json:"inputs" gorm:"type:json"`
	Outputs Slots `json:"outputs" gorm:"type:json"`
}

type Program added in v0.0.12

type Program struct {
	Model

	Name        string `json:"name"`
	Title       string `json:"title"`
	Description string `json:"description"`
	Definition  string `json:"definition"`
}

type RankList added in v0.0.19

type RankList struct {
	Model

	ProblemID uint64 `json:"-"`

	Name    string           `json:"name"`
	Title   string           `json:"title"`
	Models  []RankListModel  `json:"metrics"`
	Records []RankListRecord `json:"records"`
}

type RankListModel added in v0.0.19

type RankListModel struct {
	Model
	RankListID uint64 `json:"-"`

	Key      string `json:"key"`
	Priority uint   `json:"priority"`
	Order    string `json:"order"`
}

type RankListRecord added in v0.0.19

type RankListRecord struct {
	Model
	RankListID uint64 `json:"-"`

	AccountID uint64  `json:"-"`
	Account   Account `json:"account"`

	Key   string  `json:"key"`
	Value float64 `json:"value"`
}

type Role

type Role struct {
	Model

	AccountId uint64 `json:"submitterId"`
	Name      string `json:"name"`
}

type Slot

type Slot struct {
	Type  string      `json:"type"`
	Value interface{} `json:"value"`
}

type Slots

type Slots []*Slot

func (*Slots) Scan

func (slots *Slots) Scan(value interface{}) error

func (Slots) Value

func (slots Slots) Value() (driver.Value, error)

type Submission

type Submission struct {
	Model

	Name string `json:"submissionId"`

	SubmitterId uint64 `json:"submitterId"`

	ProblemId uint64 `json:"problemId"`

	UserVolume string `json:"userVolume"`

	Judgements []Judgement `json:"judgements"`
}

type UserGroupCorrelation

type UserGroupCorrelation struct {
	Model
	UserID  uint64
	GroupID uint64
}

type Volume

type Volume struct {
	Model

	Base        uint64      `json:"base"`
	CreatedBy   uint64      `json:"created_by"`
	Name        string      `json:"name"`
	FileRecords FileRecords `json:"file_records" gorm:"type:json"`
}

Jump to

Keyboard shortcuts

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