types

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ImportEntry

type ImportEntry struct {
	StoreKey string
	Key      []byte
	Value    []byte
}

type StateStore

type StateStore interface {
	Get(storeKey string, version int64, key []byte) ([]byte, error)
	Has(storeKey string, version int64, key []byte) (bool, error)
	Iterator(storeKey string, version int64, start, end []byte) (types.Iterator, error)
	ReverseIterator(storeKey string, version int64, start, end []byte) (types.Iterator, error)
	GetLatestVersion() (int64, error)
	SetLatestVersion(version int64) error

	// ApplyChangeset Persist the change set of a block,
	// the `changeSet` should be ordered by (storeKey, key),
	// the version should be latest version plus one.
	ApplyChangeset(version int64, cs *proto.NamedChangeSet) error

	// Import the initial state of the store
	Import(version int64, ch <-chan ImportEntry) error

	// Prune attempts to prune all versions up to and including the provided
	// version argument. The operation should be idempotent. An error should be
	// returned upon failure.
	Prune(version int64) error

	// Closer releases associated resources. It should NOT be idempotent. It must
	// only be called once and any call after may panic.
	io.Closer
}

StateStore is a versioned, embedded Key-Value Store, which allows efficient reads, writes, iteration over a specific version

Jump to

Keyboard shortcuts

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