detached ece7682

link.go RawHistoryFolder

1package ports
2
3import "time"
4
5// LinkState reports best-effort transport health without changing Transport.
6// Implementations may distinguish authenticated path contact from useful
7// stream progress when classifying the link.
8type LinkState int
9
10const (
11	// LinkStateConnected means a complete record or meaningful acknowledgement
12	// progress was observed recently.
13	LinkStateConnected LinkState = iota
14	// LinkStateDegraded means authenticated packets still reach the path, but
15	// complete records and acknowledgement progress have stalled.
16	LinkStateDegraded
17	// LinkStateProbing means packet contact is silent or pending data has made no
18	// round-trip progress long enough for path recovery to begin.
19	LinkStateProbing
20	// LinkStateOffline means authenticated packet contact has been absent long
21	// enough for the client to resume over its fallback transport.
22	LinkStateOffline
23	// LinkStateDead means prolonged authenticated-packet silence has made the
24	// transport terminal.
25	LinkStateDead
26)
27
28func (s LinkState) String() string {
29	switch s {
30	case LinkStateConnected:
31		return "connected"
32	case LinkStateDegraded:
33		return "degraded"
34	case LinkStateProbing:
35		return "probing"
36	case LinkStateOffline:
37		return "offline"
38	case LinkStateDead:
39		return "dead"
40	default:
41		return "unknown"
42	}
43}
44
45// LinkEvent is emitted when a transport's observed link state changes.
46type LinkEvent struct {
47	State LinkState
48	At    time.Time
49	Err   error
50}
51
52// LinkStateReporter is an optional boundary-safe port implemented by transports
53// that can report link degradation before Transport fails terminally.
54//
55// LinkEvents returns a best-effort event stream. Implementations must not block
56// transport progress while publishing events; use a buffered channel and drop
57// events when the consumer is slow. The channel is not required to close on
58// transport shutdown, so consumers should also watch their own context or the
59// underlying Transport result.
60type LinkStateReporter interface {
61	LinkState() LinkState
62	LinkEvents() <-chan LinkEvent
63}

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