types

package
v0.0.0-...-6ce3ea9 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrWrongEntryType     = errors.New("Unexpected log entry type.")
	ErrUnknownCompression = errors.New("Unknown compression scheme.")
)

Functions

func FetchBlob

func FetchBlob(s Storage, addr Addr) ([]byte, error)

func FetchTrieMap

func FetchTrieMap(s Storage, addr Addr) (diskstore.TrieMap, error)

Types

type Addr

type Addr struct {
	LogNumber uint64
	LocalAddr
}

func DecodeAddr

func DecodeAddr(addr diskstore.Addr) Addr

func (Addr) Encode

func (a Addr) Encode() diskstore.Addr

func (Addr) EncodeInto

func (a Addr) EncodeInto(da diskstore.Addr)

type LocalAddr

type LocalAddr struct {
	Offset int64
	Length uint32
}

type Storage

type Storage interface {
	// Fetch the log entry at the given address.
	Fetch(Addr) (diskstore.LogEntry, error)

	// Store the data, returning its address.
	WriteEntry(ent diskstore.LogEntry) (Addr, error)

	// Marks the address range for deletion. Note: the current implementation
	// does not use this; proper cleanup is still TODO
	Clear(Addr) error
}

Abstract interface for the backing store.

Jump to

Keyboard shortcuts

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