v0.20.0 c741a39

history.go RawHistoryFolder

1package repository
2
3import (
4	"context"
5	"time"
6
7	"github.com/bnema/dumber/internal/domain/entity"
8)
9
10// HistoryRepository defines operations for browsing history persistence.
11type HistoryRepository interface {
12	// Save creates or updates a history entry (upsert).
13	Save(ctx context.Context, entry *entity.HistoryEntry) error
14
15	// FindByURL retrieves a history entry by its URL.
16	FindByURL(ctx context.Context, url string) (*entity.HistoryEntry, error)
17
18	// Search performs a fuzzy search on history entries.
19	Search(ctx context.Context, query string, limit int) ([]entity.HistoryMatch, error)
20
21	// GetRecent retrieves recent history entries with pagination.
22	GetRecent(ctx context.Context, limit, offset int) ([]*entity.HistoryEntry, error)
23
24	// IncrementVisitCount increments the visit count for a URL.
25	IncrementVisitCount(ctx context.Context, url string) error
26
27	// Delete removes a single history entry by ID.
28	Delete(ctx context.Context, id int64) error
29
30	// DeleteOlderThan removes entries older than the given time.
31	DeleteOlderThan(ctx context.Context, before time.Time) error
32
33	// DeleteAll removes all history entries.
34	DeleteAll(ctx context.Context) error
35
36	// DeleteByDomain removes all history entries for a domain.
37	DeleteByDomain(ctx context.Context, domain string) error
38
39	// GetStats retrieves overall history statistics.
40	GetStats(ctx context.Context) (*entity.HistoryStats, error)
41
42	// GetDomainStats retrieves per-domain statistics.
43	GetDomainStats(ctx context.Context, limit int) ([]*entity.DomainStat, error)
44
45	// GetHourlyDistribution retrieves hourly visit distribution.
46	GetHourlyDistribution(ctx context.Context) ([]*entity.HourlyDistribution, error)
47
48	// GetDailyVisitCount retrieves daily visit counts for the given period.
49	GetDailyVisitCount(ctx context.Context, daysAgo string) ([]*entity.DailyVisitCount, error)
50}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 8

Tags 42

↑↓ moveenter openesc close