encoding

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMalformedBigInt = errors.New("invalid big integer string")
View Source
var ErrNotEnoughData = errors.New("not enough data")
View Source
var ErrOverflow = errors.New("overflow")

Functions

func AsBytes

func AsBytes(v interface{}) []byte

func BigintBinarySize

func BigintBinarySize(v *big.Int) int

func BigintCopy added in v0.5.1

func BigintCopy(v *big.Int) *big.Int

func BigintMarshalBinary

func BigintMarshalBinary(v *big.Int) []byte

func BigintUnmarshalBinary

func BigintUnmarshalBinary(b []byte) (*big.Int, error)

func BoolBinarySize

func BoolBinarySize(_ bool) int

func BoolMarshalBinary

func BoolMarshalBinary(v bool) []byte

func BoolUnmarshalBinary

func BoolUnmarshalBinary(b []byte) (bool, error)

func BytesBinarySize

func BytesBinarySize(b []byte) int

func BytesCopy added in v0.5.1

func BytesCopy(v []byte) []byte

func BytesMarshalBinary

func BytesMarshalBinary(b []byte) []byte

func BytesUnmarshalBinary

func BytesUnmarshalBinary(b []byte) ([]byte, error)

func ChainBinarySize

func ChainBinarySize(v *[32]byte) int

ToDo: Why a parameter? It does nothing...

func ChainMarshalBinary

func ChainMarshalBinary(v *[32]byte) []byte

func ChainSetBinarySize

func ChainSetBinarySize(v [][32]byte) int

func ChainSetMarshalBinary

func ChainSetMarshalBinary(v [][32]byte) []byte

func ChainSetUnmarshalBinary

func ChainSetUnmarshalBinary(b []byte) ([][32]byte, error)

func ChainUnmarshalBinary

func ChainUnmarshalBinary(b []byte) ([32]byte, error)

func DurationBinarySize

func DurationBinarySize(d time.Duration) int

func DurationMarshalBinary

func DurationMarshalBinary(d time.Duration) []byte

func DurationUnmarshalBinary

func DurationUnmarshalBinary(b []byte) (time.Duration, error)

func SetPtr added in v0.5.1

func SetPtr(value, target interface{}) (err error)

SetPtr sets *target = value

func SplitDuration

func SplitDuration(d time.Duration) (sec, ns uint64)

func StringBinarySize

func StringBinarySize(s string) int

func StringMarshalBinary

func StringMarshalBinary(s string) []byte

func StringUnmarshalBinary

func StringUnmarshalBinary(b []byte) (string, error)

func TimeBinarySize

func TimeBinarySize(v time.Time) int

func TimeMarshalBinary

func TimeMarshalBinary(v time.Time) []byte

func TimeUnmarshalBinary

func TimeUnmarshalBinary(b []byte) (time.Time, error)

func UnmarshalEnumType

func UnmarshalEnumType(r io.Reader, value EnumValueSetter) error

func UvarintBinarySize

func UvarintBinarySize(v uint64) int

func UvarintMarshalBinary

func UvarintMarshalBinary(v uint64) []byte

func UvarintUnmarshalBinary

func UvarintUnmarshalBinary(b []byte) (uint64, error)

func VarintBinarySize

func VarintBinarySize(v int64) int

func VarintMarshalBinary

func VarintMarshalBinary(v int64) []byte

func VarintUnmarshalBinary

func VarintUnmarshalBinary(b []byte) (int64, error)

Types

type BinaryValue

type BinaryValue = encoding.BinaryValue

type Byter

type Byter interface {
	Bytes() []byte
}

Byter is implemented by any value that has a Bytes method.

type EnumValueGetter added in v0.5.1

type EnumValueGetter = encoding.EnumValueGetter

type EnumValueSetter added in v0.5.1

type EnumValueSetter = encoding.EnumValueSetter

type Error added in v1.0.0

type Error = encoding.Error

type Reader

type Reader = encoding.Reader

func NewReader

func NewReader(r io.Reader) *Reader

type Writer

type Writer = encoding.Writer

func NewWriter

func NewWriter(r io.Writer) *Writer

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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