marshalling

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 20, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEncoderIsReleased = errors.New("encoder has been released and could not accept more data")
	ErrPayloadIsToLarge  = errors.New("payload is too large")
	ErrPayloadIsToSmall  = errors.New("payload is too small")
)

Functions

This section is empty.

Types

type Decoder

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

func NewDecoder

func NewDecoder(data []byte) (decoder *Decoder)

func NewDecoderFromReader

func NewDecoderFromReader(reader io.Reader) (decoder *Decoder)

func (*Decoder) GetBigIntWithByteHeader

func (d *Decoder) GetBigIntWithByteHeader() (value *big.Int, err error)

func (*Decoder) GetDataSegment

func (d *Decoder) GetDataSegment(size int) (data []byte, err error)

func (*Decoder) GetDataSegmentWith2BytesHeader

func (d *Decoder) GetDataSegmentWith2BytesHeader() (data []byte, err error)

func (*Decoder) GetDataSegmentWithByteHeader

func (d *Decoder) GetDataSegmentWithByteHeader() (data []byte, err error)

func (*Decoder) GetInt16

func (d *Decoder) GetInt16() (value int16, err error)

func (*Decoder) GetInt32

func (d *Decoder) GetInt32() (value int32, err error)

func (*Decoder) GetInt64

func (d *Decoder) GetInt64() (value int64, err error)

func (*Decoder) GetInt8

func (d *Decoder) GetInt8() (value int8, err error)

func (*Decoder) GetString

func (d *Decoder) GetString() (value string, err error)

func (*Decoder) GetTimeWithUint8Header

func (d *Decoder) GetTimeWithUint8Header() (value time.Time, err error)

func (*Decoder) GetUint16

func (d *Decoder) GetUint16() (value uint16, err error)

func (*Decoder) GetUint32

func (d *Decoder) GetUint32() (value uint32, err error)

func (*Decoder) GetUint64

func (d *Decoder) GetUint64() (value uint64, err error)

func (*Decoder) GetUint8

func (d *Decoder) GetUint8() (value uint8, err error)

func (*Decoder) UnmarshalDataSegment

func (d *Decoder) UnmarshalDataSegment(size int, destination encoding.BinaryUnmarshaler) (err error)

func (*Decoder) UnmarshalDataSegmentWith2BytesHeader

func (d *Decoder) UnmarshalDataSegmentWith2BytesHeader(destination encoding.BinaryUnmarshaler) (err error)

func (*Decoder) UnmarshalDataSegmentWithByteHeader

func (d *Decoder) UnmarshalDataSegmentWithByteHeader(destination encoding.BinaryUnmarshaler) (err error)

type Encoder

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

func NewEncoder

func NewEncoder() (encoder *Encoder)

func (*Encoder) CollectDataAndReleaseBuffers

func (e *Encoder) CollectDataAndReleaseBuffers() (data []byte)

func (*Encoder) MarshallFixedSizeDataSegment

func (e *Encoder) MarshallFixedSizeDataSegment(s encoding.BinaryMarshaler) (err error)

func (*Encoder) MarshallVariadicDataWith2BytesHeader

func (e *Encoder) MarshallVariadicDataWith2BytesHeader(s encoding.BinaryMarshaler) (err error)

func (*Encoder) MarshallVariadicDataWithByteHeader

func (e *Encoder) MarshallVariadicDataWithByteHeader(s encoding.BinaryMarshaler) (err error)

func (*Encoder) PutBigIntWithByteHeader

func (e *Encoder) PutBigIntWithByteHeader(value *big.Int) (err error)

func (*Encoder) PutFixedSizeDataSegment

func (e *Encoder) PutFixedSizeDataSegment(data []byte) (err error)

func (*Encoder) PutInt16

func (e *Encoder) PutInt16(value int16) (err error)

func (*Encoder) PutInt32

func (e *Encoder) PutInt32(value int32) (err error)

func (*Encoder) PutInt64

func (e *Encoder) PutInt64(value int64) (err error)

func (*Encoder) PutInt8

func (e *Encoder) PutInt8(value int8) (err error)

func (*Encoder) PutString

func (e *Encoder) PutString(value string) (err error)

func (*Encoder) PutTimeWithByte8Header

func (e *Encoder) PutTimeWithByte8Header(value time.Time) (err error)

func (*Encoder) PutUint16

func (e *Encoder) PutUint16(value uint16) (err error)

func (*Encoder) PutUint32

func (e *Encoder) PutUint32(value uint32) (err error)

func (*Encoder) PutUint64

func (e *Encoder) PutUint64(value uint64) (err error)

func (*Encoder) PutUint8

func (e *Encoder) PutUint8(value uint8) (err error)

func (*Encoder) PutVariadicDataWith2BytesHeader

func (e *Encoder) PutVariadicDataWith2BytesHeader(data []byte) (err error)

func (*Encoder) PutVariadicDataWithByteHeader

func (e *Encoder) PutVariadicDataWithByteHeader(data []byte) (err error)

Jump to

Keyboard shortcuts

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