Documentation ¶
Index ¶
- func MarshalBool(n int, b []byte, v bool) int
- func MarshalByte(n int, b []byte, byt byte) int
- func MarshalBytes(n int, b []byte, bs []byte) int
- func MarshalFloat32(n int, b []byte, v float32) int
- func MarshalFloat64(n int, b []byte, v float64) int
- func MarshalInt(n int, b []byte, sv int) int
- func MarshalInt16(n int, b []byte, v int16) int
- func MarshalInt32(n int, b []byte, v int32) int
- func MarshalInt64(n int, b []byte, v int64) int
- func MarshalMap[K comparable, V any](n int, b []byte, m map[K]V, kMarshaler MarshalFunc[K], ...) int
- func MarshalSlice[T any](n int, b []byte, slice []T, marshaler MarshalFunc[T]) int
- func MarshalString(n int, b []byte, str string) int
- func MarshalUint(n int, b []byte, v uint) int
- func MarshalUint16(n int, b []byte, v uint16) int
- func MarshalUint32(n int, b []byte, v uint32) int
- func MarshalUint64(n int, b []byte, v uint64) int
- func MarshalUnsafeString(n int, b []byte, str string) int
- func SizeBool() int
- func SizeByte() int
- func SizeBytes(bs []byte) int
- func SizeFloat32() int
- func SizeFloat64() int
- func SizeInt(sv int) int
- func SizeInt16() int
- func SizeInt32() int
- func SizeInt64() int
- func SizeMap[K comparable, V any](m map[K]V, kSizer interface{}, vSizer interface{}) (s int)
- func SizeSlice[T any](slice []T, sizer interface{}) (s int)
- func SizeString(str string) int
- func SizeUint(v uint) int
- func SizeUint16() int
- func SizeUint32() int
- func SizeUint64() int
- func SkipBool(n int, b []byte) (int, error)
- func SkipByte(n int, b []byte) (int, error)
- func SkipBytes(n int, b []byte) (int, error)
- func SkipFloat32(n int, b []byte) (int, error)
- func SkipFloat64(n int, b []byte) (int, error)
- func SkipInt16(n int, b []byte) (int, error)
- func SkipInt32(n int, b []byte) (int, error)
- func SkipInt64(n int, b []byte) (int, error)
- func SkipMap(n int, b []byte) (int, error)
- func SkipSlice(n int, b []byte) (int, error)
- func SkipString(n int, b []byte) (int, error)
- func SkipUint16(n int, b []byte) (int, error)
- func SkipUint32(n int, b []byte) (int, error)
- func SkipUint64(n int, b []byte) (int, error)
- func SkipVarint(n int, buf []byte) (int, error)
- func UnmarshalBool(n int, b []byte) (int, bool, error)
- func UnmarshalByte(n int, b []byte) (int, byte, error)
- func UnmarshalBytes(n int, b []byte) (int, []byte, error)
- func UnmarshalFloat32(n int, b []byte) (int, float32, error)
- func UnmarshalFloat64(n int, b []byte) (int, float64, error)
- func UnmarshalInt(n int, buf []byte) (int, int, error)
- func UnmarshalInt16(n int, b []byte) (int, int16, error)
- func UnmarshalInt32(n int, b []byte) (int, int32, error)
- func UnmarshalInt64(n int, b []byte) (int, int64, error)
- func UnmarshalMap[K comparable, V any](n int, b []byte, kUnmarshaler interface{}, vUnmarshaler interface{}) (int, map[K]V, error)
- func UnmarshalSlice[T any](n int, b []byte, unmarshaler interface{}) (int, []T, error)
- func UnmarshalString(n int, b []byte) (int, string, error)
- func UnmarshalUint(n int, buf []byte) (int, uint, error)
- func UnmarshalUint16(n int, b []byte) (int, uint16, error)
- func UnmarshalUint32(n int, b []byte) (int, uint32, error)
- func UnmarshalUint64(n int, b []byte) (int, uint64, error)
- func UnmarshalUnsafeString(n int, b []byte) (int, string, error)
- type MarshalFunc
- type StringHeader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MarshalBool ¶
Returns the new offset 'n' after marshalling the bool.
func MarshalFloat32 ¶
Returns the new offset 'n' after marshalling the 32-bit float.
func MarshalFloat64 ¶
Returns the new offset 'n' after marshalling the 64-bit float.
func MarshalInt ¶
Returns the new offset 'n' after marshalling the integer.
!- Panics, if 'b' is too small.
func MarshalInt16 ¶
Returns the new offset 'n' after marshalling the 16-bit integer.
func MarshalInt32 ¶
Returns the new offset 'n' after marshalling the 32-bit integer.
func MarshalInt64 ¶
Returns the new offset 'n' after marshalling the 64-bit integer.
func MarshalMap ¶
func MarshalMap[K comparable, V any](n int, b []byte, m map[K]V, kMarshaler MarshalFunc[K], vMarshaler MarshalFunc[V]) int
func MarshalSlice ¶
func MarshalSlice[T any](n int, b []byte, slice []T, marshaler MarshalFunc[T]) int
func MarshalUint ¶
Returns the new offset 'n' after marshalling the unsigned integer.
!- Panics, if 'b' is too small.
func MarshalUint16 ¶
Returns the new offset 'n' after marshalling the 16-bit unsigned integer.
func MarshalUint32 ¶
Returns the new offset 'n' after marshalling the 32-bit unsigned integer.
func MarshalUint64 ¶
Returns the new offset 'n' after marshalling the 64-bit unsigned integer.
func SizeMap ¶
func SizeMap[K comparable, V any](m map[K]V, kSizer interface{}, vSizer interface{}) (s int)
func SizeUint16 ¶
func SizeUint16() int
Returns the bytes needed to marshal a 16-bit unsigned integer.
func SizeUint32 ¶
func SizeUint32() int
Returns the bytes needed to marshal a 32-bit unsigned integer.
func SizeUint64 ¶
func SizeUint64() int
Returns the bytes needed to marshal a 64-bit unsigned integer.
func SkipBool ¶
Returns the new offset 'n' after skipping the marshalled bool.
Possible errors returned:
- benc.ErrBufTooSmall - 'b' was too small to skip the marshalled bool.
If a error is returned, n (the int returned) equals zero ( 0 ).
func SkipFloat32 ¶
Returns the new offset 'n' after skipping the marshalled 32-bit float.
Possible errors returned:
- benc.ErrBufTooSmall - 'b' was too small to skip the marshalled 32-bit float.
If a error is returned, n (the int returned) equals zero ( 0 ).
func SkipFloat64 ¶
Returns the new offset 'n' after skipping the marshalled 64-bit float.
Possible errors returned:
- benc.ErrBufTooSmall - 'b' was too small to skip the marshalled 64-bit float.
If a error is returned, n (the int returned) equals zero ( 0 ).
func SkipInt16 ¶
Returns the new offset 'n' after skipping the marshalled 16-bit integer.
Possible errors returned:
- benc.ErrBufTooSmall - 'b' was too small to skip the marshalled 16-bit integer.
If a error is returned, n (the int returned) equals zero ( 0 ).
func SkipInt32 ¶
Returns the new offset 'n' after skipping the marshalled 32-bit integer.
Possible errors returned:
- benc.ErrBufTooSmall - 'b' was too small to skip the marshalled 32-bit integer.
If a error is returned, n (the int returned) equals zero ( 0 ).
func SkipInt64 ¶
Returns the new offset 'n' after skipping the marshalled 64-bit integer.
Possible errors returned:
- benc.ErrBufTooSmall - 'b' was too small to skip the marshalled 64-bit integer.
If a error is returned, n (the int returned) equals zero ( 0 ).
func SkipUint16 ¶
Returns the new offset 'n' after skipping the marshalled 16-bit unsigned integer.
Possible errors returned:
- benc.ErrBufTooSmall - 'b' was too small to skip the marshalled 16-bit unsigned integer.
If a error is returned, n (the int returned) equals zero ( 0 ).
func SkipUint32 ¶
Returns the new offset 'n' after skipping the marshalled 32-bit unsigned integer.
Possible errors returned:
- benc.ErrBufTooSmall - 'b' was too small to skip the marshalled 32-bit unsigned integer.
If a error is returned, n (the int returned) equals zero ( 0 ).
func SkipUint64 ¶
Returns the new offset 'n' after skipping the marshalled 64-bit unsigned integer.
Possible errors returned:
- benc.ErrBufTooSmall - 'b' was too small to skip the marshalled 64-bit unsigned integer.
If a error is returned, n (the int returned) equals zero ( 0 ).
func SkipVarint ¶
Returns the new offset 'n' after skipping the marshalled varint.
Possible errors returned:
- benc.ErrOverflow - varint overflowed a N-bit unsigned integer.
- benc.ErrBufTooSmall - 'buf' was too small to skip the marshalled varint.
If a error is returned, n (the int returned) equals zero ( 0 ).
func UnmarshalBool ¶
Returns the new offset 'n', as well as the bool, that got unmarshalled.
Possible errors returned:
- benc.ErrBufTooSmall - 'b' was too small to unmarshal the bool.
If a error is returned, n (the int returned) equals zero ( 0 ).
func UnmarshalFloat32 ¶
Returns the new offset 'n', as well as the 32-bit float, that got unmarshalled.
Possible errors returned:
- benc.ErrBufTooSmall - 'b' was too small to unmarshal the 32-bit float.
If a error is returned, n (the int returned) equals zero ( 0 ).
func UnmarshalFloat64 ¶
Returns the new offset 'n', as well as the 64-bit float, that got unmarshalled.
Possible errors returned:
- benc.ErrBufTooSmall - 'b' was too small to unmarshal the 64-bit float.
If a error is returned, n (the int returned) equals zero ( 0 ).
func UnmarshalInt ¶
Returns the new offset 'n', as well as the integer, that got unmarshalled.
Possible errors returned:
- benc.ErrOverflow - varint overflowed a N-bit integer.
- benc.ErrBufTooSmall - 'buf' was too small to skip the unmarshal the integer.
If a error is returned, n (the int returned) equals zero ( 0 ).
func UnmarshalInt16 ¶
Returns the new offset 'n', as well as the 16-bit integer, that got unmarshalled.
Possible errors returned:
- benc.ErrBufTooSmall - 'b' was too small to unmarshal the 16-bit integer.
If a error is returned, n (the int returned) equals zero ( 0 ).
func UnmarshalInt32 ¶
Returns the new offset 'n', as well as the 32-bit integer, that got unmarshalled.
Possible errors returned:
- benc.ErrBufTooSmall - 'b' was too small to unmarshal the 32-bit integer.
If a error is returned, n (the int returned) equals zero ( 0 ).
func UnmarshalInt64 ¶
Returns the new offset 'n', as well as the 64-bit integer, that got unmarshalled.
Possible errors returned:
- benc.ErrBufTooSmall - 'b' was too small to unmarshal the 64-bit integer.
If a error is returned, n (the int returned) equals zero ( 0 ).
func UnmarshalMap ¶
func UnmarshalSlice ¶
func UnmarshalUint ¶
Returns the new offset 'n', as well as the unsigned integer, that got unmarshalled.
Possible errors returned:
- benc.ErrOverflow - varint overflowed a N-bit unsigned integer
- benc.ErrBufTooSmall - 'buf' was too small to skip the unmarshal the unsigned integer//
If a error is returned, n (the int returned) equals zero ( 0 ).
func UnmarshalUint16 ¶
Returns the new offset 'n', as well as the 16-bit unsigned integer, that got unmarshalled.
Possible errors returned:
- benc.ErrBufTooSmall - 'b' was too small to unmarshal the 16-bit unsigned integer.
If a error is returned, n (the int returned) equals zero ( 0 ).
func UnmarshalUint32 ¶
Returns the new offset 'n', as well as the 32-bit unsigned integer, that got unmarshalled.
Possible errors returned:
- benc.ErrBufTooSmall - 'b' was too small to unmarshal the 32-bit unsigned integer.
If a error is returned, n (the int returned) equals zero ( 0 ).
func UnmarshalUint64 ¶
Returns the new offset 'n', as well as the 64-bit unsigned integer, that got unmarshalled.
Possible errors returned:
- benc.ErrBufTooSmall - 'b' was too small to unmarshal the 64-bit unsigned integer.
If a error is returned, n (the int returned) equals zero ( 0 ).