Documentation
¶
Index ¶
- type All
- type Code
- type Difficulty
- type GetQuestionResponse
- type GetQuestionResponseData
- type Meta
- type Question
- type QustionsResp
- type RunResult
- type SolutionListResp
- type SolutionListRespCN
- type SolutionListRespEN
- type SolutionReq
- type SolutionResp
- type Stat
- type StatStatusPair
- type StatusCode
- type SubmitCheckResult
- type TestCheckResult
- type Today
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type All ¶
type All struct {
StatStatusPairs []StatStatusPair `json:"stat_status_pairs"`
}
type Code ¶
type Code struct { Text string `json:"text"` Value string `json:"value"` DefaultCode string `json:"defaultCode"` }
Code the struct of leetcode codes.
type Difficulty ¶
type Difficulty struct {
Level int `json:"level"`
}
func (*Difficulty) String ¶
func (d *Difficulty) String() string
type GetQuestionResponse ¶
type GetQuestionResponse struct {
Data GetQuestionResponseData `json:"data"`
}
type GetQuestionResponseData ¶
type GetQuestionResponseData struct {
Question *Question `json:"question"`
}
type Meta ¶
type Question ¶
type Question struct { MdContent string `json:"mdContent"` QuestionID string `json:"questionId"` Stats string `json:"stats"` CodeDefinition string `json:"codeDefinition"` SampleTestCase string `json:"sampleTestCase"` Content string `json:"content"` TranslatedContent string `json:"translatedContent"` Meta EnableRunCode bool `json:"enableRunCode"` }
func (*Question) ParseCodes ¶
type QustionsResp ¶
type SolutionListResp ¶
type SolutionListResp interface {
SolutionReqs() []SolutionReq
}
type SolutionListRespCN ¶
type SolutionListRespCN struct { Data struct { QuestionSolutionArticles struct { Edges []struct { Node struct { Slug string `json:"slug"` Title string `json:"title"` CreatedAt time.Time `json:"createdAt"` Author struct { Username string `json:"username"` } `json:"author"` } `json:"node"` } `json:"edges"` } `json:"questionSolutionArticles"` } `json:"data"` }
func (*SolutionListRespCN) SolutionReqs ¶
func (sc *SolutionListRespCN) SolutionReqs() []SolutionReq
type SolutionListRespEN ¶
type SolutionListRespEN struct { Data struct { QuestionSolutions struct { Solutions []struct { Title string `json:"title"` Post struct { Author struct { Username string `json:"username"` } `json:"author"` CreationDate int `json:"creationDate"` } `json:"post"` ID int `json:"id"` } `json:"solutions"` TotalNum int `json:"totalNum"` } `json:"questionSolutions"` } `json:"data"` }
func (*SolutionListRespEN) SolutionReqs ¶
func (se *SolutionListRespEN) SolutionReqs() []SolutionReq
type SolutionReq ¶
type SolutionResp ¶
type SolutionResp struct { Data struct { SolutionArticle struct { Title string `json:"title"` Summary string `json:"summary"` Content string `json:"content"` Question struct { QuestionTitleSlug string `json:"questionTitleSlug"` Typename string `json:"__typename"` } `json:"question"` } `json:"solutionArticle"` Topic struct { Title string `json:"title"` Post struct { Content string `json:"content"` ID int `json:"id"` VoteCount int `json:"voteCount"` VoteStatus int `json:"voteStatus"` } `json:"post"` ID int `json:"id"` Pinned bool `json:"pinned"` } `json:"topic"` } `json:"data"` }
func (*SolutionResp) RegularContent ¶
func (sp *SolutionResp) RegularContent() (string, error)
RegularContent returns regulared markdown content
type StatStatusPair ¶
type StatStatusPair struct { Stat Stat `json:"stat"` Difficulty Difficulty `json:"difficulty"` PaidOnly bool `json:"paid_only"` }
func (*StatStatusPair) Meta ¶
func (sp *StatStatusPair) Meta() Meta
type StatusCode ¶
type StatusCode int
const ( Accepted StatusCode = 10 WrongAnswer StatusCode = 11 MemoryLimitExceeded StatusCode = 12 OutputLimitExceeded StatusCode = 13 TimeLimitExceeded StatusCode = 14 RuntimeError StatusCode = 15 CompileError StatusCode = 20 )
type SubmitCheckResult ¶
type SubmitCheckResult struct { StdOutput string `json:"std_output"` CompareResult string `json:"compare_result"` ExpectedOutput string `json:"expected_output"` LastTestcase string `json:"last_testcase"` CodeOutput string `json:"code_output"` FullRuntimeError string `json:"full_runtime_error"` State string `json:"state"` FullCompileError string `json:"full_compile_error"` StatusMemory string `json:"status_memory"` StatusMsg string `json:"status_msg"` StatusRuntime string `json:"status_runtime"` MemoryPercentile float64 `json:"memory_percentile"` TotalCorrect int `json:"total_correct"` TotalTestcases int `json:"total_testcases"` StatusCode int `json:"status_code"` RuntimePercentile float64 `json:"runtime_percentile"` }
func (*SubmitCheckResult) Display ¶
func (sr *SubmitCheckResult) Display() string
func (*SubmitCheckResult) Result ¶
func (sr *SubmitCheckResult) Result() string
type TestCheckResult ¶
type TestCheckResult struct { InputData string State string `json:"state"` StatusMsg string `json:"status_msg"` FullCompileError string `json:"full_compile_error"` FullRuntimeError string `json:"full_runtime_error"` CompareResult string `json:"compare_result"` CodeAnswer []string `json:"code_answer"` CodeOutput []string `json:"code_output"` ExpectedCodeAnswer []string `json:"expected_code_answer"` StatusCode int `json:"status_code"` CorrectAnswer bool `json:"correct_answer"` }
func (*TestCheckResult) Display ¶
func (tr *TestCheckResult) Display() string
func (*TestCheckResult) Result ¶
func (tr *TestCheckResult) Result() string
Click to show internal directories.
Click to hide internal directories.