varint

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: MIT Imports: 4 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeZigZag

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

func EncodeZigZag

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

func MarshalByte

func MarshalByte(v byte, bs []byte) (n int)

MarshalByte fills bs with the MUS encoding (Varint) of a byte value.

Returns the number of used bytes. It will panic if receives too small bs.

func MarshalFloat32

func MarshalFloat32(v float32, bs []byte) int

MarshalFloat32 fills bs with the MUS encoding (Varint) of a float32 value.

Returns the number of used bytes. It will panic if receives too small bs.

func MarshalFloat64

func MarshalFloat64(v float64, bs []byte) int

MarshalFloat64 fills bs with the MUS encoding (Varint) of a float64 value.

Returns the number of used bytes. It will panic if receives too small bs.

func MarshalInt

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

MarshalInt fills bs with the MUS encoding (Varint) of a int value.

Returns the number of used bytes. It will panic if receives too small bs.

func MarshalInt16

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

MarshalInt16 fills bs with the MUS encoding (Varint) of a int16 value.

Returns the number of used bytes. It will panic if receives too small bs.

func MarshalInt32

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

MarshalInt32 fills bs with the MUS encoding (Varint) of a int32 value.

Returns the number of used bytes. It will panic if receives too small bs.

func MarshalInt64

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

MarshalInt64 fills bs with the MUS encoding (Varint) of a int64 value.

Returns the number of used bytes. It will panic if receives too small bs.

func MarshalInt8

func MarshalInt8(v int8, bs []byte) (n int)

MarshalInt8 fills bs with the MUS encoding (Varint) of a int8 value.

Returns the number of used bytes. It will panic if receives too small bs.

func MarshalUint

func MarshalUint(v uint, bs []byte) (n int)

MarshalUint fills bs with the MUS encoding (Varint) of a uint value.

Returns the number of used bytes. It will panic if receives too small bs.

func MarshalUint16

func MarshalUint16(v uint16, bs []byte) (n int)

MarshalUint16 fills bs with the MUS encoding (Varint) of a uint16 value.

Returns the number of used bytes. It will panic if receives too small bs.

func MarshalUint32

func MarshalUint32(v uint32, bs []byte) (n int)

MarshalUint32 fills bs with the MUS encoding (Varint) of a uint32 value.

Returns the number of used bytes. It will panic if receives too small bs.

func MarshalUint64

func MarshalUint64(v uint64, bs []byte) (n int)

MarshalUint64 fills bs with the MUS encoding (Varint) of a uint64 value.

Returns the number of used bytes. It will panic if receives too small bs.

func MarshalUint8

func MarshalUint8(v uint8, bs []byte) (n int)

MarshalUint8 fills bs with the MUS encoding (Varint) of a uint8 value.

Returns the number of used bytes. It will panic if receives too small bs.

func SizeByte

func SizeByte(v byte) (size int)

SizeByte returns the size of a MUS-encoded (Varint) byte value.

func SizeFloat32

func SizeFloat32(v float32) (size int)

SizeFloat32 returns the size of a MUS-encoded (Varint) float32 value.

func SizeFloat64

func SizeFloat64(v float64) (size int)

SizeFloat64 returns the size of a MUS-encoded (Varint) float64 value.

func SizeInt

func SizeInt(v int) (size int)

SizeInt returns the size of a MUS-encoded (Varint) int value.

func SizeInt16

func SizeInt16(v int16) (size int)

SizeInt16 returns the size of a MUS-encoded (Varint) int16 value.

func SizeInt32

func SizeInt32(v int32) int

SizeInt32 returns the size of a MUS-encoded (Varint) int32 value.

func SizeInt64

func SizeInt64(v int64) int

SizeInt64 returns the size of a MUS-encoded (Varint) int64 value.

func SizeInt8

func SizeInt8(v int8) (size int)

SizeInt8 returns the size of a MUS-encoded (Varint) int8 value.

func SizeUint

func SizeUint(v uint) (size int)

SizeUint returns the size of a MUS-encoded uint value.

