v0.1.0 602baa7

replies_generated.go RawHistoryFolder

1// Code generated by xtgen; DO NOT EDIT.
2package xcmisc
3
4import "encoding/binary"
5
6// GetVersionReply is a zero-copy view over a GetVersion reply; offsets count from reply byte 0.
7// It borrows the reply bytes: valid only until the Handler callback returns, because the read ring is reused. Copy what you keep.
8type GetVersionReply struct{ raw []byte }
9
10// ParseGetVersionReply validates raw (the whole reply, 32+4*length bytes) once; getters do not re-check.
11func ParseGetVersionReply(raw []byte) (GetVersionReply, bool) {
12	if len(raw) < 32 {
13		return GetVersionReply{}, false
14	}
15	r := GetVersionReply{raw: raw}
16	return r, true
17}
18func (r GetVersionReply) Raw() []byte { return r.raw }
19func (r GetVersionReply) ServerMajorVersion() uint16 {
20	return uint16(binary.LittleEndian.Uint16(r.raw[8:]))
21}
22func (r GetVersionReply) ServerMinorVersion() uint16 {
23	return uint16(binary.LittleEndian.Uint16(r.raw[10:]))
24}
25
26// GetXIDRangeReply is a zero-copy view over a GetXIDRange reply; offsets count from reply byte 0.
27// It borrows the reply bytes: valid only until the Handler callback returns, because the read ring is reused. Copy what you keep.
28type GetXIDRangeReply struct{ raw []byte }
29
30// ParseGetXIDRangeReply validates raw (the whole reply, 32+4*length bytes) once; getters do not re-check.
31func ParseGetXIDRangeReply(raw []byte) (GetXIDRangeReply, bool) {
32	if len(raw) < 32 {
33		return GetXIDRangeReply{}, false
34	}
35	r := GetXIDRangeReply{raw: raw}
36	return r, true
37}
38func (r GetXIDRangeReply) Raw() []byte     { return r.raw }
39func (r GetXIDRangeReply) StartId() uint32 { return uint32(binary.LittleEndian.Uint32(r.raw[8:])) }
40func (r GetXIDRangeReply) Count() uint32   { return uint32(binary.LittleEndian.Uint32(r.raw[12:])) }
41
42// GetXIDListReply is a zero-copy view over a GetXIDList reply; offsets count from reply byte 0.
43// It borrows the reply bytes: valid only until the Handler callback returns, because the read ring is reused. Copy what you keep.
44type GetXIDListReply struct{ raw []byte }
45
46// ParseGetXIDListReply validates raw (the whole reply, 32+4*length bytes) once; getters do not re-check.
47func ParseGetXIDListReply(raw []byte) (GetXIDListReply, bool) {
48	if len(raw) < 32 {
49		return GetXIDListReply{}, false
50	}
51	r := GetXIDListReply{raw: raw}
52	off := 32
53	{
54		n := int(r.IdsLen())
55		if n < 0 || n > len(r.raw) {
56			return GetXIDListReply{}, false
57		}
58		off += n * 4
59	}
60	if off > len(r.raw) {
61		return GetXIDListReply{}, false
62	}
63	if off > len(r.raw) {
64		return GetXIDListReply{}, false
65	}
66	return r, true
67}
68func (r GetXIDListReply) Raw() []byte    { return r.raw }
69func (r GetXIDListReply) IdsLen() uint32 { return uint32(binary.LittleEndian.Uint32(r.raw[8:])) }
70func (r GetXIDListReply) Ids() Uint32List {
71	off := 32
72	end := off + (int(r.IdsLen()))*4
73	return Uint32List{b: r.raw[off:end:end]}
74}
75
76// Uint32List is a borrowed view over a wire list of uint32. It shares the lifetime of the bytes it was taken from; copy what you keep.
77type Uint32List struct{ b []byte }
78
79func (l Uint32List) Len() int        { return len(l.b) / 4 }
80func (l Uint32List) At(i int) uint32 { return uint32(binary.LittleEndian.Uint32(l.b[i*4:])) }

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 1

Tags 1

↑↓ moveenter openesc close