clock.go RawHistoryFolder

1// Package clock provides the production ports.Clock: a thin wrapper over the
2// standard library's time package. Usecases depend on ports.Clock so their
3// time-dependent logic (the daemon's debounced render scheduler) can be driven
4// deterministically in tests via mocks, while the app wires this real clock.
5package clock
6
7import (
8	"time"
9
10	"github.com/bnema/vev/internal/ports"
11)
12
13// realClock implements ports.Clock over the wall clock.
14type realClock struct{}
15
16// New returns the production ports.Clock.
17func New() ports.Clock { return realClock{} }
18
19func (realClock) Now() time.Time { return time.Now() }
20
21func (realClock) NewTimer(d time.Duration) ports.Timer {
22	return &realTimer{t: time.NewTimer(d)}
23}
24
25// realTimer adapts *time.Timer to ports.Timer.
26type realTimer struct{ t *time.Timer }
27
28func (r *realTimer) C() <-chan time.Time        { return r.t.C }
29func (r *realTimer) Reset(d time.Duration) bool { return r.t.Reset(d) }
30func (r *realTimer) Stop() bool                 { return r.t.Stop() }

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 12

Tags 11

↑↓ moveenter openesc close