aoj

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2018 License: MIT Imports: 14 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCompileError = errors.New("Compile Error. check your source code.")

Functions

func IsAliveSession

func IsAliveSession(cookie string) bool

func Session

func Session(id, rawPassword string) (string, error)

func Submit

func Submit(cookie, problemId, language, sourceCode string) (string, error)

Types

type Commentary

type Commentary struct {
	Filter  []string `json:"filter"`
	Pattern string   `json:"pattern"`
	Type    string   `json:"type"`
}

type Description

type Description struct {
	// TODO: Unknown type
	// "bookmarks": null,
	// "source": null,
	// "recommend": null,
	Commentaries    []*Commentary `json:"commentaries"`
	CreatedAt       int64         `json:"created_at"`
	HTML            string        `json:"html"`
	IsSolved        bool          `json:"isSolved"`
	Language        string        `json:"language"`
	MemoryLimit     int           `json:"memory_limit"`
	ProblemId       string        `json:"problem_id"`
	Recommendations int           `json:"recommendations"`
	Score           float64       `json:"score"`
	ServerTime      int           `json:"server_time"`
	SolvedUser      int           `json:"solvedUser"`
	SuccessRate     float64       `json:"successRate"`
	TimeLimit       int           `json:"time_limit"` // sec
}

func GetDescriptionByProblemId

func GetDescriptionByProblemId(cookie, id string) (*Description, error)

func (*Description) String

func (d *Description) String() string

type SampleInputoutput

type SampleInputoutput struct {
	ProblemID string `json:"problemId"`
	Serial    int    `json:"serial"`
	Input     string `json:"in"`
	Output    string `json:"out"`
	Actual    string
}

type Samples

type Samples struct {
	Samples []*SampleInputoutput
}

func GetSampleInputOutput

func GetSampleInputOutput(problemId string) (*Samples, error)

func (*Samples) ExecSamples

func (samples *Samples) ExecSamples(ext, sourceCode string,
	buildCommands, execCommands []string, timeLimit int) (*string, error)

func (*Samples) String

func (s *Samples) String() string

type SubmissionStatus

type SubmissionStatus struct {
	CaseVerdicts []caseVerdicts `json:"caseVerdicts"`
	CompileError string         `json:"compileError"`
	RuntimeError string         `json:"runtimeError"`
	UserOutput   string         `json:"userOutput"`
	ProblemId    string
	Time         time.Time
}

func Status

func Status(cookie, token, problemId string) (*SubmissionStatus, error)

func (*SubmissionStatus) CheckAC

func (s *SubmissionStatus) CheckAC() (string, error)

func (*SubmissionStatus) String

func (stat *SubmissionStatus) String() string

type SubmitRes

type SubmitRes struct {
	Token string `json:"token"`
}

Jump to

Keyboard shortcuts

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