v0.2.0 80c61e3

wire.go RawHistoryFolder

1// Package daemon holds vev's server-side session multiplexer use case.
2package daemon
3
4import (
5	"github.com/bnema/vev/internal/domain"
6	"github.com/bnema/vev/internal/ports"
7)
8
9func frameWelcome(s *session, resumeToken uint64) (ports.Frame, error) {
10	s.mu.Lock()
11	var identity *ports.CommittedRouteIdentity
12	if s.incarnation != (domain.SessionLifecycleID{}) {
13		identity = &ports.CommittedRouteIdentity{
14			Target:    ports.ExactSessionTarget{LifecycleID: s.incarnation, SessionName: s.name},
15			Ephemeral: s.ephemeral,
16		}
17	}
18	w := ports.Welcome{
19		SessionID:         string(s.id),
20		SessionName:       s.name,
21		Ephemeral:         s.ephemeral,
22		Capabilities:      ports.CapabilityResume,
23		CommittedIdentity: identity,
24	}
25	s.mu.Unlock()
26	w.ResumeToken = resumeToken
27	payload := ports.MarshalWelcome(w)
28	if payload == nil {
29		return ports.Frame{}, ports.ErrInvalidRouteWire
30	}
31	return ports.Frame{Type: ports.MsgWelcome, Payload: payload}, nil
32}
33
34func frameError(code uint16, text string) ports.Frame {
35	return ports.Frame{Type: ports.MsgError, Payload: ports.MarshalErrorMsg(ports.ErrorMsg{Code: code, Text: text})}
36}
37
38func frameOutputState(b []byte, baseState uint64, state uint64, echoAck uint64) (ports.Frame, error) {
39	payload, err := ports.MarshalOutput(ports.Output{
40		Epoch: 1, Base: baseState, New: state, Echo: echoAck,
41		Size: domain.Size{Cols: 1, Rows: 1}, Full: state != 0 && baseState == 0, Data: b,
42	})
43	if err != nil {
44		return ports.Frame{}, err
45	}
46	return ports.Frame{Type: ports.MsgOutput, Payload: payload}, nil
47}
48
49func frameDetached(reason uint8) ports.Frame {
50	return ports.Frame{Type: ports.MsgDetached, Payload: ports.MarshalDetached(ports.Detached{Reason: reason})}
51}
52
53func framePong() ports.Frame {
54	return ports.Frame{Type: ports.MsgPong, Payload: ports.MarshalPong(ports.Pong{})}
55}
56
57func frameSessions(infos []ports.SessionInfo) ports.Frame {
58	return ports.Frame{Type: ports.MsgSessions, Payload: ports.MarshalSessions(ports.Sessions{Sessions: infos})}
59}

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