Documentation ¶
Index ¶
- Variables
- func Decode(packet []byte, options Options) (_ any, _ []byte, ret error)
- func Encode(x any, b *lib.Buffer, options Options) (ret error)
- func GetAtomCache() map[uint16]gen.Atom
- func GetErrCache() map[uint16]error
- func GetRegCache() map[uint16]string
- func MakeEncodeRegTypeCache(names []string) *sync.Map
- func RegisterAtom(a gen.Atom) error
- func RegisterError(e error) error
- func RegisterTypeOf(v any) error
- type Marshaler
- type Options
- type Unmarshaler
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrBinaryTooLong = fmt.Errorf("binary too long - max allowed length is 2^32-1 bytes (4GB)") ErrStringTooLong = fmt.Errorf("string too long - max allowed length is 2^16-1 (65535) bytes") ErrAtomTooLong = fmt.Errorf("atom too long - max allowed length is 255 bytes") ErrErrorTooLong = fmt.Errorf("error too long - max allowed length is 32767 bytes") )
Functions ¶
func GetAtomCache ¶
func GetErrCache ¶
func GetRegCache ¶
func MakeEncodeRegTypeCache ¶
func RegisterAtom ¶
func RegisterError ¶
func RegisterTypeOf ¶
Types ¶
type Options ¶
type Options struct { AtomCache *sync.Map // atom => id (encoding), id => atom (decoding) AtomMapping *sync.Map // atomX => atomY (encoding/decoding) RegCache *sync.Map // type/name => id (encoding), id => type (for decoding) ErrCache *sync.Map // error => id (for encoder), id => error (for decoder) Cache *sync.Map // common cache (caching reflect.Type => encoder, string([]byte) => decoder) }
Options for encoding/decoding
type Unmarshaler ¶
Click to show internal directories.
Click to hide internal directories.