Documentation ¶
Index ¶
Constants ¶
View Source
const ( // HeaderLength length of the pktline header HeaderLength = 4 // MaxLength max line length MaxLength = 65524 )
Variables ¶
View Source
var ( // ErrUnderflow is triggered when a line is shorter than the described length ErrUnderflow = errors.New("unexpected string length (underflow)") // ErrInvalidHeader invalid pktline header ErrInvalidHeader = errors.New("invalid header") // ErrInvalidLen ivanlid line length found, < 0 ErrInvalidLen = errors.New("invalid length") )
Functions ¶
func Encode ¶
Encode encodes a byte slice to pkt-line format
Types ¶
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
Decoder implements a pkt-line format decoder
func (*Decoder) ReadAll ¶
ReadAll read and returns all the lines
func (*Decoder) ReadBlock ¶
ReadBlock reads and return multiple pkt-line lines, it stops at the end of the reader or if a flush-pkt is reached
Click to show internal directories.
Click to hide internal directories.