Documentation ¶
Index ¶
- Constants
- Variables
- func Init(path, host, proxy string)
- type Client
- func (c *Client) Clone(handle, rootPath string, ac bool) (err error)
- func (c *Client) ConfigLogin() (err error)
- func (c *Client) DecryptPassword() (string, error)
- func (c *Client) Login() (err error)
- func (c *Client) Parse(info Info) (problems []string, paths []string, err error)
- func (c *Client) ParseProblem(URL, path string, mu *sync.Mutex) (samples int, standardIO bool, err error)
- func (c *Client) Pull(info Info, rootPath string, ac bool) (err error)
- func (c *Client) PullCode(URL, path, ext string, rename bool) (filename string, err error)
- func (c *Client) RaceContest(info Info) (err error)
- func (c *Client) Statis(info Info) (problems []StatisInfo, err error)
- func (c *Client) Submit(info Info, langID, source string) (err error)
- func (c *Client) WatchSubmission(info Info, n int, line bool) (submissions []Submission, err error)
- type Info
- func (info *Info) Hint() string
- func (info *Info) MySubmissionURL(host string) (string, error)
- func (info *Info) OpenURL(host string) (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) StandingsURL(host string) (string, error)
- func (info *Info) SubmissionURL(host string) (string, error)
- func (info *Info) SubmitURL(host string) (string, error)
- type StatisInfo
- type Submission
Constants ¶
const ErrorNeedContestID = "You have to specify the Contest ID"
ErrorNeedContestID error
const ErrorNeedGroupID = "You have to specify the Group ID"
ErrorNeedGroupID error
const ErrorNeedGymID = "You have to specify the Gym ID"
ErrorNeedGymID error
const ErrorNeedProblemID = "You have to specify the Problem ID"
ErrorNeedProblemID error
const ErrorNeedSubmissionID = "You have to specify the Submission ID"
ErrorNeedSubmissionID error
const ErrorNotSupportAcmsguru = "Not support acmsguru"
ErrorNotSupportAcmsguru error
const ErrorSkip = "Exists, skip"
ErrorSkip error
const ErrorTooManyRequest = "Too many requests"
ErrorTooManyRequest error
const ErrorUnknownType = "Unknown Type"
ErrorUnknownType error
Variables ¶
var ErrorNotLogged = "Not logged in"
ErrorNotLogged not logged in
var Langs = map[string]string{
"43": "GNU GCC C11 5.1.0",
"80": "Clang++20 Diagnostics",
"52": "Clang++17 Diagnostics",
"50": "GNU G++14 6.4.0",
"54": "GNU G++17 7.3.0",
"73": "GNU G++20 11.2.0 (64 bit, winlibs)",
"59": "Microsoft Visual C++ 2017",
"61": "GNU G++17 9.2.0 (64 bit, msys 2)",
"65": "C# 8, .NET Core 3.1",
"79": "C# 10, .NET SDK 6.0",
"9": "C# Mono 6.8",
"28": "D DMD32 v2.105.0",
"32": "Go 1.19.5",
"12": "Haskell GHC 8.10.1",
"60": "Java 11.0.6",
"74": "Java 17 64bit",
"87": "Java 21 64bit",
"36": "Java 1.8.0_241",
"77": "Kotlin 1.6.10",
"83": "Kotlin 1.7.20",
"19": "OCaml 4.02.1",
"3": "Delphi 7",
"4": "Free Pascal 3.0.2",
"51": "PascalABC.NET 3.8.3",
"13": "Perl 5.20.1",
"6": "PHP 8.1.7",
"7": "Python 2.7.18",
"31": "Python 3.8.10",
"40": "PyPy 2.7.13 (7.3.0)",
"41": "PyPy 3.6.9 (7.3.0)",
"70": "PyPy 3.9.10 (7.3.9, 64bit)",
"67": "Ruby 3.0.0",
"75": "Rust 1.72.0 (2021)",
"20": "Scala 2.12.8",
"34": "JavaScript V8 4.8.0",
"55": "Node.js 12.16.3",
}
Langs generated by ^[\s\S]*?value="(.+?)"[\s\S]*?>([\s\S]+?)<[\s\S]*?$
"\1": "\2",
var LangsExt = map[string]string{
"GNU C11": "c",
"Clang++20 Diagnostics": "cpp",
"Clang++17 Diagnostics": "cpp",
"GNU C++14": "cpp",
"GNU C++17": "cpp",
"GNU C++20 (64)": "cpp",
"MS C++ 2017": "cpp",
"GNU C++17 (64)": "cpp",
"C# 8": "cs",
"C# 10": "cs",
"Mono C#": "cs",
"D": "d",
"Go": "go",
"Haskell": "hs",
"Java 11": "java",
"Java 17": "java",
"Java 21": "java",
"Java 8": "java",
"Kotlin 1.6": "kt",
"Kotlin 1.7": "kt",
"Ocaml": "ml",
"Delphi": "pas",
"FPC": "pas",
"PascalABC.NET": "pas",
"Perl": "pl",
"PHP": "php",
"Python 2": "py",
"Python 3": "py",
"PyPy 2": "py",
"PyPy 3": "py",
"PyPy 3-64": "py",
"Ruby 3": "rb",
"Rust 2021": "rs",
"Scala": "scala",
"JavaScript": "js",
"Node.js": "js",
"": "txt",
}
LangsExt language's ext
var ProblemTypes = [...]string{
"contest",
"gym",
"group",
"acmsguru",
}
ProblemTypes problem types
Functions ¶
Types ¶
type Client ¶
type Client struct { Jar *cookiejar.Jar `json:"cookies"` Handle string `json:"handle"` HandleOrEmail string `json:"handle_or_email"` Password string `json:"password"` Ftaa string `json:"ftaa"` Bfaa string `json:"bfaa"` LastSubmission *Info `json:"last_submission"` // contains filtered or unexported fields }
Client codeforces client
var Instance *Client
Instance global client
func (*Client) ConfigLogin ¶
ConfigLogin configure handle and password
func (*Client) DecryptPassword ¶
DecryptPassword get real password
func (*Client) ParseProblem ¶
func (c *Client) ParseProblem(URL, path string, mu *sync.Mutex) (samples int, standardIO bool, err error)
ParseProblem parse problem to path. mu can be nil
func (*Client) RaceContest ¶
RaceContest wait for contest starting
func (*Client) Statis ¶
func (c *Client) Statis(info Info) (problems []StatisInfo, err error)
Statis get statis
func (*Client) WatchSubmission ¶
WatchSubmission n is the number of submissions
type Info ¶
type Info struct { ProblemType string `json:"problem_type"` ContestID string `json:"contest_id"` GroupID string `json:"group_id"` ProblemID string `json:"problem_id"` SubmissionID string `json:"submission_id"` RootPath string }
Info information
func (*Info) MySubmissionURL ¶
MySubmissionURL parse submission url
func (*Info) ProblemSetURL ¶
ProblemSetURL parse problem set url
func (*Info) ProblemURL ¶
ProblemURL parse problem url
func (*Info) StandingsURL ¶
StandingsURL parse standings url
func (*Info) SubmissionURL ¶
SubmissionURL parse submission url
type StatisInfo ¶
StatisInfo statis information
type Submission ¶
type Submission struct {
// contains filtered or unexported fields
}
Submission submit state
func (*Submission) ParseProblemIndex ¶
func (s *Submission) ParseProblemIndex() string
ParseProblemIndex get problem's index