File: common.go

package info (click to toggle)
golang-github-go-git-go-git 5.14.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,648 kB
  • sloc: makefile: 81; sh: 76
file content (33 lines) | stat: -rw-r--r-- 802 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package sideband

// Type sideband type "side-band" or "side-band-64k"
type Type int8

const (
	// Sideband legacy sideband type up to 1000-byte messages
	Sideband Type = iota
	// Sideband64k sideband type up to 65519-byte messages
	Sideband64k Type = iota

	// MaxPackedSize for Sideband type
	MaxPackedSize = 1000
	// MaxPackedSize64k for Sideband64k type
	MaxPackedSize64k = 65520
)

// Channel sideband channel
type Channel byte

// WithPayload encode the payload as a message
func (ch Channel) WithPayload(payload []byte) []byte {
	return append([]byte{byte(ch)}, payload...)
}

const (
	// PackData packfile content
	PackData Channel = 1
	// ProgressMessage progress messages
	ProgressMessage Channel = 2
	// ErrorMessage fatal error message just before stream aborts
	ErrorMessage Channel = 3
)