leveldb

package
v1.10.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2022 License: BSD-3-Clause Imports: 13 Imported by: 2

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

func (s *Store) DB() *leveldb.DB

DB implements StateStorer.DB method.

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(forgetStamps bool) 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