func SizeUint16

func SizeUint16(v uint16) (size int)

SizeUint16 returns the size of a MUS-encoded uint16 value.

func SizeUint32

func SizeUint32(v uint32) (size int)

SizeUint32 returns the size of a MUS-encoded uint32 value.

func SizeUint64

func SizeUint64(v uint64) (size int)

SizeUint64 returns the size of a MUS-encoded uint64 value.

func SizeUint8

func SizeUint8(v uint8) (size int)

SizeUint8 returns the size of a MUS-encoded uint8 value.

func SkipByte

func SkipByte(bs []byte) (n int, err error)

SkipByte skips a MUS-encoded (Varint) byte.

In addition to the number of skipped bytes, it can also return mus.ErrTooSmallByteSlice or com.ErrOverflow.

func SkipFloat32

func SkipFloat32(bs []byte) (n int, err error)

SkipFloat32 skips a MUS-encoded (Varint) float32 value.

In addition to the number of skipped bytes, it can also return mus.ErrTooSmallByteSlice or com.ErrOverflow.

func SkipFloat64

func SkipFloat64(bs []byte) (n int, err error)

SkipFloat64 skips a MUS-encoded (Varint) float64 value.

In addition to the number of skipped bytes, it can also return mus.ErrTooSmallByteSlice or com.ErrOverflow.

func SkipInt

func SkipInt(bs []byte) (n int, err error)

SkipInt skips a MUS-encoded (Varint) int value.

In addition to the number of skipped bytes, it can also return mus.ErrTooSmallByteSlice or com.ErrOverflow.

func SkipInt16

func SkipInt16(bs []byte) (n int, err error)

SkipInt16 skips a MUS-encoded (Varint) int16 value.

In addition to the number of skipped bytes, it can also return mus.ErrTooSmallByteSlice or com.ErrOverflow.

func SkipInt32

func SkipInt32(bs []byte) (n int, err error)

SkipInt32 skips a MUS-encoded (Varint) int32 value.

In addition to the number of skipped bytes, it can also return mus.ErrTooSmallByteSlice or com.ErrOverflow.

func SkipInt64

func SkipInt64(bs []byte) (n int, err error)

SkipInt64 skips a MUS-encoded (Varint) int64 value.

In addition to the number of skipped bytes, it can also return mus.ErrTooSmallByteSlice or com.ErrOverflow.

func SkipInt8

func SkipInt8(bs []byte) (n int, err error)

SkipInt8 skips a MUS-encoded (Varint) int8 value.

In addition to the number of skipped bytes, it can also return mus.ErrTooSmallByteSlice or com.ErrOverflow.

func SkipUint

func SkipUint(bs []byte) (n int, err error)

SkipUint skips a MUS-encoded uint.

In addition to the number of skipped bytes, it can also return mus.ErrTooSmallByteSlice or com.ErrOverflow.

func SkipUint16

func SkipUint16(bs []byte) (n int, err error)

SkipUint16 skips a MUS-encoded uint16.

In addition to the number of skipped bytes, it can also return mus.ErrTooSmallByteSlice or com.ErrOverflow.

func SkipUint32

func SkipUint32(bs []byte) (n int, err error)

SkipUint32 skips a MUS-encoded uint32.

In addition to the number of skipped bytes, it can also return mus.ErrTooSmallByteSlice or com.ErrOverflow.

func SkipUint64

func SkipUint64(bs []byte) (n int, err error)

SkipUint64 skips a MUS-encoded uint64.

In addition to the number of skipped bytes, it can also return mus.ErrTooSmallByteSlice or com.ErrOverflow.

func SkipUint8

func SkipUint8(bs []byte) (n int, err error)

SkipUint8 skips a MUS-encoded uint8.

In addition to the number of skipped bytes, it can also return mus.ErrTooSmallByteSlice or com.ErrOverflow.

func UnmarshalByte

func UnmarshalByte(bs []byte) (v byte, n int, err error)

