dec

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DecoderFn

type DecoderFn func(dr *DecodingReader, pointer unsafe.Pointer) error

type DecodingReader

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

func NewDecodingReader

func NewDecodingReader(input io.Reader) *DecodingReader

func (*DecodingReader) EnableFuzzMode

func (dr *DecodingReader) EnableFuzzMode()

func (*DecodingReader) GetBytesSpan

func (dr *DecodingReader) GetBytesSpan() uint64

returns the remaining span that can be read

func (*DecodingReader) Index

func (dr *DecodingReader) Index() uint64

how far we have read so far (scoped per container)

func (*DecodingReader) IsFuzzMode

func (dr *DecodingReader) IsFuzzMode() bool

if normal, offsets are used and enforced. if fuzzMode, no offsets are used, and lengths are read from the input, and adjusted to match remaining space.

func (*DecodingReader) Max

func (dr *DecodingReader) Max() uint64

How far we can read (max - i = remaining bytes to read without error). Note: when a child element is not fixed length, the parent should set the scope, so that the child can infer its size from it.

func (*DecodingReader) Read

func (dr *DecodingReader) Read(p []byte) (int, error)

func (*DecodingReader) ReadByte

func (dr *DecodingReader) ReadByte() (byte, error)

func (*DecodingReader) ReadOffset added in v0.1.0

func (dr *DecodingReader) ReadOffset() (uint64, error)

Reads an offset, and wraps it in maximum size, a uint64, for safety.

func (*DecodingReader) ReadUint16

func (dr *DecodingReader) ReadUint16() (uint16, error)

func (*DecodingReader) ReadUint32

func (dr *DecodingReader) ReadUint32() (uint32, error)

func (*DecodingReader) ReadUint64

func (dr *DecodingReader) ReadUint64() (uint64, error)

func (*DecodingReader) Scope

func (dr *DecodingReader) Scope(count uint64) (*DecodingReader, error)

returns a scope of the SSZ reader. Re-uses same scratchpad.

func (*DecodingReader) Skip added in v0.1.4

func (dr *DecodingReader) Skip(count uint64) (int, error)

func (*DecodingReader) UpdateIndexFromScoped

func (dr *DecodingReader) UpdateIndexFromScoped(other *DecodingReader)

type DryCheckFn added in v0.1.4

type DryCheckFn func(dr *DecodingReader) error

Jump to

Keyboard shortcuts

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