dec

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2021 License: MIT Imports: 5 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decoder

type Decoder struct {
	// contains filtered or unexported fields
}

A Decoder holds an encoded bytes array and has methods for encoding.

func NewDecoder

func NewDecoder(data []byte) *Decoder

NewDecoder creates a new Decoder for deserialization.

func (*Decoder) AsBool

func (d *Decoder) AsBool(offset int) (bool, int, error)

AsBool checks codes and returns the got bytes as bool

func (*Decoder) AsByte

func (d *Decoder) AsByte(offset int) (byte, int, error)

AsByte checks codes and returns the got bytes as byte

func (*Decoder) AsComplex128

func (d *Decoder) AsComplex128(offset int) (complex128, int, error)

AsComplex128 checks codes and returns the got bytes as complex128

func (*Decoder) AsComplex64

func (d *Decoder) AsComplex64(offset int) (complex64, int, error)

AsComplex64 checks codes and returns the got bytes as complex64

func (*Decoder) AsDateTime

func (d *Decoder) AsDateTime(offset int) (time.Time, int, error)

AsDateTime checks codes and returns the got bytes as time.Time

func (*Decoder) AsFloat32

func (d *Decoder) AsFloat32(offset int) (float32, int, error)

AsFloat32 checks codes and returns the got bytes as float32

func (*Decoder) AsFloat64

func (d *Decoder) AsFloat64(offset int) (float64, int, error)

AsFloat64 checks codes and returns the got bytes as float64

func (*Decoder) AsInt

func (d *Decoder) AsInt(offset int) (int, int, error)

AsInt checks codes and returns the got bytes as int

func (*Decoder) AsInt16

func (d *Decoder) AsInt16(offset int) (int16, int, error)

AsInt16 checks codes and returns the got bytes as int16

func (*Decoder) AsInt32

func (d *Decoder) AsInt32(offset int) (int32, int, error)

AsInt32 checks codes and returns the got bytes as int32

func (*Decoder) AsInt64

func (d *Decoder) AsInt64(offset int) (int64, int, error)

AsInt64 checks codes and returns the got bytes as int64

func (*Decoder) AsInt8

func (d *Decoder) AsInt8(offset int) (int8, int, error)

AsInt8 checks codes and returns the got bytes as int8

func (*Decoder) AsRune

func (d *Decoder) AsRune(offset int) (rune, int, error)

AsRune checks codes and returns the got bytes as rune

func (*Decoder) AsString

func (d *Decoder) AsString(offset int) (string, int, error)

AsString checks codes and returns the got bytes as string

func (*Decoder) AsStringBytes added in v0.3.0

func (d *Decoder) AsStringBytes(offset int) ([]byte, int, error)

func (*Decoder) AsUint

func (d *Decoder) AsUint(offset int) (uint, int, error)

AsUint checks codes and returns the got bytes as uint

func (*Decoder) AsUint16

func (d *Decoder) AsUint16(offset int) (uint16, int, error)

AsUint16 checks codes and returns the got bytes as uint16

func (*Decoder) AsUint32

func (d *Decoder) AsUint32(offset int) (uint32, int, error)

AsUint32 checks codes and returns the got bytes as uint32

func (*Decoder) AsUint64

func (d *Decoder) AsUint64(offset int) (uint64, int, error)

AsUint64 checks codes and returns the got bytes as uint64

func (*Decoder) AsUint8

func (d *Decoder) AsUint8(offset int) (uint8, int, error)

AsUint8 checks codes and returns the got bytes as uint8

func (*Decoder) CheckStructHeader

func (d *Decoder) CheckStructHeader(fieldNum, offset int) (int, error)

CheckStructHeader checks if fieldNum matches the number of fields on the data.

func (*Decoder) IsCodeNil

func (d *Decoder) IsCodeNil(offset int) bool

IsCodeNil returns true if the next data is def.Nil.

func (*Decoder) Len

func (d *Decoder) Len() int

Len get encoded data length.

func (*Decoder) MapLength

func (d *Decoder) MapLength(offset int) (int, int, error)

MapLength reads the need bytes and convert to length value.

func (*Decoder) SliceLength

func (d *Decoder) SliceLength(offset int) (int, int, error)

SliceLength reads the need bytes and convert to length value.

Jump to

Keyboard shortcuts

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