prefixstore

package
v0.0.0-...-a6871c7 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package prefixstore provides a store that prefixes all keys with a given prefix. It is used to isolate storage reads and writes for an account. Implementation taken from cosmossdk.io/store/prefix, and adapted to the cosmossdk.io/core/store.KVStore interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(store store.KVStore, prefix []byte) store.KVStore

New creates a new prefix store using the provided bytes prefix.

Types

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store is similar with cometbft/cometbft/libs/db/prefix_db both gives access only to the limited subset of the store for convenience or safety

func (Store) Delete

func (s Store) Delete(key []byte) error

Implements KVStore

func (Store) Get

func (s Store) Get(key []byte) ([]byte, error)

Implements KVStore

func (Store) Has

func (s Store) Has(key []byte) (bool, error)

Implements KVStore

func (Store) Iterator

func (s Store) Iterator(start, end []byte) (store.Iterator, error)

Implements KVStore Check https://github.com/cometbft/cometbft/blob/master/libs/db/prefix_db.go#L106

func (Store) ReverseIterator

func (s Store) ReverseIterator(start, end []byte) (store.Iterator, error)

ReverseIterator implements KVStore Check https://github.com/cometbft/cometbft/blob/master/libs/db/prefix_db.go#L129

func (Store) Set

func (s Store) Set(key, value []byte) error

Implements KVStore

Jump to

Keyboard shortcuts

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