Documentation ¶
Index ¶
- Constants
- Variables
- func CoppySnappyEntry(f io.Reader, w io.Writer, sr *snappy.Reader, expectType EntryType) error
- func ReadBlockOffset(f io.ReadSeeker, i uint64) (int64, error)
- func ReadInt64(f io.Reader) (int64, error)
- func ReadSlot(f io.Reader) (common.Slot, error)
- func ReadStateOffsetAndSlot(f io.ReadSeeker) (offset int64, slot common.Slot, err error)
- func ReadUint64(f io.Reader) (uint64, error)
- func SeekBlock(f io.ReadSeeker, i uint64, groupEnd int64) error
- func SeekGroupStart(f io.ReadSeeker, groupEnd int64) error
- func SeekState(f io.ReadSeeker, groupEnd int64) (slot common.Slot, err error)
- func Tell(f io.Seeker) (int64, error)
- type EntryType
- type Store
Constants ¶
View Source
const (
SlotsPerEra = 8192
)
Variables ¶
View Source
var ( SlotIndexType = EntryType{'i', '2'} // starting-slot | index | index | index ... | count VersionType = EntryType{'e', '2'} // always 0-length CompressedSignedBeaconBlockType = EntryType{1, 0} CompressedBeaconStateType = EntryType{2, 0} EmptyType = EntryType{0, 0} // may have a length, data should be skipped )
View Source
var ErrNotExist = errors.New("entry does not exist")
Functions ¶
func CoppySnappyEntry ¶
func ReadBlockOffset ¶
func ReadBlockOffset(f io.ReadSeeker, i uint64) (int64, error)
ReadBlockOffset reads the file offset of block i (slot relative to group slot-index). Seeker f must be positioned at the end of a group. Returns offset relative to start of file.
func ReadStateOffsetAndSlot ¶
ReadStateOffsetAndSlot reads the file offset of the state. Seeker f must be positioned at the end of a group. Returns offset relative to start of file. Seeker f will be positioned where it started after a successful read. The slot of the state is returned as well.
func SeekGroupStart ¶
func SeekGroupStart(f io.ReadSeeker, groupEnd int64) error
Types ¶
Click to show internal directories.
Click to hide internal directories.