Documentation
¶
Index ¶
- Variables
- type Allocator
- type HeapAllocator
- type LinearAllocator
- type Option
- func Begin(f func() error) Option
- func Bool(num int, f func(bool) error) Option
- func Bytes(num int, f func([]byte) error) Option
- func Double(num int, f func(float64) error) Option
- func End(f func() error) Option
- func Enum(num int, f func(int32) error) Option
- func Fixed32(num int, f func(uint32) error) Option
- func Fixed64(num int, f func(uint64) error) Option
- func Float(num int, f func(float32) error) Option
- func Int32(num int, f func(int32) error) Option
- func Int64(num int, f func(int64) error) Option
- func Message(num int, n *RawPB) Option
- func Name(name string) Option
- func Sfixed32(num int, f func(int32) error) Option
- func Sfixed64(num int, f func(int64) error) Option
- func Sint32(num int, f func(int32) error) Option
- func Sint64(num int, f func(int64) error) Option
- func String(num int, f func(string) error) Option
- func Uint32(num int, f func(uint32) error) Option
- func Uint64(num int, f func(uint64) error) Option
- func UnknownBytes(f func(num int, v []byte) error) Option
- func UnknownFixed32(f func(num int, v uint32) error) Option
- func UnknownFixed64(f func(num int, v uint64) error) Option
- func UnknownVarint(f func(num int, v uint64) error) Option
- func Varint(num int, f func(uint64) error) Option
- type RawPB
- type Reader
Constants ¶
This section is empty.
Variables ¶
var ErrorInvalidMessage = errors.New("invalid message")
var ErrorTruncated = errors.New("message truncated")
var ErrorWrongWireType = errors.New("wrong wire type")
Functions ¶
This section is empty.
Types ¶
type HeapAllocator ¶
type HeapAllocator struct {
}
HeapAllocator uses Go's built-in memory allocation
func (*HeapAllocator) Alloc ¶
func (a *HeapAllocator) Alloc(n int) []byte
type LinearAllocator ¶
type LinearAllocator struct {
// contains filtered or unexported fields
}
LinearAllocator uses a single growing buffer for allocations
func NewLinearAllocator ¶
func NewLinearAllocator() *LinearAllocator
NewLinearAllocator creates a linear allocator with initial capacity
func (*LinearAllocator) Alloc ¶
func (a *LinearAllocator) Alloc(n int) []byte
func (*LinearAllocator) Grow ¶
func (a *LinearAllocator) Grow(size int)
Grow pre-allocates buffer space for expected allocations
func (*LinearAllocator) Reset ¶
func (a *LinearAllocator) Reset()
Reset recycles the allocation buffer for reuse
type Option ¶
type Option func(*RawPB)
Option configures RawPB parser behavior
func Double ¶
Double registers a callback for double-precision floating point numbers using fixed64 encoding
func Float ¶
Float registers a callback for single-precision floating point numbers using fixed32 encoding
func String ¶
String registers a callback for string values from length-delimited fields. Uses unsafe conversion from byte slice to avoid allocation.
func UnknownBytes ¶
UnknownBytes handles unregistered length-delimited fields
func UnknownFixed32 ¶
UnknownFixed32 handles unregistered fixed32 fields
func UnknownFixed64 ¶
UnknownFixed64 handles unregistered fixed64 fields
func UnknownVarint ¶
UnknownVarint handles unregistered varint fields
type RawPB ¶
type RawPB struct {
// contains filtered or unexported fields
}
RawPB implements a low-level protocol buffer parser without code generation