Documentation
¶
Overview ¶
Package core implements the core models for the leetsolv application.
Index ¶
Constants ¶
View Source
const MaxFamiliarity = int(VeryEasy) + 1
View Source
const MaxImportance = int(CriticalImportance) + 1
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionType ¶
type ActionType string
ActionType defines the type of action performed.
const ( ActionAdd ActionType = "add" ActionUpdate ActionType = "update" ActionDelete ActionType = "delete" )
func (ActionType) PastTenseString ¶
func (a ActionType) PastTenseString() string
func (ActionType) String ¶
func (a ActionType) String() string
type DefaultRand ¶ added in v1.2.0
type DefaultRand struct{}
DefaultRand uses the global math/rand/v2 functions.
func (DefaultRand) IntN ¶ added in v1.2.0
func (DefaultRand) IntN(n int) int
type Familiarity ¶
type Familiarity int
const ( VeryHard Familiarity = iota Hard Medium Easy VeryEasy )
type FixedRand ¶ added in v1.2.0
type FixedRand struct {
Value int
}
FixedRand returns a fixed value for deterministic tests.
type Importance ¶
type Importance int
const ( LowImportance Importance = iota MediumImportance HighImportance CriticalImportance )
type Platform ¶ added in v1.1.0
type Platform string
Platform represents the source platform of a DSA problem
type Question ¶
type Question struct {
ID int `json:"id"`
URL string `json:"url"`
Note string `json:"note"`
Familiarity Familiarity `json:"familiarity"`
Importance Importance `json:"importance"`
LastReviewed time.Time `json:"last_reviewed"`
NextReview time.Time `json:"next_review"`
ReviewCount int `json:"review_count"`
EaseFactor float64 `json:"ease_factor"`
UpdatedAt time.Time `json:"updated_at"`
CreatedAt time.Time `json:"created_at"`
}
type QuestionMap ¶
type SM2Scheduler ¶
SM2Scheduler implements the spaced repetition scheduling logic
func NewSM2Scheduler ¶
func NewSM2Scheduler(cfg *config.Config, clock clock.Clock) *SM2Scheduler
func NewSM2SchedulerWithRand ¶ added in v1.2.0
func (SM2Scheduler) CalculatePriorityScore ¶
func (s SM2Scheduler) CalculatePriorityScore(q *Question) float64
func (SM2Scheduler) Schedule ¶
func (s SM2Scheduler) Schedule(q *Question, memory MemoryUse)
func (SM2Scheduler) ScheduleNewQuestion ¶
func (s SM2Scheduler) ScheduleNewQuestion(q *Question, memory MemoryUse) *Question
type SearchFilter ¶
type SearchFilter struct {
Familiarity *Familiarity `json:"familiarity,omitempty"`
Importance *Importance `json:"importance,omitempty"`
ReviewCount *int `json:"review_count,omitempty"`
DueOnly bool `json:"due_only,omitempty"`
}
SearchFilter defines filtering criteria for question search
Click to show internal directories.
Click to hide internal directories.