bmd

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Int byte = iota
	Int16
	Int32
	Int64
	UInt
	UInt16
	UInt32
	UInt64
	Float32
	Float64
	Bool
	Byte
	String
	Slice
	Map
	ByteSlice
	StringTag
	UIntTag
	Time
	EndOfMismatchedTypeErr   = ". check your marshal process"
	StartOfMismatchedTypeErr = "expected a slice, found: "
)

Variables

View Source
var ErrBytesToSmall = errors.New("insufficient data, given bytes are too small")
View Source
var ErrNIsNotZero = errors.New("n has to be 0")

Functions

func DecodeZigZag

func DecodeZigZag[T constraints.Unsigned](t T) T

func EncodeZigZag

func EncodeZigZag[T constraints.Signed](t T) T

func MarshalBool

func MarshalBool(n int, b []byte, v bool) int

func MarshalByte

func MarshalByte(n int, b []byte, byt byte) int

func MarshalByteSlice

func MarshalByteSlice(n int, b []byte, bs []byte) int

func MarshalFloat32

func MarshalFloat32(n int, b []byte, v float32) int

func MarshalFloat64

func MarshalFloat64(n int, b []byte, v float64) int

func MarshalInt

func MarshalInt(n int, b []byte, v int) int

func MarshalInt16

func MarshalInt16(n int, b []byte, v int16) int

func MarshalInt32

func MarshalInt32(n int, b []byte, v int32) int

func MarshalInt64

func MarshalInt64(n int, b []byte, v int64) int

func MarshalMap

func MarshalMap[K comparable, V any](n int, b []byte, m map[K]V, kMarshal MarshalFunc[K], vMarshal MarshalFunc[V]) int

func MarshalSlice

func MarshalSlice[T any](n int, b []byte, slice []T, marshal MarshalFunc[T]) int

func MarshalString

func MarshalString(n int, b []byte, str string) int

func MarshalTime

func MarshalTime(n int, b []byte, t time.Time) int

func MarshalUInt

func MarshalUInt(n int, b []byte, v uint) int

func MarshalUInt16

func MarshalUInt16(n int, b []byte, v uint16) int

func MarshalUInt32

func MarshalUInt32(n int, b []byte, v uint32) int

func MarshalUInt64

func MarshalUInt64(n int, b []byte, v uint64) int

func SizeBool

func SizeBool() int

func SizeByte

func SizeByte() int

func SizeByteSlice

func SizeByteSlice(bs []byte) int

func SizeFloat32

func SizeFloat32() int

func SizeFloat64

func SizeFloat64() int

func SizeInt

func SizeInt() int

func SizeInt16

func SizeInt16() int

func SizeInt32

func SizeInt32() int

func SizeInt64

func SizeInt64() int

func SizeMap

func SizeMap[K comparable, V any](m map[K]V, kSizer interface{}, vSizer interface{}) int

func SizeSlice

func SizeSlice[T any](slice []T, sizer interface{}) int

func SizeString

func SizeString(s string) int

func SizeTime

func SizeTime() int

func SizeUInt

func SizeUInt() int

func SizeUInt16

func SizeUInt16() int

func SizeUInt32

func SizeUInt32() int

func SizeUInt64

func SizeUInt64() int

func SkipBool

func SkipBool(n int, b []byte) (int, error)

func SkipByte

func SkipByte(n int, b []byte) (int, error)

func SkipByteSlice

func SkipByteSlice(n int, b []byte) (int, error)

func SkipFloat32

func SkipFloat32(n int, b []byte) (int, error)

func SkipFloat64

func SkipFloat64(n int, b []byte) (int, error)

func SkipInt

func SkipInt(n int, b []byte) (int, error)

func SkipInt16

func SkipInt16(n int, b []byte) (int, error)

func SkipInt32

func SkipInt32(n int, b []byte) (int, error)

func SkipInt64

func SkipInt64(n int, b []byte) (int, error)

func SkipMap

func SkipMap(n int, b []byte, kSkipper SkipFunc, vSkipper SkipFunc) (int, error)

func SkipSlice

func SkipSlice(n int, b []byte, skipper SkipFunc) (int, error)

func SkipString

func SkipString(n int, b []byte) (int, error)

func SkipStringTag

func SkipStringTag(n int, b []byte) (int, error)

func SkipTime

func SkipTime(n int, b []byte) (int, error)

func SkipUInt

func SkipUInt(n int, b []byte) (int, error)

func SkipUInt16

func SkipUInt16(n int, b []byte) (int, error)

func SkipUInt32

func SkipUInt32(n int, b []byte) (int, error)

func SkipUInt64

func SkipUInt64(n int, b []byte) (int, error)

func SkipUIntTag

func SkipUIntTag(n int, b []byte) (int, error)

func UnmarshalBool

func UnmarshalBool(n int, b []byte) (int, bool, error)

func UnmarshalByte

func UnmarshalByte(n int, b []byte) (int, byte, error)

func UnmarshalByteSlice

func UnmarshalByteSlice(n int, b []byte) (int, []byte, error)

func UnmarshalFloat32

func UnmarshalFloat32(n int, b []byte) (int, float32, error)

func UnmarshalFloat64

func UnmarshalFloat64(n int, b []byte) (int, float64, error)

func UnmarshalInt

func UnmarshalInt(n int, b []byte) (int, int, error)

func UnmarshalInt16

func UnmarshalInt16(n int, b []byte) (int, int16, error)

func UnmarshalInt32

func UnmarshalInt32(n int, b []byte) (int, int32, error)

func UnmarshalInt64

func UnmarshalInt64(n int, b []byte) (int, int64, error)

func UnmarshalMap

func UnmarshalMap[K comparable, V any](n int, b []byte, kUnmarshal UnmarshalFunc[K], vUnmarshal UnmarshalFunc[V]) (int, map[K]V, error)

func UnmarshalSlice

func UnmarshalSlice[T any](n int, b []byte, unmarshal UnmarshalFunc[T]) (int, []T, error)

func UnmarshalString

func UnmarshalString(n int, b []byte) (int, string, error)

func UnmarshalTime

func UnmarshalTime(n int, b []byte) (int, time.Time, error)

func UnmarshalUInt

func UnmarshalUInt(n int, b []byte) (int, uint, error)

func UnmarshalUInt16

func UnmarshalUInt16(n int, b []byte) (int, uint16, error)

func UnmarshalUInt32

func UnmarshalUInt32(n int, b []byte) (int, uint32, error)

func UnmarshalUInt64

func UnmarshalUInt64(n int, b []byte) (int, uint64, error)

Types

type MarshalFunc

type MarshalFunc[T any] func(n int, b []byte, t T) int

type SizeFunc

type SizeFunc[T any] func(t T) int

type SkipFunc

type SkipFunc func(n int, b []byte) (int, error)

type UnmarshalFunc

type UnmarshalFunc[T any] func(n int, b []byte) (int, T, error)

Jump to

Keyboard shortcuts

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