Documentation ¶
Index ¶
- Constants
- Variables
- func Init(path, host, proxy string, instanceClient SioInstanceClient)
- func ProblemURL(host, contest, problemAlias string) string
- type ContestInfo
- type Info
- func (info *Info) ContestURL(host string) (string, error)
- func (info *Info) Hint() string
- func (info *Info) MySubmissionURL(host string) (string, error)
- func (info *Info) OpenURL(host string) (string, error)
- func (info *Info) PackagePath() (string, error)
- func (info *Info) Path() string
- func (info *Info) ProblemURL(host string) (string, error)
- func (info *Info) StandingsURL(cln *SioClient, host string) (string, error)
- func (info *Info) StatusURL(host string) (string, error)
- func (info *Info) SubmissionURL(host string, reveal bool) (string, error)
- func (info *Info) SubmitURL(host string) (string, error)
- func (info *Info) ToTask() database_client.Task
- type RoundInfo
- type SioClient
- func (c *SioClient) ConfigLogin() (err error)
- func (c *SioClient) DecryptPassword() (string, error)
- func (c *SioClient) ListContests() (problems []ContestInfo, perf util.Performance, err error)
- func (c *SioClient) Login() (err error)
- func (c *SioClient) Parse(info Info, db *sql.DB) (problems []StatisInfo, paths []string, err error)
- func (c *SioClient) ParseProblem(host, contestID, problemAlias, path string, mu *sync.Mutex) (name string, samples int, standardIO bool, perf util.Performance, err error)
- func (c *SioClient) Ping() (err error)
- func (c *SioClient) RaceContest(info Info) (round string, err error)
- func (c *SioClient) RevealSubmission(info Info) (err error)
- func (c *SioClient) Statis(info Info) (problems []StatisInfo, perf util.Performance, err error)
- func (c *SioClient) Submit(info Info, sourcePath string) (err error)
- func (c *SioClient) WatchSubmission(info Info, n int, line bool) (submissions []Submission, err error)
- type SioInstanceClient
- type StatisInfo
- type Submission
Constants ¶
View Source
const ErrorContestNotFound = "contest not found"
View Source
const ErrorFetchingProblemSiteFailed = `fetching problem site failed`
View Source
const ErrorNeedCantFindProblemID = "couldn't find problem instance id (maybe a problem with this alias doesn't exist in this contest)"
View Source
const ErrorNeedContest = "you have to specify the contest"
View Source
const ErrorNeedProblemAlias = "you have to specify the Problem alias"
View Source
const ErrorNeedProblemIdentification = "you have to specify the problem alias or the problem instance id"
View Source
const ErrorNeedRound = "you have to specify the round"
View Source
const ErrorNeedSubmissionID = "you have to specify the Submission ID"
View Source
const ErrorNoActiveRound = "there is no active round in this contest"
View Source
const ErrorParsingProblemsFailed = `parsing some problems failed`
View Source
const ErrorUnknownInstance = "unknown sio instance"
View Source
const ErrorUnrecognizedStatementFormat = `unrecognized statement format`
View Source
const LoginPageRegExp = `<h1>Log in</h1>`
View Source
const StandardIOReg = `(\nKomunikacja\n|\nOpis interfejsu\s+)`
View Source
const SubmissionsPageRegExp = `<title>My submissions[\S\s]+</title>|<title>Moje zgłoszenia[\S\s]+</title>`
Variables ¶
View Source
var AcceptedExtensions = map[string]struct{}{
"cpp": {},
"cc": {},
"c": {},
"pas": {},
"py": {},
}
View Source
var ErrorNotLogged = "not logged in"
Functions ¶
func Init ¶
func Init(path, host, proxy string, instanceClient SioInstanceClient)
func ProblemURL ¶
Types ¶
type ContestInfo ¶ added in v0.7.0
type Info ¶
type Info struct { Contest string `json:"contest_id"` ProblemID string `json:"problem_id"` ProblemAlias string `json:"problem_alias"` Round string `json:"round"` SubmissionID string `json:"submission_id"` RootPath string }
func (*Info) PackagePath ¶ added in v0.8.0
func (*Info) StandingsURL ¶
func (*Info) SubmissionURL ¶
func (*Info) ToTask ¶
func (info *Info) ToTask() database_client.Task
type SioClient ¶
type SioClient struct { Jar *cookiejar.Jar `json:"cookies"` Username string `json:"handle"` Password string `json:"password"` LastSubmission *Info `json:"last_submission"` // contains filtered or unexported fields }
var MimuwInstance *SioClient
var StaszicInstance *SioClient
func (*SioClient) ConfigLogin ¶
func (*SioClient) DecryptPassword ¶
func (*SioClient) ListContests ¶ added in v0.7.0
func (c *SioClient) ListContests() (problems []ContestInfo, perf util.Performance, err error)
func (*SioClient) ParseProblem ¶
func (*SioClient) RaceContest ¶
func (*SioClient) RevealSubmission ¶ added in v0.7.0
func (*SioClient) Statis ¶
func (c *SioClient) Statis(info Info) (problems []StatisInfo, perf util.Performance, err error)
func (*SioClient) WatchSubmission ¶
type SioInstanceClient ¶ added in v0.6.0
type SioInstanceClient int
const ( Staszic SioInstanceClient = 0 Mimuw SioInstanceClient = 1 )
type StatisInfo ¶
func (*StatisInfo) ParsePoint ¶
func (prob *StatisInfo) ParsePoint() string
type Submission ¶
type Submission struct {
// contains filtered or unexported fields
}
func (*Submission) ParseID ¶
func (s *Submission) ParseID() string
func (*Submission) ParsePoints ¶
func (s *Submission) ParsePoints() string
func (*Submission) ParseStatus ¶
func (s *Submission) ParseStatus() string
Click to show internal directories.
Click to hide internal directories.