Documentation
¶
Index ¶
- func AutoName(kind string, t time.Time) string
- func FormatWhen(t time.Time) string
- type Averages
- type Store
- func (s *Store) Averages(kind string) (Averages, error)
- func (s *Store) Close() error
- func (s *Store) CountRuns() (int, error)
- func (s *Store) GetSetting(key, def string) string
- func (s *Store) LatestRuns(n int) ([]TestRun, error)
- func (s *Store) Path() string
- func (s *Store) Reset(wipeSettings bool) error
- func (s *Store) SaveTestRun(r TestRun) (int64, error)
- func (s *Store) SetSetting(key, value string) error
- type TestRun
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatWhen ¶
FormatWhen renders a short local date/time for history rows.
Types ¶
type Averages ¶ added in v1.4.0
Averages holds the mean download/upload/ping across saved runs of a kind.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is a thin SQLite wrapper for settings + saved test runs.
func Open ¶
Open creates (if needed) and opens riptide.db under the user config dir. Path: <UserConfigDir>/riptide/riptide.db
func (*Store) Averages ¶ added in v1.4.0
Averages returns the mean download, upload, and ping over all saved runs of the given kind (empty kind defaults to "speed"). Zero rows yields a Count of 0.
func (*Store) GetSetting ¶
GetSetting reads a setting value; missing keys return def.
func (*Store) LatestRuns ¶
LatestRuns returns the most recent n test runs (newest first).
func (*Store) Reset ¶
Reset clears all test runs and optional settings keys (theme is kept unless wipeSettings).
func (*Store) SaveTestRun ¶
SaveTestRun inserts a named run and returns its id.
func (*Store) SetSetting ¶
SetSetting writes a setting value.