jam

package
v0.0.0-...-3b087ab Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidPointer           = errors.New("invalid pointer")
	ErrDecodingBool             = errors.New("error decoding boolean")
	ErrExceedingByteArrayLimit  = errors.New("byte array length exceeds max value of uint32")
	ErrUnsupportedEnumTypeValue = errors.New("unsupported enum type value")
	ErrUnknownEnumTypeValue     = errors.New("cannot find enum type value")

	ErrUnsupportedType         = "unsupported type: %T"
	ErrReadingBytes            = "error reading bytes: %w"
	ErrReadingByte             = "error reading byte: %w"
	ErrDecodingUint            = "error decoding uint: : %w"
	ErrEncodingMapFieldKeyType = "error encoding map field: unsupported map key type %v"
	ErrDecodingMapLength       = "error decoding map length: %v"
	ErrDecodingMapKey          = "error decoding map key: %v"
	ErrDecodingMapValue        = "error decoding map value: %v"
	ErrEncodingStructField     = "encoding struct field '%s': %w"
	ErrDecodingStructField     = "decoding struct field '%s': %w"
)

Functions

func IntLength

func IntLength(in any) int

func Marshal

func Marshal(v interface{}) ([]byte, error)

func Unmarshal

func Unmarshal(data []byte, dst interface{}) error

Types

type EncodeEnum

type EncodeEnum interface {
	IndexValue() (index uint, value any, err error)
}

type EnumType

type EnumType interface {
	EncodeEnum
	ValueAt(index uint) (value any, err error)
	SetValue(value any) error
}

Jump to

Keyboard shortcuts

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