Documentation ¶
Overview ¶
Package pktline implements pkt-line format encoding used by Git's transfer protocol. https://github.com/git/git/blob/master/Documentation/technical/protocol-common.txt
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrShortRead = errors.New("input is too short") ErrInputExcess = errors.New("input is too long") ErrTooLong = errors.New("too long payload") ErrInvalidLen = errors.New("invalid length") )
Errors returned by methods in package pktline.
Functions ¶
Types ¶
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
Decoder decodes input in pkt-line format.
func NewDecoder ¶
NewDecoder constructs a new pkt-line decoder.
func (*Decoder) Decode ¶
Decode reads a single pkt-line and stores its payload. Flush-pkt is causes *payload to be nil.
func (*Decoder) DecodeUntilFlush ¶
DecodeUntilFlush decodes pkt-line messages until it encounters flush-pkt. The flush-pkt is not included in output. If error is not nil, output contains data that was read before the error occured.
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
Encoder encodes payloads in pkt-line format.
type EncoderDecoder ¶
EncoderDecoder serves as both Encoder and Decoder.
func NewEncoderDecoder ¶
func NewEncoderDecoder(rw io.ReadWriter) *EncoderDecoder
NewEncoderDecoder constructs pkt-line encoder/decoder.