Documentation ¶
Index ¶
- func AddSolution(solution Solution) error
- func AllQuestionTitleSlug() (titles []string, err error)
- func MarkQuestion(question Question) error
- func MarkSolution(solution markSolution) error
- func NewMarkSolution(remark string, s Solution) markSolution
- func ProblemInfoIsExpire() (ok bool, err error)
- func ProblemsTTL(expireAt time.Time) error
- func RemoveSolution(questionID string) error
- func Stats()
- func TidySolution(questionID string) error
- func UpdateProblems(info []QuestionStats) error
- func UpdateQuestionInfo(store Store) error
- type MarkSolutions
- type Question
- type QuestionStats
- type Questions
- type Solution
- type SolutionsList
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllQuestionTitleSlug ¶
func MarkQuestion ¶
func MarkSolution ¶
func MarkSolution(solution markSolution) error
func NewMarkSolution ¶
func ProblemInfoIsExpire ¶
func ProblemsTTL ¶
func TidySolution ¶
func UpdateProblems ¶
func UpdateProblems(info []QuestionStats) error
func UpdateQuestionInfo ¶
Types ¶
type MarkSolutions ¶
type MarkSolutions []markSolution
func ListMarkSolutions ¶
func ListMarkSolutions() (ss MarkSolutions, err error)
func (*MarkSolutions) Add ¶
func (th *MarkSolutions) Add(ms markSolution)
func (MarkSolutions) Bytes ¶
func (th MarkSolutions) Bytes() []byte
func (MarkSolutions) Len ¶
func (th MarkSolutions) Len() int
func (MarkSolutions) Less ¶
func (th MarkSolutions) Less(i, j int) bool
func (MarkSolutions) Swap ¶
func (th MarkSolutions) Swap(i, j int)
type Question ¶
type Question struct { QuestionID string `json:"question_id"` Title string `json:"title"` Remark string `json:"remark"` CreatedAt time.Time `json:"created_at"` }
Question 问题描述
func NewMarkQuestion ¶
NewMarkQuestion 问题书签
type QuestionStats ¶
type QuestionStats struct { QuestionID int `json:"question_id"` QuestionTitle string `json:"question__title"` QuestionTitleSlug string `json:"question__title_slug"` QuestionHide bool `json:"question__hide"` TotalAcs int `json:"total_acs"` TotalSubmitted int `json:"total_submitted"` TotalColumnArticles int `json:"total_column_articles"` FrontendQuestionID string `json:"frontend_question_id"` IsNewQuestion bool `json:"is_new_question"` }
func GetProblemsInfo ¶
func GetProblemsInfo(questionID string) (info QuestionStats, err error)
func (*QuestionStats) Bytes ¶
func (th *QuestionStats) Bytes() []byte
type Solution ¶
type Solution struct { QuestionID string `json:"question_id"` // 问题id Language string `json:"language"` // 语言 CodeHash string `json:"code_hash"` // 实现代码格式化后的hash SourceDir string `json:"source_dir"` // 代码存放目录 Code string `json:"code"` // 实现的代码 Result string `json:"result"` // 测试返回结果 Times int `json:"times"` // 执行次数 Consumption time.Duration `json:"consumption"` // 消耗 Evaluation string `json:"evaluation"` // 运行评价 Remark string `json:"remark"` // 备注 CreatedAt time.Time `json:"create_at"` // 创建内容时间 }
Solution 解题内容
func GetSolution ¶
GetSolution 获取测试过的题解
type SolutionsList ¶
type SolutionsList struct { QuestionID string `json:"question_id"` Version int `json:"version"` Times int `json:"times"` // 执行次数 FirstTime time.Time `json:"first_time"` LastTime time.Time `json:"last_time"` }
func ListSolution ¶
func ListSolution() (sl []SolutionsList, err error)
type Store ¶
type Store struct { Title string `json:"title"` TranslatedTitle string `json:"translated_title"` QuestionID string `json:"question_id"` Languages []string `json:"language"` Tags []string `json:"tags"` Difficulty string `json:"difficulty"` SaveDir []string `json:"save_dir"` TitleSlug string `json:"title_slug"` Question string `json:"question"` }
func QuestionInfo ¶
Click to show internal directories.
Click to hide internal directories.