UnmarshalByte parses a MUS-encoded (Varint) byte value from bs.

In addition to the byte value and the number of used bytes, it can also return mus.ErrTooSmallByteSlice or com.ErrOverflow.

func UnmarshalFloat32

func UnmarshalFloat32(bs []byte) (v float32, n int, err error)

UnmarshalFloat32 parses a MUS-encoded (Varint) float32 value from bs.

In addition to the float32 value and the number of used bytes, it can also return mus.ErrTooSmallByteSlice or com.ErrOverflow.

func UnmarshalFloat64

func UnmarshalFloat64(bs []byte) (v float64, n int, err error)

UnmarshalFloat64 parses a MUS-encoded (Varint) float64 value from bs.

In addition to the float64 value and the number of used bytes, it can also return mus.ErrTooSmallByteSlice or com.ErrOverflow.

func UnmarshalInt

func UnmarshalInt(bs []byte) (v int, n int, err error)

UnmarshalInt parses a MUS-encoded (Varint) int value from bs.

In addition to the int value and the number of used bytes, it can also return mus.ErrTooSmallByteSlice or com.ErrOverflow.

func UnmarshalInt16

func UnmarshalInt16(bs []byte) (v int16, n int, err error)

UnmarshalInt16 parses a MUS-encoded (Varint) int16 value from bs.

In addition to the int16 value and the number of used bytes, it can also return mus.ErrTooSmallByteSlice or com.ErrOverflow.

func UnmarshalInt32

func UnmarshalInt32(bs []byte) (v int32, n int, err error)

UnmarshalInt32 parses a MUS-encoded (Varint) int32 value from bs.

In addition to the int32 value and the number of used bytes, it can also return mus.ErrTooSmallByteSlice or com.ErrOverflow.

func UnmarshalInt64

func UnmarshalInt64(bs []byte) (v int64, n int, err error)

UnmarshalInt64 parses a MUS-encoded (Varint) int64 value from bs.

In addition to the int64 value and the number of used bytes, it can also return mus.ErrTooSmallByteSlice or com.ErrOverflow.

func UnmarshalInt8

func UnmarshalInt8(bs []byte) (v int8, n int, err error)

UnmarshalInt8 parses a MUS-encoded (Varint) int8 value from bs.

In addition to the int8 value and the number of used bytes, it can also return mus.ErrTooSmallByteSlice or com.ErrOverflow.

func UnmarshalUint

func UnmarshalUint(bs []byte) (v uint, n int, err error)

UnmarshalUint parses a MUS-encoded (Varint) uint value from bs.

In addition to the uint value and the number of used bytes, it can also return mus.ErrTooSmallByteSlice or com.ErrOverflow.

func UnmarshalUint16

func UnmarshalUint16(bs []byte) (v uint16, n int, err error)

UnmarshalUint16 parses a MUS-encoded (Varint) uint16 value from bs.

In addition to the uint16 value and the number of used bytes, it can also return mus.ErrTooSmallByteSlice or com.ErrOverflow.

func UnmarshalUint32

func UnmarshalUint32(bs []byte) (v uint32, n int, err error)

UnmarshalUint32 parses a MUS-encoded (Varint) uint32 value from bs.

In addition to the uint32 value and the number of used bytes, it can also return mus.ErrTooSmallByteSlice or com.ErrOverflow.

func UnmarshalUint64

func UnmarshalUint64(bs []byte) (v uint64, n int, err error)

UnmarshalUint64 parses a MUS-encoded (Varint) uint64 value from bs.

In addition to the uint64 value and the number of used bytes, it can also return mus.ErrTooSmallByteSlice or com.ErrOverflow.

func UnmarshalUint8

func UnmarshalUint8(bs []byte) (v uint8, n int, err error)

UnmarshalUint8 parses a MUS-encoded (Varint) uint8 value from bs.

In addition to the uint8 value and the number of used bytes, it can also return mus.ErrTooSmallByteSlice or com.ErrOverflow.

Types

This section is empty.

Jump to

Keyboard shortcuts

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