Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseQuestion ¶
type BaseQuestion struct { Problems Problems `json:"-"` Referer string `json:"-"` Codes Codes `json:"-"` QuestionID string `json:"questionId"` QuestionTitle string `json:"questionTitle"` Content string `json:"content"` Difficulty string `json:"difficulty"` DiscussURL string `json:"discussUrl"` CategoryTitle string `json:"categoryTitle"` SubmitURL string `json:"submitUrl"` InterpretURL string `json:"interpretUrl"` CodeDefinition string `json:"codeDefinition"` MetaData string `json:"metaData"` EnvInfo string `json:"envInfo"` Article string `json:"article"` QuestionDetailURL string `json:"questionDetailUrl"` DiscussCategoryID string `json:"discussCategoryId"` }
BaseQuestion the structure of the base question
func (*BaseQuestion) Do ¶
func (q *BaseQuestion) Do(key string) error
Do do requesting and parse the response data
func (BaseQuestion) GetCodeDefinition ¶
func (q BaseQuestion) GetCodeDefinition(lang string) (code string, err error)
GetCodeDefinition returns code definition of question
func (BaseQuestion) GetEnvInfo ¶
func (q BaseQuestion) GetEnvInfo(lang string) (info []string, err error)
GetEnvInfo returns env info
type Code ¶
type Code struct { Text string `json:"text"` Value string `json:"value"` DefaultCode string `json:"defaultCode"` }
Code the struct of leetcode codes.
type ProblemStat ¶
type ProblemStat struct { TotalAcs int `json:"total_acs"` QuestionTitle string `json:"question__title"` IsNewQuestion bool `json:"is_new_question"` QuestionArticleSlug string `json:"question__article__slug"` TotalSubmitted int `json:"total_submitted"` FrontendQuestionID int `json:"frontend_question_id"` QuestionTitleSlug string `json:"question__title_slug"` QuestionArticleLive bool `json:"question__article__live"` QuestionHide bool `json:"question__hide"` QuestionID int `json:"question_id"` }
ProblemStat the structure of a problem stat
type ProblemStatStatus ¶
type ProblemStatStatus struct { Stat ProblemStat `json:"stat"` Difficulty struct { Level int `json:"level"` } `json:"difficulty"` }
ProblemStatStatus the structure of a problem status
type Problems ¶
type Problems struct { StatStatusPairs []ProblemStatStatus `json:"stat_status_pairs"` NumTotal int `json:"num_total"` }
Problems the structure of all problems
func (Problems) StatStatus ¶
func (p Problems) StatStatus(s string) *ProblemStatStatus
StatStatus returns ProblemStatStatus with id or title string
type Response ¶
type Response struct {
Data ResponseData `json:"data"`
}
Response the structure of leetcode response
type ResponseData ¶
type ResponseData struct {
Question interface{} `json:"question"`
}
ResponseData the structure of leetcode response data
Click to show internal directories.
Click to hide internal directories.