Versions in this module Expand all Collapse all v0 v0.0.2 Oct 14, 2020 Changes in this version + const EXEC + const Easy + const GENERATE + const HELP + const Hard + const LIST + const Medium + const PICK + const TEST + var CmdMap = map[CmdName]Cmd + var PaidOnlyError = fmt.Errorf("not support premium question for now") + func ShowUsage(w io.Writer) error + type CheckResult struct + CodeAnswer []string + CodeOutput interface{} + CompareResult string + CompileError string + CorrectAnswer bool + ElapsedTime int + ExpectedCodeAnswer []string + ExpectedCodeOutput []interface{} + ExpectedElapsedTime int + ExpectedLang string + ExpectedMemory int + ExpectedRunSuccess bool + ExpectedStatusCode int + ExpectedStatusRuntime string + ExpectedTaskFinishTime int64 + FullCompileError string + Lang string + LastTestcase string + Memory int + MemoryPercentile interface{} + PrettyLang string + QuestionID string + RunSuccess bool + RuntimePercentile interface{} + State string + StatusCode int + StatusMemory string + StatusMsg string + StatusRuntime string + StdOutput string + SubmissionID string + TaskFinishTime int64 + TotalCorrect int + TotalTestcases int + type Cmd interface + MaxArg func() int + Name func() string + Run func(context.Context, io.Writer, []string) error + Usage func() string + type CmdName string + type Code struct + DefaultCode string + Text string + Value string + type Codes []*Code + func (c *Codes) UnmarshalJSON(b []byte) error + type Difficulty struct + Level Level + type ExecCmd struct + func (c *ExecCmd) MaxArg() int + func (c *ExecCmd) Name() string + func (c *ExecCmd) Run(ctx context.Context, out io.Writer, args []string) error + func (c *ExecCmd) Usage() string + type Format struct + CodeDefinition *Code + Content string + EnableRunCode bool + MetaData string + QuestionID string + Referer string + SampleTestCase string + Stats string + type GenerateCmd struct + func (c *GenerateCmd) Name() string + func (g *GenerateCmd) MaxArg() int + func (g *GenerateCmd) Run(ctx context.Context, out io.Writer, args []string) error + func (g *GenerateCmd) Usage() string + type GetQuestionBody struct + OperationName string + Query string + Variables GetQuestionVariables + type GetQuestionDetailResult struct + Data QdrData + type GetQuestionResponse struct + Data GetQuestionResponseData + type GetQuestionResponseData struct + Question *Question + type GetQuestionVariables struct + TitleSlug string + type HelpCmd struct + func (c *HelpCmd) MaxArg() int + func (c *HelpCmd) Name() string + func (c *HelpCmd) Run(ctx context.Context, out io.Writer, args []string) error + func (c *HelpCmd) Usage() string + type LCOp func(*LeetCode) error + type LeetCode struct + BaseURL string + func NewLeetCode(ops ...LCOp) (*LeetCode, error) + func (lc *LeetCode) Check(ctx context.Context, q *Question, id string) (*CheckResult, error) + func (lc *LeetCode) GetProblems(ctx context.Context) (*ProblemsResult, error) + func (lc *LeetCode) GetQuestion(ctx context.Context, stat Stat) (*Question, error) + func (lc *LeetCode) GetQuestionByFrontendID(ctx context.Context, id int) (*Question, error) + func (lc *LeetCode) GetStats(ctx context.Context) ([]*StatStatusPair, error) + func (lc *LeetCode) Submit(ctx context.Context, q *Question, ans string) (string, error) + func (lc *LeetCode) Test(ctx context.Context, q *Question, ans string) (string, error) + type Level int + func (l Level) String() string + type ListCmd struct + func (c *ListCmd) MaxArg() int + func (c *ListCmd) Name() string + func (c *ListCmd) Run(ctx context.Context, out io.Writer, _ []string) error + func (c *ListCmd) Usage() string + type PickCmd struct + func (c *PickCmd) MaxArg() int + func (c *PickCmd) Name() string + func (c *PickCmd) Run(ctx context.Context, out io.Writer, args []string) error + func (c *PickCmd) Usage() string + type ProblemsResult struct + AcEasy int + AcHard int + AcMedium int + CategorySlug string + FrequencyHigh int + FrequencyMid int + NumSolved int + NumTotal int + StatStatusPairs []*StatStatusPair + UserName string + type QdrData struct + IsCurrentUserAuthenticated bool + Question Question + type Question struct + CodeDefinition Codes + Content string + EnableRunCode bool + FrontendQuestionID int + MetaData string + QuestionID string + Referer string + SampleTestCase string + Slug string + Stats string + TranslatedContent interface{} + type SolutionRequest struct + DataInput string + Lang string + Name string + QuestionID string + TestMode string + TypedCode string + type SolutionResult struct + InterpretID string + TestCase string + type Stat struct + FrontendQuestionID int + IsNewQuestion bool + QuestionArticleLive interface{} + QuestionArticleSlug interface{} + QuestionHide bool + QuestionID int + QuestionTitle string + QuestionTitleSlug string + TotalAcs int + TotalSubmitted int + type StatStatusPair struct + Difficulty Difficulty + Frequency int + IsFavor bool + PaidOnly bool + Progress int + Stat Stat + Status interface{} + type SubmitRequest struct + JudgeType string + Lang string + Name string + QuestionID string + TestMode string + TypedCode string + type SubmitResult struct + SubmissionID int + type TestCmd struct + func (c *TestCmd) MaxArg() int + func (c *TestCmd) Name() string + func (c *TestCmd) Run(ctx context.Context, out io.Writer, args []string) error + func (c *TestCmd) Usage() string