leveldb

package
v2.3.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: BSD-3-Clause Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store uses LevelDB to store values.

func NewInMemoryStateStore

func NewInMemoryStateStore(l log.Logger) (*Store, error)

func NewStateStore

func NewStateStore(path string, l log.Logger) (*Store, error)

NewStateStore creates a new persistent state storage.

func (*Store) Close

func (s *Store) Close() error

Close releases the resources used by the store.

func (*Store) Delete

func (s *Store) Delete(key string) (err error)

Delete removes entries stored under a specific key.

func (*Store) Get

func (s *Store) Get(key string, i interface{}) error

Get retrieves a value of the requested key. If no results are found, storage.ErrNotFound will be returned.

func (*Store) Iterate

func (s *Store) Iterate(prefix string, iterFunc storage.StateIterFunc) (err error)

Iterate entries that match the supplied prefix.

func (*Store) Put

func (s *Store) Put(key string, i interface{}) (err error)

Put stores a value for an arbitrary key. BinaryMarshaler interface method will be called on the provided value with fallback to JSON serialization.

Jump to

Keyboard shortcuts

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