detached 8661704

docs(ports): clarify store slice ownership

commit
8661704729a52061911fd8c58612de4f95448af9
author
brice · · 2026-07-15 04:57 UTC
parent
c3dcda7
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
1 file · +4 -0
M internal/ports/store.go +4 -0
@@ -4,10 +4,14 @@ package ports
44 //
55 // Implementations may buffer writes; Sync is the durability barrier.
66 type Store interface {
7+ // Get returns a stable copy of the value for key. The caller owns the
8+ // returned slice and may retain or mutate it.
79 Get(key []byte) ([]byte, bool)
810 Set(key, val []byte) error
911 Delete(key []byte) error
1012 // Range iterates key/value pairs; fn returning false stops iteration early.
13+ // Each key and value is a stable copy owned by the caller, which may retain
14+ // or mutate either slice after Range returns.
1115 Range(fn func(k, v []byte) bool)
1216 Sync() error
1317 Close() error
@@ -4,10 +4,14 @@ package ports
4 //4 //
5 // Implementations may buffer writes; Sync is the durability barrier.5 // Implementations may buffer writes; Sync is the durability barrier.
6 type Store interface {6 type Store interface {
7+ // Get returns a stable copy of the value for key. The caller owns the
8+ // returned slice and may retain or mutate it.
7 Get(key []byte) ([]byte, bool)9 Get(key []byte) ([]byte, bool)
8 Set(key, val []byte) error10 Set(key, val []byte) error
9 Delete(key []byte) error11 Delete(key []byte) error
10 // Range iterates key/value pairs; fn returning false stops iteration early.12 // Range iterates key/value pairs; fn returning false stops iteration early.
13+ // Each key and value is a stable copy owned by the caller, which may retain
14+ // or mutate either slice after Range returns.
11 Range(fn func(k, v []byte) bool)15 Range(fn func(k, v []byte) bool)
12 Sync() error16 Sync() error
13 Close() error17 Close() error

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