session.go RawHistoryFolder

1package ports
2
3import (
4	"context"
5	"time"
6
7	"github.com/bnema/vev/internal/protocol"
8)
9
10// ClientConnection is one typed client-side session channel. Close must be
11// concurrent-safe, required to unblock ReceiveServer (and every send mode),
12// and must not need a prior graceful exchange: a retained dormant attachment
13// is closed by the client when it is evicted, replaced, or the runner exits.
14type ClientConnection interface {
15	SendClient(protocol.ClientMessage) error
16	ReceiveServer() (protocol.ServerMessage, error)
17	Capabilities() protocol.ConnectionCapabilities
18	LinkState() LinkState
19	LinkEvents() <-chan LinkEvent
20	Close() error
21}
22
23// ClientDialer establishes typed client-side session connections.
24type ClientDialer interface {
25	Dial(context.Context) (ClientConnection, error)
26}
27
28// ServerConnection is one typed client/daemon session channel. Close must be
29// concurrent-safe and unblock ReceiveClient and every send mode.
30type ServerConnection interface {
31	ReceiveClient() (protocol.ClientMessage, error)
32	SendServer(protocol.ServerMessage) error
33	SendServerAsync(protocol.ServerMessage) error
34	SendServerSynchronous(protocol.ServerMessage) error
35	SendOutput(protocol.Output) error
36	SendOutputAsync(protocol.Output) error
37	SendOutputSynchronous(protocol.Output) error
38	Capabilities() protocol.ConnectionCapabilities
39	LinkState() LinkState
40	LinkEvents() <-chan LinkEvent
41	Close() error
42}
43
44// HandshakeDeadlineProvider is an optional boundary-safe port implemented by
45// accepted server connections that already own an absolute handshake deadline
46// fixed before the daemon saw them - for example a connection admitted by a mux
47// listener whose stream spent part of its budget waiting in an accept queue.
48//
49// HandshakeDeadline returns that absolute deadline, stable for the connection's
50// lifetime and never restarted. A daemon-consuming use case adopts it verbatim
51// for the one handshake context that covers the first ReceiveClient through
52// Welcome and the committed initial publication, so queue delay and the
53// handshake share a single budget; an already-elapsed deadline fails the
54// handshake promptly instead of starting a second protocol.HandshakeTimeout. A
55// connection that does not implement this port keeps the ordinary behavior of a
56// fresh budget started when the daemon takes it.
57//
58// Completion is deliberately not part of this port: an accepted connection may
59// finish its transport preamble earlier, but the daemon's budget must end only
60// where it commits its initial publication.
61type HandshakeDeadlineProvider interface {
62	HandshakeDeadline() time.Time
63}
64
65// ServerListener accepts typed server-side session connections.
66type ServerListener interface {
67	Accept() (ServerConnection, error)
68	Close() error
69	Addr() string
70}

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