package
0.0.0-20240711163723-ffe99bd9adb3
Repository: https://github.com/xboshy/go-template.git
Documentation: pkg.go.dev
# Functions
Decode attempts to decode a msgpack-encoded byte buffer into an object instance pointed to by objptr.
No description provided by the author
DecodeJSON attempts to decode a JSON-encoded byte buffer into an object instance pointed to by objptr.
DecodeMsgp attempts to decode a msgpack-encoded byte buffer into an object instance pointed to by objptr, requiring that we pre- generated the code for doing so using msgp.
DecodeReflect attempts to decode a msgpack-encoded byte buffer into an object instance pointed to by objptr, using reflection.
DecodeStream is like Decode but reads from an io.Reader instead.
Encode returns a msgpack-encoded byte buffer for a given object.
No description provided by the author
EncodeJSON returns a JSON-encoded byte buffer for a given object.
EncodeJSONStrict returns a JSON-encoded byte buffer for a given object It is the same EncodeJSON but encodes map's int keys as strings.
EncodeMsgp returns a msgpack-encoded byte buffer, requiring that we pre-generated the code for doing so using msgp.
EncodeReflect returns a msgpack-encoded byte buffer for a given object, using reflection.
EncodeStream is like Encode but writes to an io.Writer instead.
GetEncodingBuf returns a byte slice that can be used for encoding a temporary message.
NewDecoder returns a decoder object reading bytes from [r].
NewDecoderBytes returns a decoder object reading bytes from [b].
NewEncoder returns an encoder object writing bytes into [w].
NewJSONDecoder returns a json decoder object reading bytes from [r].
NewJSONEncoder returns an encoder object writing bytes into [w].
NewMsgpDecoderBytes returns a decoder object reading bytes from [b].
PutEncodingBuf places a byte slice into the pool of temporary buffers for encoding.
# Variables
CodecHandle is used to instantiate msgpack encoders and decoders with our settings (canonical, paranoid about decoding errors).
ErrInvalidObject is used to state that an object decoding has failed because it's invalid.
JSONHandle is used to instantiate JSON encoders and decoders with our settings (canonical, paranoid about decoding errors).
JSONStrictHandle is the same as JSONHandle but with MapKeyAsString=true for correct maps[int]interface{} encoding.
# Structs
EncodingBuf is a wrapper for a byte slice that can be used for encoding.
MsgpDecoderBytes is a []byte decoder into msgp-encoded objects.
# Interfaces
Decoder is our interface for a thing that can decode objects.