Documentation
¶
Index ¶
- Constants
- func Copy(srcFile, dstFile string) error
- func CopyDirectory(scrDir, dest string) error
- func CopyFile(dstName, srcName string) (written int64, err error)
- func CopySymLink(source, dest string) error
- func CreateIfNotExists(dir string, perm os.FileMode) error
- func CustomerCode(code string) string
- func CustomerCodeLine(code string) int
- func CustomerCodeLineByFile(dir string) int
- func Exists(filePath string) bool
- func GetAllQuestionTitleSlug() (res []string)
- func GetQuestionInfo(titleSlug string) (info store.Store)
- func GetQuestionInfoByID(questionID string) (info store.Store)
- func GolangClear(dir string) (err error)
- func InfoPrint(info store.Store, withDetail bool)
- func Parse(param string) string
- func ParseFromURL(param string) string
- func ProblemID2name(id string) (stats store.QuestionStats, err error)
- func Timeout(duration time.Duration, ...) (ok bool)
- func UpdateQuestionInfo(que Question, local Localization)
- type AllProblemsResult
- type BackupClear
- type CodeSnippet
- type Localization
- type Question
- type QuestionDetail
- type SaveOption
- type TestLog
Constants ¶
View Source
const UA = `Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.93 Safari/537.36`
Variables ¶
This section is empty.
Functions ¶
func CopyDirectory ¶
func CopySymLink ¶
func CustomerCodeLineByFile ¶
func GetAllQuestionTitleSlug ¶
func GetAllQuestionTitleSlug() (res []string)
func GetQuestionInfo ¶
func GetQuestionInfoByID ¶
func GolangClear ¶
func Parse ¶
Parse ... param: 222 param: https://leetcode-cn.com/problems/k-th-symbol-in-grammar param: https://leetcode-cn.com/problems/k-th-symbol-in-grammar/solution/ param: leetcode-cn.com/problems/k-th-symbol-in-grammar
func ParseFromURL ¶
ParseFromURL param: https://leetcode-cn.com/problems/k-th-symbol-in-grammar param: https://leetcode-cn.com/problems/k-th-symbol-in-grammar/solution/ param: leetcode-cn.com/problems/k-th-symbol-in-grammar
func ProblemID2name ¶
func ProblemID2name(id string) (stats store.QuestionStats, err error)
ProblemID2name return problem info
func UpdateQuestionInfo ¶
func UpdateQuestionInfo(que Question, local Localization)
Types ¶
type AllProblemsResult ¶
type AllProblemsResult struct {
UserName string `json:"user_name"`
NumSolved int `json:"num_solved"`
NumTotal int `json:"num_total"`
AcEasy int `json:"ac_easy"`
AcMedium int `json:"ac_medium"`
AcHard int `json:"ac_hard"`
StatStatusPairs []struct {
Stat store.QuestionStats `json:"stat"`
Status interface{} `json:"status"`
Difficulty struct {
Level int `json:"level"`
} `json:"difficulty"`
PaidOnly bool `json:"paid_only"`
IsFavor bool `json:"is_favor"`
Frequency int `json:"frequency"`
Progress int `json:"progress"`
} `json:"stat_status_pairs"`
FrequencyHigh int `json:"frequency_high"`
FrequencyMid int `json:"frequency_mid"`
CategorySlug string `json:"category_slug"`
}
type BackupClear ¶
func (BackupClear) Backup ¶
func (th BackupClear) Backup(override bool) error
func (BackupClear) Clear ¶
func (th BackupClear) Clear() (err error)
type CodeSnippet ¶
type Localization ¶
type Localization struct {
TitleSlug string `json:"title_slug"`
QuestionID string `json:"question_id"`
Title string `json:"title"`
Difficulty string `json:"difficulty"`
Question string `json:"question"`
CodeSnippets []CodeSnippet `json:"code_snippets"`
SampleTestCase string `json:"sample_test_case"`
SaveDirs []string `json:"save_dirs"`
}
func (*Localization) Save ¶
func (th *Localization) Save(override bool)
type Question ¶
type Question struct {
QuestionID string `json:"questionId"`
QuestionFrontendID string `json:"questionFrontendId"`
BoundTopicID int `json:"boundTopicId"`
Title string `json:"title"`
TitleSlug string `json:"titleSlug"`
Content string `json:"content"`
TranslatedTitle string `json:"translatedTitle"`
TranslatedContent string `json:"translatedContent"`
IsPaidOnly bool `json:"isPaidOnly"`
Difficulty string `json:"difficulty"`
Likes int `json:"likes"`
Dislikes int `json:"dislikes"`
IsLiked interface{} `json:"isLiked"`
SimilarQuestions string `json:"similarQuestions"`
Contributors []interface{} `json:"contributors"`
LangToValidPlayground string `json:"langToValidPlayground"`
TopicTags []struct {
Name string `json:"name"`
Slug string `json:"slug"`
TranslatedName string `json:"translatedName"`
Typename string `json:"__typename"`
} `json:"topicTags"`
CompanyTagStats interface{} `json:"companyTagStats"`
CodeSnippets []CodeSnippet `json:"codeSnippets"`
Stats string `json:"stats"`
Hints []interface{} `json:"hints"`
Solution interface{} `json:"solution"`
Status interface{} `json:"status"`
SampleTestCase string `json:"sampleTestCase"`
MetaData string `json:"metaData"`
JudgerAvailable bool `json:"judgerAvailable"`
JudgeType string `json:"judgeType"`
MysqlSchemas []interface{} `json:"mysqlSchemas"`
EnableRunCode bool `json:"enableRunCode"`
EnvInfo string `json:"envInfo"`
Book interface{} `json:"book"`
IsSubscribed bool `json:"isSubscribed"`
IsDailyQuestion bool `json:"isDailyQuestion"`
DailyRecordStatus interface{} `json:"dailyRecordStatus"`
EditorType string `json:"editorType"`
UgcQuestionID interface{} `json:"ugcQuestionId"`
Style string `json:"style"`
Typename string `json:"__typename"`
}
type QuestionDetail ¶
type QuestionDetail struct {
Data struct {
Question Question `json:"question"`
} `json:"data"`
}
func Fetch ¶
func Fetch(title string) (qd QuestionDetail, err error)
func (*QuestionDetail) Download ¶
func (th *QuestionDetail) Download(override bool)
type SaveOption ¶
type SaveOption struct {
SaveDir, Title, TitleSlug,
Difficulty, Question, CodeSnippet,
SampleTestCase, Language string
}
func (SaveOption) SaveQuestion ¶
func (th SaveOption) SaveQuestion() (err error)
type TestLog ¶
type TestLog struct {
// contains filtered or unexported fields
}
func NewTestLog ¶
func (*TestLog) SetMaxLength ¶
Click to show internal directories.
Click to hide internal directories.