Documentation ¶
Index ¶
- Constants
- Variables
- func APIPingURL(host string) string
- func GetAliasAndName(name string) (alias string, problemName string)
- func GetSubmissions(client *http.Client, URL string, n int) (submissions []sio_submissions.Submission, err error)
- func Init(path, host, proxy string)
- func ProblemURL(host, problemID string) string
- type Info
- func (info *Info) APISubmitURL(host string) (string, error)
- func (info *Info) Hint() string
- func (info *Info) MySubmissionURL(host string) string
- func (info *Info) OpenURL(host string) (string, error)
- func (info *Info) PackagePath() (string, error)
- func (info *Info) Path() string
- func (info *Info) ProblemSetURL(host string) (string, error)
- func (info *Info) ProblemURL(host string) (string, error)
- func (info *Info) SubmissionURL(host string) (string, error)
- func (info *Info) SubmitURL(host string) (string, error)
- func (info *Info) ToTask() database_client.Task
- type StatisInfo
- type SzkopulClient
- func (c *SzkopulClient) ConfigLogin() (err error)
- func (c *SzkopulClient) DecryptPassword() (string, error)
- func (c *SzkopulClient) GetCsrf(URL string) (csrf string, err error)
- func (c *SzkopulClient) Login() (err error)
- func (c *SzkopulClient) Parse(info Info, db *sql.DB) (problems []StatisInfo, paths []string, err error)
- func (c *SzkopulClient) ParseProblem(host, problemID, path string, mu *sync.Mutex) (name string, alias string, samples int, standardIO bool, perf util.Performance, ...)
- func (c *SzkopulClient) Ping() (err error)
- func (c *SzkopulClient) Statis(info Info) (problems []StatisInfo, perf util.Performance, err error)
- func (c *SzkopulClient) Submit(info Info, sourcePath string) (err error)
- func (c *SzkopulClient) WatchSubmission(info Info, n int, line bool) (submissions []sio_submissions.Submission, err error)
Constants ¶
View Source
const ErrorFetchingProblemSiteFailed = `fetching problem site failed`
View Source
const ErrorIDNotFound = `problem id not found`
View Source
const ErrorNeedArchive = "you have to specify the archive"
View Source
const ErrorNeedContestID = "you have to specify the Contest ID"
View Source
const ErrorNeedProblemAlias = "you have to specify the problem alias"
View Source
const ErrorNeedProblemID = "you have to specify the Problem ID"
View Source
const ErrorNeedStageID = "you have to specify the Stage ID"
View Source
const ErrorNeedSubmissionID = "you have to specify the Submission ID"
View Source
const ErrorParsingProblemsFailed = `parsing some problems failed`
View Source
const PdfStatementProblemURL = `/problemset/problem/%v/statement`
View Source
const SiteStatementProblemURL = `/problemset/problem/%v/site/?key=statement`
View Source
const StandardIOReg = `(\nKomunikacja\n|\nOpis interfejsu\s+)`
View Source
const SubmitIDRegStr = `\d+`
Variables ¶
View Source
var AcceptedExtensions = map[string]struct{}{
"cpp": {},
"cc": {},
"c": {},
"pas": {},
"py": {},
}
View Source
var Archives = [...]string{
"OI",
}
View Source
var ErrorNotLogged = "not logged in"
Functions ¶
func APIPingURL ¶ added in v0.7.1
func GetAliasAndName ¶ added in v0.4.0
func GetSubmissions ¶ added in v0.11.0
func GetSubmissions(client *http.Client, URL string, n int) (submissions []sio_submissions.Submission, err error)
func ProblemURL ¶ added in v0.4.0
Types ¶
type Info ¶
type Info struct { Archive string `json:"archive"` ContestID string `json:"contest_id"` StageID string `json:"stage_id"` ProblemAlias string `json:"problem_alias"` ProblemID string `json:"problem_id"` SubmissionID string `json:"submission_id"` RootPath string }
func (*Info) MySubmissionURL ¶
func (*Info) PackagePath ¶ added in v0.8.0
func (*Info) ProblemSetURL ¶ added in v0.4.0
func (*Info) ToTask ¶ added in v0.5.2
func (info *Info) ToTask() database_client.Task
type StatisInfo ¶ added in v0.4.0
type StatisInfo struct { ID string Name string Alias string Stage string Contest string Points string }
func (*StatisInfo) ParsePoint ¶ added in v0.4.1
func (prob *StatisInfo) ParsePoint() string
type SzkopulClient ¶
type SzkopulClient 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 Instance *SzkopulClient
func (*SzkopulClient) ConfigLogin ¶
func (c *SzkopulClient) ConfigLogin() (err error)
func (*SzkopulClient) DecryptPassword ¶
func (c *SzkopulClient) DecryptPassword() (string, error)
func (*SzkopulClient) GetCsrf ¶
func (c *SzkopulClient) GetCsrf(URL string) (csrf string, err error)
func (*SzkopulClient) Login ¶
func (c *SzkopulClient) Login() (err error)
func (*SzkopulClient) Parse ¶ added in v0.4.0
func (c *SzkopulClient) Parse(info Info, db *sql.DB) (problems []StatisInfo, paths []string, err error)
func (*SzkopulClient) ParseProblem ¶ added in v0.4.0
func (*SzkopulClient) Ping ¶ added in v0.7.1
func (c *SzkopulClient) Ping() (err error)
func (*SzkopulClient) Statis ¶ added in v0.4.0
func (c *SzkopulClient) Statis(info Info) (problems []StatisInfo, perf util.Performance, err error)
func (*SzkopulClient) Submit ¶
func (c *SzkopulClient) Submit(info Info, sourcePath string) (err error)
func (*SzkopulClient) WatchSubmission ¶
func (c *SzkopulClient) WatchSubmission(info Info, n int, line bool) (submissions []sio_submissions.Submission, err error)
Click to show internal directories.
Click to hide internal directories.