Documentation ¶
Index ¶
- Constants
- Variables
- func AesDecrypt(cipherIn []byte, key, iv []byte) ([]byte, error)
- func Init(path, host, proxy 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) Path() string
- func (info *Info) ProblemURL(host string) (string, error)
- func (info *Info) SubmissionURL(host string) (string, error)
- func (info *Info) SubmitURL(host string) (string, error)
- type Submission
- 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) Submit(info Info, sourcePath string) (err error)
- func (c *SzkopulClient) WatchSubmission(info Info, n int, line bool) (submissions []Submission, err error)
Constants ¶
View Source
const ErrorNeedContestID = "you have to specify the Contest ID"
ErrorNeedContestID error
View Source
const ErrorNeedProblemID = "you have to specify the Problem ID"
ErrorNeedProblemID error
View Source
const ErrorNeedProblemSecretKey = "you have to specify the Problem Secret Key"
ErrorNeedProblemSecretKey error
View Source
const ErrorNeedSubmissionID = "you have to specify the Submission ID"
ErrorNeedSubmissionID error
View Source
const SubmitIDRegStr = `\d+`
Variables ¶
View Source
var Archives = [...]string{
"OI",
}
View Source
var ErrorNotLogged = "Not logged in"
ErrorNotLogged not logged in
Functions ¶
Types ¶
type Info ¶
type Info struct { Archive string `json:"archive"` ContestID string `json:"contest_id"` StageID string `json:"stage_id"` ProblemID string `json:"problem_id"` ProblemSecretKey string `json:"problem_secret_key"` SubmissionID string `json:"submission_id"` RootPath string }
Info information
func (*Info) APISubmitURL ¶
APISubmitURL submit url
func (*Info) MySubmissionURL ¶
MySubmissionURL parse submission url
func (*Info) ProblemURL ¶
ProblemURL parse problem url
func (*Info) SubmissionURL ¶
SubmissionURL parse submission url
type Submission ¶
type Submission struct {
// contains filtered or unexported fields
}
Submission submit state
func (*Submission) ParseStatus ¶
func (s *Submission) ParseStatus() 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 }
SzkopulClient szkopul client
var Instance *SzkopulClient
Instance global client
func (*SzkopulClient) ConfigLogin ¶
func (c *SzkopulClient) ConfigLogin() (err error)
ConfigLogin configure handle and password
func (*SzkopulClient) DecryptPassword ¶
func (c *SzkopulClient) DecryptPassword() (string, error)
DecryptPassword get real password
func (*SzkopulClient) GetCsrf ¶
func (c *SzkopulClient) GetCsrf(URL string) (csrf string, err error)
func (*SzkopulClient) Login ¶
func (c *SzkopulClient) Login() (err error)
Login codeforces with handler and password
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 []Submission, err error)
WatchSubmission n is the number of submissions
Click to show internal directories.
Click to hide internal directories.