Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetHistoryFilePath ¶
GetHistoryFilePath resolves standard OS user config directory ~/.config/jeeratype/history.jsonl with fallback to working directory / temp dir if permissions are restricted.
func SaveRecord ¶
func SaveRecord(rec HistoryRecord) error
SaveRecord appends a single completed test result to history.jsonl
Types ¶
type HistoryRecord ¶
type HistoryRecord struct {
Timestamp time.Time `json:"timestamp"`
DurationSec int `json:"duration_sec"`
WPM float64 `json:"wpm"`
RawWPM float64 `json:"raw_wpm"`
Accuracy float64 `json:"accuracy"`
Consistency float64 `json:"consistency"`
TotalChars int `json:"total_chars"`
CorrectChars int `json:"correct_chars"`
ErrorCount int `json:"error_count"`
}
HistoryRecord represents a saved test result entry.
func LoadHistory ¶
func LoadHistory() ([]HistoryRecord, error)
LoadHistory reads all past records from history.jsonl
Click to show internal directories.
Click to hide internal directories.