package e2store
import "github.com/ethereum/go-ethereum/internal/era/e2store"
Index ¶
- type Entry
- type Reader
- func NewReader(r io.ReaderAt) *Reader
- func (r *Reader) Find(want uint16) (*Entry, error)
- func (r *Reader) FindAll(want uint16) ([]*Entry, error)
- func (r *Reader) LengthAt(off int64) (int64, error)
- func (r *Reader) Read() (*Entry, error)
- func (r *Reader) ReadAt(entry *Entry, off int64) (int, error)
- func (r *Reader) ReadMetadataAt(off int64) (typ uint16, length uint32, err error)
- func (r *Reader) ReaderAt(expectedType uint16, off int64) (io.Reader, int, error)
- func (r *Reader) SkipN(offset int64, n uint64) (int64, error)
- type Writer
Types ¶
type Entry ¶
Entry is a variable-length-data record in an e2store.
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
A Reader reads entries from an e2store-encoded file. For more information on this format, see https://github.com/status-im/nimbus-eth2/blob/stable/docs/e2store.md
func NewReader ¶
NewReader returns a new Reader that reads from r.
func (*Reader) Find ¶
Find returns the first entry with the matching type.
func (*Reader) FindAll ¶
FindAll returns all entries with the matching type.
func (*Reader) LengthAt ¶
LengthAt reads the header at off and returns the total length of the entry, including header.
func (*Reader) Read ¶
Read reads one Entry from r.
func (*Reader) ReadAt ¶
ReadAt reads one Entry from r at the specified offset.
func (*Reader) ReadMetadataAt ¶
ReadMetadataAt reads the header metadata at the given offset.
func (*Reader) ReaderAt ¶
ReaderAt returns an io.Reader delivering value data for the entry at the specified offset. If the entry type does not match the expected type, an error is returned.
func (*Reader) SkipN ¶
SkipN skips `n` entries starting from `offset` and returns the new offset.
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer writes entries using e2store encoding. For more information on this format, see: https://github.com/status-im/nimbus-eth2/blob/stable/docs/e2store.md
func NewWriter ¶
NewWriter returns a new Writer that writes to w.
func (*Writer) Write ¶
Write writes a single e2store entry to w. An entry is encoded in a type-length-value format. The first 8 bytes of the record store the type (2 bytes), the length (4 bytes), and some reserved data (2 bytes). The remaining bytes store b.
Source Files ¶
- Version
- v1.16.1 (latest)
- Published
- Jul 2, 2025
- Platform
- linux/amd64
- Imports
- 4 packages
- Last checked
- 6 days ago –
Tools for package owners.