models

package
Version: v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2020 License: Apache-2.0 Imports: 5 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SubmissionsToYaml

func SubmissionsToYaml(sbms []*Submission) (string, error)

func TasksToYaml

func TasksToYaml(tasks []*Task) (string, error)

func TasksToYamlShort

func TasksToYamlShort(_tasks []*Task) (string, error)

Types

type Contest

type Contest struct {
	ID           string `json:"id" query:"id" yaml:"id"`
	Name         string `json:"name" query:"name" yaml:"name"`
	TestcasesURL string `json:"testcases_url,omitempty" yaml:"testcases_url,omitempty"`
}

func (*Contest) ToYaml

func (c *Contest) ToYaml() (string, error)

type Language

type Language int

Language represents enum of programming languages

const (
	LangCpp14GCC Language = 3003 // C++14 (GCC 5.4.1)
	LangNone     Language = 0
)

programming languages

func NewLanguage

func NewLanguage(langStr string) Language

func (Language) Int

func (l Language) Int() int

func (Language) MarshalJSON

func (l Language) MarshalJSON() ([]byte, error)

func (Language) MarshalYAML

func (l Language) MarshalYAML() (interface{}, error)

func (Language) String

func (l Language) String() string

func (*Language) UnmarshalJSON

func (l *Language) UnmarshalJSON(b []byte) error

func (*Language) UnmarshalYAML

func (l *Language) UnmarshalYAML(unmarshal func(interface{}) error) error

type Sample

type Sample struct {
	Num    int    `json:"num" yaml:"num"`
	Input  string `json:"input" yaml:"input"`
	Output string `json:"output" yaml:"output"`
}

type Submission

type Submission struct {
	ID           int      `json:"id" yaml:"id"`
	Source       string   `json:"source" yaml:"source,omitempty"`
	Lang         Language `json:"lang" yaml:"lang"`
	Score        int      `json:"score" yaml:"score"`
	SourceLength int      `json:"source_length" yaml:"source_length"`
	Status       string   `json:"status" yaml:"status"`
	Time         int      `json:"time,omitempty" yaml:"time,omitempty"`
	Memory       int      `json:"memory,omitempty" yaml:"memory,omitempty"`
	CreatedAt    string   `json:"created_at" yaml:"created_at"`
	Task         *Task    `json:"task,omitempty" yaml:"task,omitempty"`
}

func (*Submission) ToYaml

func (sbm *Submission) ToYaml() (string, error)

type Task

type Task struct {
	ID      string    `json:"id" yaml:"id"`
	Name    string    `json:"name" yaml:"name"`
	Title   string    `json:"title" yaml:"title"`
	Score   int       `json:"score,omitempty" yaml:"score,omitempty"`
	Samples []*Sample `json:"samples,omitempty" yaml:"samples,omitempty"`
}

func NewTaskWithFullName

func NewTaskWithFullName(taskID, fullName string) *Task

func (*Task) ToYaml

func (task *Task) ToYaml() (string, error)

func (*Task) ToYamlShort

func (_task *Task) ToYamlShort() (string, error)

type User

type User struct {
	ID   string `json:"id" yaml:"id"`
	Name string `json:"name" yaml:"name"`
}

func (*User) ToYaml

func (user *User) ToYaml() (string, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL