Documentation ¶
Index ¶
- Constants
- func LocalizeLanguage(lang provider.Lang) (string, error)
- type CheckResponse
- type Client
- func (client *Client) Configure(config provider.BackendConfig) error
- func (client *Client) FindNextChallenge(filters provider.Filters) (provider.Filters, error)
- func (client *Client) GetChallenge(filters provider.Filters) (provider.Challenge, error)
- func (client *Client) GetQuestionData(titleSlug string) (*QuestionData, error)
- func (client *Client) GetRandomQuestionSlug(difficulty DifficultyFilter, status StatusFilter, tags []string, ...) (string, error)
- func (client *Client) IsSignedIn() (bool, error)
- func (client *Client) Submit(filters provider.Filters, lang provider.Lang, code string) (provider.SubmissionReport, error)
- func (client *Client) SubmitCode(questionId string, slug string, lang string, code string) (*SubmitResponse, error)
- func (client *Client) WaitUntilCompleteOrTimeOut(submissionId int64, timeOut time.Duration) (*CheckResponse, error)
- type CodeSnippet
- type DifficultyFilter
- type Filters
- type QuestionData
- type State
- type Status
- type StatusFilter
- type SubmitRequest
- type SubmitResponse
Constants ¶
View Source
const ( Accepted Status = 10 WrongAnswer = 11 MemoryLimitExceeded = 12 OutputLimitExceeded = 13 TimeLimitExceeded = 14 RuntimeError = 15 InternalError = 16 CompileError = 20 UnknownError = 21 Unknown )
View Source
const ( Easy DifficultyFilter = "EASY" Medium = "MEDIUM" Hard = "HARD" )
View Source
const ( Todo StatusFilter = "NOT_SOLVED" Solved = "AC" Attempted = "TRIED" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CheckResponse ¶
type CheckResponse struct { StatusCode Status `json:"status_code"` Lang string `json:"lang"` RunSuccess bool `json:"run_success"` StatusRuntime string `json:"status_runtime"` CompileError string `json:"compile_error"` FullCompileError string `json:"full_compile_error"` RuntimeError string `json:"runtime_error"` FullRuntimeError string `json:"full_runtime_error"` Input string `json:"input"` InputFormatted string `json:"input_formatted"` Memory int64 `json:"memory"` QuestionId string `json:"question_id"` ElapsedTime uint64 `json:"elapsed_time"` CompareResult string `json:"compare_result"` CodeOutput string `json:"code_output"` StdOutput string `json:"std_output"` LastTestCase string `json:"last_testcase"` ExpectedOutput string `json:"expected_output"` TaskFinishTime uint64 `json:"task_finish_time"` TotalCorrect uint64 `json:"total_correct"` TotalTestCases uint64 `json:"total_testcases"` RuntimePercentile float64 `json:"runtime_percentile"` StatusMemory string `json:"status_memory"` MemoryPercentile float64 `json:"memory_percentile"` PrettyLang string `json:"pretty_lang"` SubmissionId string `json:"submission_id"` StatusMsg string `json:"status_msg"` State State `json:"state"` }
func (*CheckResponse) ErrorReport ¶
func (res *CheckResponse) ErrorReport() *provider.ErrorReport
func (*CheckResponse) HasSucceeded ¶
func (res *CheckResponse) HasSucceeded() bool
func (*CheckResponse) Identify ¶
func (res *CheckResponse) Identify() string
func (*CheckResponse) Statistics ¶
func (res *CheckResponse) Statistics() provider.SubmissionStatistics
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) FindNextChallenge ¶
func (*Client) GetChallenge ¶
func (*Client) GetQuestionData ¶
func (client *Client) GetQuestionData(titleSlug string) (*QuestionData, error)
func (*Client) GetRandomQuestionSlug ¶
func (client *Client) GetRandomQuestionSlug(difficulty DifficultyFilter, status StatusFilter, tags []string, categorySlug string) (string, error)
func (*Client) IsSignedIn ¶
func (*Client) SubmitCode ¶
func (*Client) WaitUntilCompleteOrTimeOut ¶
type CodeSnippet ¶
type DifficultyFilter ¶
type DifficultyFilter string
func ParseDifficulty ¶
func ParseDifficulty(s string) (*DifficultyFilter, error)
type Filters ¶
type Filters struct { Difficulty DifficultyFilter `json:"difficulty,omitempty"` Status StatusFilter `json:"status,omitempty"` Tags []string `json:"tags,omitempty"` }
type QuestionData ¶
type QuestionData struct { QuestionId string `json:"questionId"` Title string `json:"title"` TitleSlug string `json:"titleSlug"` Difficulty string `json:"difficulty"` Likes uint64 `json:"likes"` Dislikes uint64 `json:"dislikes"` Content string `json:"content"` CodeSnippets []CodeSnippet `json:"codeSnippets"` }
func (*QuestionData) Identify ¶
func (data *QuestionData) Identify() provider.Filters
func (*QuestionData) Prompt ¶
func (data *QuestionData) Prompt() string
type StatusFilter ¶
type StatusFilter string
func ParseStatus ¶
func ParseStatus(s string) (*StatusFilter, error)
type SubmitRequest ¶
type SubmitResponse ¶
type SubmitResponse struct {
SubmissionId int64 `json:"submission_id"`
}
Click to show internal directories.
Click to hide internal directories.