internal

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2025 License: BSD-2-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrVoid              = errors.New("tried to decode a void value")
	ErrShortInput        = errors.New("msgpack data ends unexpectedly")
	ErrShortInputForTime = errors.New("msgpack data is too short to hold a time")
)
View Source
var (
	ErrCorruptedFlavorData = errors.New("failed to decode flavor selector")
)
View Source
var (
	ErrNotExtension = errors.New("data is not an extension")
)

Functions

func AppendArrayLen added in v0.3.0

func AppendArrayLen(dst []byte, l int) ([]byte, error)

func AppendMapLen added in v0.3.0

func AppendMapLen(dst []byte, l int) ([]byte, error)

func DecodeArrayLen added in v0.3.0

func DecodeArrayLen(data []byte, opt DecodeOptions) (elements, consume, end int, stepIn []byte, _ error)

func DecodeBool added in v0.3.0

func DecodeBool(data []byte, opt DecodeOptions) (bool, int, error)

func DecodeBytesToUint

func DecodeBytesToUint(data []byte) (uint, bool)

func DecodeExtensionHeader added in v0.6.0

func DecodeExtensionHeader(data []byte) (int8, []byte, error)

func DecodeFlavorPick added in v0.3.0

func DecodeFlavorPick(data []byte, opt DecodeOptions) (int, error)

func DecodeFloat32 added in v0.3.0

func DecodeFloat32(data []byte, opt DecodeOptions) (float32, int, error)

func DecodeFloat64 added in v0.3.0

func DecodeFloat64(data []byte, opt DecodeOptions) (float64, int, error)

func DecodeInjectionExtension added in v0.4.0

func DecodeInjectionExtension(data []byte, opt DecodeOptions) ([]byte, error)

func DecodeInt added in v0.3.0

func DecodeInt(data []byte, opt DecodeOptions) (int, int, error)

func DecodeLengthPrefixExtension added in v0.3.0

func DecodeLengthPrefixExtension(data []byte) int

DecodeLengthPrefixExtension returns the number of bytes to be skipped past to get to the real entry.

func DecodeMapLen added in v0.3.0

func DecodeMapLen(data []byte, opt DecodeOptions) (elements, consume, end int, stepIn []byte, _ error)

func DecodeString added in v0.3.0

func DecodeString(data []byte, opt DecodeOptions) (string, int, error)

func DecodeTime added in v0.3.0

func DecodeTime(data []byte, opt DecodeOptions) (time.Time, int, error)

func DecodeTimestamp added in v0.3.0

func DecodeTimestamp(data []byte) (time.Time, error)

func DecodeUnwrappedArrayLen added in v0.3.0

func DecodeUnwrappedArrayLen(data []byte) (int, int, bool)

func DecodeUnwrappedMapLen added in v0.3.0

func DecodeUnwrappedMapLen(data []byte) (int, int, bool)

func DescribeValue added in v0.3.0

func DescribeValue(data []byte) string

func SkipMultiple added in v0.3.0

func SkipMultiple(data []byte, offset, num int) (int, error)

func UnsafeStringCast added in v0.3.0

func UnsafeStringCast(data []byte) string

func ValueLength added in v0.3.0

func ValueLength(data []byte) (int, error)

Types

type DecodeOptions added in v0.3.0

type DecodeOptions struct {
	Dict            *Dict
	FlavorSelectors map[uint]uint
	Injections      map[uint][]byte
}

func (DecodeOptions) Clone added in v0.6.0

func (d DecodeOptions) Clone() DecodeOptions

type Dict added in v0.3.0

type Dict struct {
	Strings     []string
	Interfaces  []any
	JSONEncoded *atomic.Pointer[[][]byte]
}

func (*Dict) LookupAny added in v0.3.0

func (d *Dict) LookupAny(n uint) (any, error)

func (*Dict) LookupString added in v0.3.0

func (d *Dict) LookupString(n uint) (string, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL