transport.go RawHistoryFolder

1package wire
2
3import "context"
4
5// Envelope is the unit of exchange over a Transport: one complete
6// serialized Protobuf envelope (client, server, or preamble), without any
7// legacy type byte. The payload is owned by the caller on Send and by the
8// receiver on Recv; Transports copy across queue boundaries so either side
9// may retain it.
10type Envelope struct {
11	Payload []byte
12}
13
14// Transport is an envelope channel over a single connection. Close must be
15// safe to call concurrently with Send and Recv, and must unblock active
16// Send and Recv calls.
17type Transport interface {
18	Send(Envelope) error
19	Recv() (Envelope, error) // blocking; io.EOF on close
20	Close() error
21}
22
23// DatagramTransport marks transports backed by a datagram link. Typed session
24// adapters translate this carriage detail into semantic capabilities.
25type DatagramTransport interface {
26	Transport
27	DatagramTransport()
28}
29
30// AsyncTransport accepts envelopes for ordered background transmission.
31// SendAsync returns once the adapter owns the envelope; Send retains its
32// synchronous wire-attempt contract. Daemon paint output may use this
33// capability to pipeline.
34type AsyncTransport interface {
35	SendAsync(Envelope) error
36}
37
38// OwnedSynchronousTransport owns the complete bounded synchronous operation,
39// including adapter queues, pacing, write deadlines, and close cancellation.
40type OwnedSynchronousTransport interface {
41	SendSynchronous(Envelope) error
42}
43
44// BoundedTransport is a Transport whose receive path accepts a caller-supplied
45// ceiling: RecvBounded validates the framed length prefix against limit before
46// allocating or reading the body, so a peer cannot force a large allocation by
47// advertising a huge frame. The effective bound is the smaller of limit and the
48// transport's own framed ceiling, so it can only narrow a carriage that already
49// enforces one. Every vev stream carriage (IPC, QUIC, SSH stdio) implements it;
50// callers that need a bounded read assert this optional capability, leaving the
51// base Transport contract unchanged.
52type BoundedTransport interface {
53	Transport
54	RecvBounded(limit uint64) (Envelope, error)
55}
56
57// Dialer establishes outbound raw carriage connections.
58type Dialer interface {
59	Dial(context.Context) (Transport, error)
60}
61
62// Listener accepts incoming raw carriage connections.
63type Listener interface {
64	Accept() (Transport, error)
65	Close() error
66	Addr() string
67}

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