Documentation
¶
Overview ¶
Package client provides networking capabilities and the generic Crack method that uses Cracker interface.
Index ¶
- Constants
- type Client
- func (client *Client) Crack(source []byte, cracker Cracker) error
- func (client *Client) FindCSRF(URL string) (string, error)
- func (client *Client) Login(handleOrEmail string, password string) error
- func (client *Client) LoginUrl() string
- func (client *Client) PostSubmission(csrf string, source string) error
- func (client *Client) PrintCases()
- func (client *Client) Submit(csrf string, source string) (res SubmissionResult, err error)
- func (client *Client) SubmitUrl() string
- type Cracker
- type SubmissionResult
- type TestEndError
- type ValueError
- type Verdict
Constants ¶
View Source
const ( WrongAnswer = iota RuntimeError = iota IdlenessLimitExceeded = iota MemoryLimitExceeded )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
http.Client `json:"-"`
HostUrl string `json:"-"` // as in https://codeforces.com, derived from contest_url
MyUrl string `json:"my_url"` // as in https://codeforces.com/contest/4/my
ContestUrl string `json:"contest_url"` // as in https://codeforces.com/contest/4
LangId string `json:"lang_id"`
ContestId string `json:"contest_id"`
ProblemId string `json:"problem_id"`
Cases compilation.TestCases `json:"test_cases"`
}
func (*Client) PostSubmission ¶
func (*Client) PrintCases ¶
func (client *Client) PrintCases()
type Cracker ¶
type Cracker interface {
GetNextValue(client *Client, parts compilation.Parts) (int, error)
}
type SubmissionResult ¶
type TestEndError ¶
type TestEndError struct{}
func (TestEndError) Error ¶
func (TestEndError) Error() string
type ValueError ¶
type ValueError struct{}
func (ValueError) Error ¶
func (ValueError) Error() string
Click to show internal directories.
Click to hide internal directories.