Documentation
¶
Index ¶
- type Len
- type Parser
- func (p *Parser) Align(n int) *Parser
- func (p *Parser) AtEnd() bool
- func (p *Parser) B16(d *uint16) *Parser
- func (p *Parser) B16String(d *string) *Parser
- func (p *Parser) B32(d *uint32) *Parser
- func (p *Parser) B32Bytes(d *[]byte) *Parser
- func (p *Parser) B32String(d *string) *Parser
- func (p *Parser) B64(d *uint64) *Parser
- func (p *Parser) B8(d *byte) *Parser
- func (p *Parser) B8String(d *string) *Parser
- func (p *Parser) Byte(d *byte) *Parser
- func (p *Parser) Bytes(n int, d *[]byte) *Parser
- func (p *Parser) BytesCopy(n int, d []byte) *Parser
- func (p *Parser) BytesPeek(n int, d *[]byte) *Parser
- func (p *Parser) End() error
- func (p *Parser) PeekRest(d *[]byte) *Parser
- func (p *Parser) Skip(n int) *Parser
- func (p *Parser) String(n int, d *string) *Parser
- func (p *Parser) String0(d *string) *Parser
- type Printer
- func (p *Printer) Align(n int) *Printer
- func (p *Printer) B16(d uint16) *Printer
- func (p *Printer) B16String(d string) *Printer
- func (p *Printer) B32(d uint32) *Printer
- func (p *Printer) B32Bytes(d []byte) *Printer
- func (p *Printer) B32String(d string) *Printer
- func (p *Printer) B64(d uint64) *Printer
- func (p *Printer) B8(d byte) *Printer
- func (p *Printer) B8String(d string) *Printer
- func (p *Printer) Byte(d byte) *Printer
- func (p *Printer) Bytes(d []byte) *Printer
- func (p *Printer) LenB16(l *Len) *Printer
- func (p *Printer) LenB32(l *Len) *Printer
- func (p *Printer) LenDone(l *Len) *Printer
- func (p *Printer) LenStart(l *Len) *Printer
- func (p *Printer) LensDone(ls ...*Len) *Printer
- func (p *Printer) Out() []byte
- func (p *Printer) Skip(n int) *Printer
- func (p *Printer) String(d string) *Printer
- func (p *Printer) String0(d string) *Printer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Len ¶
type Len struct {
// contains filtered or unexported fields
}
Type for handling length fields.
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser type. Don't touch the internals.
func (*Parser) B16String ¶
Parse a string with a 2 byte bigendian length prefix to a string pointer.
func (*Parser) B32String ¶
Parse a string with a 4 byte bigendian length prefix to a string pointer.
func (*Parser) Bytes ¶
Parse n bytes from the buffer and copy to a []byte pointer that is allocated.
func (*Parser) BytesPeek ¶
Parse n bytes from the buffer to a []byte pointer that refers to the parser internal buffer.
type Printer ¶
type Printer struct {
// contains filtered or unexported fields
}
Printer type. Don't touch the internals.
func (*Printer) B16String ¶
Output a string with a 2 byte bigendian length prefix and no trailing null.
func (*Printer) B32String ¶
Output a string with a 4 byte bigendian length prefix and no trailing null.
func (*Printer) B8String ¶
Output a string with a 1 byte bigendian length prefix and no trailing null.
func (*Printer) LenB16 ¶
Add a 16 bit field at the current location that will be filled with the length.
func (*Printer) LenB32 ¶
Add a 32 bit field at the current location that will be filled with the length.