dispatch

package
v0.0.0-...-08a50c5 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UnrecognizedError = -1
	Accepted          = iota
	WrongAnswer
	CompileError
	RuntimeError
	TimeLimitExceeded
	PresentationError
	MemoryLimitExceeded
	OutputLimitExceeded
)

Result Code

View Source
const (
	PojCode = 1
)

Online Judge Code

Variables

This section is empty.

Functions

func StatusError

func StatusError(status int, url string) error

Types

type OnlineJudge

type OnlineJudge interface {
	Login() error
	//Logout()
	//SetCookie()
	GetProblem(problemID int) (*ProblemInfo, error)
	Submit(args *SubmitArgs) (int, error)
	QuerySubmitStatus(int) (*StatusResp, error)
	LoginStatus() (bool, error)
}

func GetOJWithoutUserInfo

func GetOJWithoutUserInfo(oj int) OnlineJudge

type POJ

type POJ struct {
	// contains filtered or unexported fields
}
 	Login()
	Logout()
	SetCookie()
	GetProblem()
	Submit()
	QuerySubmitStatus()
	LoginStatus() bool

func (*POJ) GetProblem

func (r *POJ) GetProblem(problemID int) (*ProblemInfo, error)

func (*POJ) Login

func (r *POJ) Login() error

func (*POJ) LoginStatus

func (r *POJ) LoginStatus() (bool, error)

func (*POJ) QuerySubmitStatus

func (r *POJ) QuerySubmitStatus(rid int) (*StatusResp, error)

func (*POJ) Submit

func (r *POJ) Submit(args *SubmitArgs) (int, error)

return run id

type ProblemArgs

type ProblemArgs struct {
	OJ        int `uri:"OJ" binding:"required"`
	ProblemID int `uri:"ProblemID" binding:"required"`
}

type ProblemInfo

type ProblemInfo struct {
	OJ           int
	ProblemID    int
	ProblemName  string
	Description  string
	Source       string
	TimeLimit    string
	MemoryLimit  string
	Input        string
	Output       string
	SampleInput  []string
	SampleOutput []string
	Language     []struct {
		TypeName string
		ID       int
	}
}

func GetProblemInfo

func GetProblemInfo(args *ProblemArgs) (*ProblemInfo, error)

type StatusResp

type StatusResp struct {
	Result     int
	Problem    int
	Memory     string
	Time       string
	Language   string
	Length     string
	SubmitTime string
	Info       string
}

type SubmitArgs

type SubmitArgs struct {
	OJ        int
	Source    string
	ProblemID int
	Language  int
}

Jump to

Keyboard shortcuts

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