storage

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHistoryFilePath

func GetHistoryFilePath() (string, error)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL