Versions in this module Expand all Collapse all v0 v0.8.0 Jun 6, 2026 Changes in this version + const BoolLen + const ByteLen + const DefaultMaxSize + const IPLen + const IntLen + const LongLen + const MaxStringLen + const ShortLen + const VersionSize + var ErrBadLength = errors.New("packing: bad length") + var ErrCantPackVersion = errors.New("couldn't pack codec version") + var ErrCantUnpackVersion = errors.New("couldn't unpack codec version") + var ErrDoesNotImplementInterface = errors.New("does not implement interface") + var ErrDuplicateType = errors.New("duplicate type registration") + var ErrExtraSpace = errors.New("trailing buffer space") + var ErrInsufficientLength = errors.New("packing: insufficient length") + var ErrMarshalNil = errors.New("can't marshal nil pointer") + var ErrMarshalZeroLength = errors.New("can't marshal zero length value") + var ErrMaxSliceLenExceeded = errors.New("max slice length exceeded") + var ErrNegativeLength = errors.New("packing: negative length") + var ErrOverflow = errors.New("packing: overflow") + var ErrUnexportedField = errors.New("unexported field") + var ErrUnknownVersion = errors.New("unknown codec version") + var ErrUnmarshalNil = errors.New("can't unmarshal into nil") + var ErrUnmarshalZeroLength = errors.New("can't unmarshal zero length value") + var ErrUnsupportedType = errors.New("unsupported type") + func StringLen(str string) int + type Codec interface + MarshalInto func(interface{}, *wrappers.Packer) error + Size func(value interface{}) (int, error) + UnmarshalFrom func(*wrappers.Packer, interface{}) error + type Errs struct + Err error + func (errs *Errs) Add(errors ...error) + func (errs *Errs) Errored() bool + type GeneralCodec interface + type Manager interface + Marshal func(version uint16, source interface{}) ([]byte, error) + RegisterCodec func(version uint16, codec Codec) error + Size func(version uint16, value interface{}) (int, error) + Unmarshal func(bytes []byte, dest interface{}) (uint16, error) + func NewDefaultManager() Manager + func NewManager(maxSize uint64) Manager + type Packer struct + Bytes []byte + Err error + Offset int + func NewPacker(maxSize int) *Packer + func PackerFromBytes(b []byte) *Packer + func (p *Packer) Errored() bool + func (p *Packer) PackBool(val bool) + func (p *Packer) PackByte(val byte) + func (p *Packer) PackBytes(val []byte) + func (p *Packer) PackFixedBytes(val []byte) + func (p *Packer) PackID(id ids.ID) + func (p *Packer) PackInt(val uint32) + func (p *Packer) PackLong(val uint64) + func (p *Packer) PackShort(val uint16) + func (p *Packer) PackStr(val string) + func (p *Packer) Remaining() int + func (p *Packer) UnpackBool() bool + func (p *Packer) UnpackByte() byte + func (p *Packer) UnpackBytes() []byte + func (p *Packer) UnpackFixedBytes(n int) []byte + func (p *Packer) UnpackID() ids.ID + func (p *Packer) UnpackInt() uint32 + func (p *Packer) UnpackLong() uint64 + func (p *Packer) UnpackShort() uint16 + func (p *Packer) UnpackStr() string + type Registry interface + RegisterType func(interface{}) error