Documentation ¶
Index ¶
- type Algorithm
- type AlgorithmList
- type CodeSnippet
- type ConnectionInfo
- type ConnectionInfoGetter
- type HistoryReturn
- type HistoryReturnShell
- type Leetcode
- func (l *Leetcode) History(titleSlug string, limit int, cookies []*http.Cookie) ([]byte, error)
- func (l *Leetcode) Login() ([]*http.Cookie, error)
- func (l *Leetcode) Problem(category string, num int)
- func (l *Leetcode) ProblemDetail(titleSlug string, cookies []*http.Cookie) ([]byte, error)
- func (l *Leetcode) ProblemList(cookies []*http.Cookie) ([]byte, error)
- func (l *Leetcode) Submit(titleSlug string, body string, cookies []*http.Cookie) ([]byte, error)
- type LeetcodeClientConfig
- type Level
- type Question
- type QuestionMiddle
- type QuestionReturn
- type Spider
- type Stat
- type Submission
- type SubmissionList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlgorithmList ¶
type CodeSnippet ¶
type ConnectionInfo ¶
func NewConnectionInfo ¶
func NewConnectionInfo(cookies []*http.Cookie) ConnectionInfo
type ConnectionInfoGetter ¶
type ConnectionInfoGetter interface {
GetConnectionInfo(username string) (ConnectionInfo, error)
}
type HistoryReturn ¶
type HistoryReturn struct {
List SubmissionList `json:"submissionList"`
}
type HistoryReturnShell ¶
type HistoryReturnShell struct {
Data HistoryReturn `json:"data"`
}
type Leetcode ¶
func NewLeetcodeClient ¶
func (*Leetcode) ProblemDetail ¶
func (*Leetcode) ProblemList ¶
type LeetcodeClientConfig ¶
type Question ¶
type Question struct { TypeName string `json:"__typename"` LibraryUrl string `json:"libraryUrl"` Content string `json:"content"` Difficulty string `json:"difficulty"` Dislikes int `json:"dislikes"` Hints []string `json:"hints"` Metadata string `json:"metadata"` QuestionId string `json:"questionId"` QuestionFrontendId string `json:"questionFrontendId"` SampleTestCase string `json:"sampleTestCase"` Title string `json:"title"` TitleSlug string `json:"titleSlug"` CodeSnippets []CodeSnippet `json:"codeSnippets"` }
type QuestionMiddle ¶
type QuestionMiddle struct {
Data Question `json:"question"`
}
type QuestionReturn ¶
type QuestionReturn struct {
Real QuestionMiddle `json:"data"`
}
type Spider ¶
type Spider interface { Login() ([]*http.Cookie, error) ProblemList(cookies []*http.Cookie) ([]byte, error) ProblemDetail(titleSlug string, cookies []*http.Cookie) ([]byte, error) // AlgorithmsList() // AlgorithmsDetail() // AllProblems() Submit(titleSlug string, body string, cookies []*http.Cookie) ([]byte, error) History(titleSlug string, limit int, cookies []*http.Cookie) ([]byte, error) }
type Stat ¶
type Stat struct { QuestionID int `json:"question_id"` QuestionArticleLive bool `json:"question__article__live"` QuestionArticleSlug string `json:"question__article__slug"` QuestionTitle string `json:"question__title"` QuestionTitleSlug string `json:"question__title_slug"` QuestionHide bool `json:"question_hide"` TotalAcs int `json:"total_acs"` TotalSubmmitted int `json:"total_submitted"` Frontend_question_id int `json:"frontend_question_id"` IsNewQuestion bool `json:"is_new_question"` }
type Submission ¶
type Submission struct { Id string `json:"id"` StatusDisplay string `json:"statusDisplay"` Lang string `json:"lang"` Runtime string `json:"runtime"` TimeStamp string `json:"timestamp"` Url string `json:"url"` IsPending string `json:"isPending"` Memory string `json:"memory"` TypeName string `json:"__typename"` }
type SubmissionList ¶
type SubmissionList struct { LastKey string `json:"lastKey"` HasNext bool `json:"hasNext"` Submissions []Submission `json:"submissions"` TypeName string `json:"__typename"` }
Click to show internal directories.
Click to hide internal directories.