leveldb

package
v1.18.2 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: BSD-3-Clause Imports: 13 Imported by: 3 modules, 2 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 added in v1.3.0

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

Store uses LevelDB to store values.

func NewInMemoryStateStore added in v1.1.0

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 added in v1.3.0

func (s *Store) Close() error

Close releases the resources used by the store.

func (*Store) Delete added in v1.3.0

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

Delete removes entries stored under a specific key.

func (*Store) Get added in v1.3.0

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 added in v1.3.0

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

Iterate entries that match the supplied prefix.

func (*Store) Nuke added in v1.3.0

func (s *Store) Nuke() error

Nuke the store so that only the bare essential entries are left. Careful!

func (*Store) Put added in v1.3.0

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