Documentation
¶
Index ¶
- Constants
- Variables
- func CheckMapKey(key interface{}) error
- func CheckMapKeyValue(key reflect.Value) error
- func DepthError() error
- func Int8FromByte(v byte) int8
- func Int8FromInt64(v int64, k reflect.Kind) (int8, error)
- func Int16FromInt64(v int64, k reflect.Kind) (int16, error)
- func Int32FromInt64(v int64, k reflect.Kind) (int32, error)
- func Int64FromFloat64(v float64, k reflect.Kind) (int64, error)
- func Int64FromInt8Byte(v byte) int64
- func Int64FromInt16Bits(v uint16) int64
- func Int64FromInt32Bits(v uint32) int64
- func Int64FromInt64Bits(v uint64) int64
- func Int64FromUint64(v uint64, k reflect.Kind) (int64, error)
- func IntFromInt64(v int64, k reflect.Kind) (int, error)
- func IntValueForKind(v int64, k reflect.Kind) (int64, error)
- func IsExtCode(code byte) bool
- func LengthFromUint32(u uint32) (int, error)
- func MapKeyNeedsCheck(t reflect.Type) bool
- func RangeError(value interface{}, k reflect.Kind) error
- func Uint8FromUint64(v uint64, k reflect.Kind) (uint8, error)
- func Uint16FromUint64(v uint64, k reflect.Kind) (uint16, error)
- func Uint32FromUint64(v uint64, k reflect.Kind) (uint32, error)
- func Uint64FromInt64(v int64, k reflect.Kind) (uint64, error)
- func UintFromUint64(v uint64, k reflect.Kind) (uint, error)
- func UintValueForKind(v uint64, k reflect.Kind) (uint64, error)
Constants ¶
const MaxDepth = 10000
MaxDepth limits the nesting of arrays, maps and structs while decoding. Without it, deeply nested input exhausts the goroutine stack and the runtime aborts with a fatal error that cannot be recovered.
Variables ¶
var ErrDeclaredLengthTooLarge = errors.New("declared length is too large")
ErrDeclaredLengthTooLarge is returned when a declared 32-bit length cannot be represented as a non-negative int (32-bit platforms).
Functions ¶
func CheckMapKey ¶ added in v3.2.4
func CheckMapKey(key interface{}) error
CheckMapKey reports an error when key would panic as a map key.
func CheckMapKeyValue ¶ added in v3.2.4
CheckMapKeyValue is the reflect.Value variant of CheckMapKey.
func DepthError ¶ added in v3.2.4
func DepthError() error
DepthError reports that the nesting limit was exceeded.
func Int8FromByte ¶
func Int64FromInt8Byte ¶
func Int64FromInt16Bits ¶
func Int64FromInt32Bits ¶
func Int64FromInt64Bits ¶
func IsExtCode ¶ added in v3.2.4
IsExtCode reports whether code starts an ext value. Map keys decoded from ext values come from user-provided decoders and may be unhashable, while other non-container codes always yield hashable values.
func LengthFromUint32 ¶ added in v3.2.5
LengthFromUint32 converts a MessagePack-declared 32-bit length to int, rejecting values that are not representable as a non-negative int.
func MapKeyNeedsCheck ¶ added in v3.2.4
MapKeyNeedsCheck reports whether a concrete map key type t may still hold unhashable values at runtime (e.g. a struct with an interface field). Interface key types are handled separately by the decoders.
func RangeError ¶
Types ¶
This section is empty.