models

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2021 License: AGPL-3.0 Imports: 8 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"`
	Introduction string `json:"introduction"`
	Token        string `json:"-"`
	Creator      string `json:"creator"`
}

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"

	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

	SubmissionId uint64
	ProcessId    uint64

	JudgementId string
	Status      JudgeStatus `sql:"type:judge_status"`
	Msg         string
	Score       float64
}

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" gorm:"index: problem_id"`

	Locale string `json:"locale" gorm:"index: locale"`

	Title       string `json:"title" gorm:"index: title; 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"`
	ProcessId uint64

	PublicVolume  string `json:"publicVolume"`
	PrivateVolume string `json:"privateVolume"`
}

type Process

type Process struct {
	Model

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

	Definition string `json:"definition"`
}

type Role

type Role struct {
	Model

	AccountId uint64 `json:"submitterId"`
	Name      string `json:"name" gorm:"unique_index:account_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"`
}

type Task

type Task struct {
	Model

	Type        string `json:"type"`
	TaskId      string `json:"taskId"`
	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 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