Documentation
¶
Index ¶
- type DecoderFn
- type DecodingReader
- func (dr *DecodingReader) EnableFuzzMode()
- func (dr *DecodingReader) GetBytesSpan() uint64
- func (dr *DecodingReader) Index() uint64
- func (dr *DecodingReader) IsFuzzMode() bool
- func (dr *DecodingReader) Max() uint64
- func (dr *DecodingReader) Read(p []byte) (int, error)
- func (dr *DecodingReader) ReadByte() (byte, error)
- func (dr *DecodingReader) ReadOffset() (uint64, error)
- func (dr *DecodingReader) ReadUint16() (uint16, error)
- func (dr *DecodingReader) ReadUint32() (uint32, error)
- func (dr *DecodingReader) ReadUint64() (uint64, error)
- func (dr *DecodingReader) Scope(count uint64) (*DecodingReader, error)
- func (dr *DecodingReader) Skip(count uint64) (int, error)
- func (dr *DecodingReader) UpdateIndexFromScoped(other *DecodingReader)
- type DryCheckFn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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) 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
Click to show internal directories.
Click to hide internal directories.