database

package
v0.0.0-...-dde17ac Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2018 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KVStore

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

KVStore is an in-memory mapping of hashes to RLP encoded values.

func NewKVStore

func NewKVStore() *KVStore

NewKVStore creates an in-memory, key-value store.

func (*KVStore) Close

func (s *KVStore) Close()

Close satisfies essdb.Database.

func (*KVStore) Delete

func (s *KVStore) Delete(k []byte) error

Delete removes the key and value from the mapping.

func (*KVStore) Get

func (s *KVStore) Get(k []byte) ([]byte, error)

Get fetches a val from the mappping by key.

func (*KVStore) Has

func (s *KVStore) Has(k []byte) (bool, error)

Has checks if the key exists in the mapping.

func (*KVStore) NewBatch

func (s *KVStore) NewBatch() essdb.Batch

NewBatch satisfies essdb.Database.

func (*KVStore) Put

func (s *KVStore) Put(k []byte, v []byte) error

Put updates a key's value in the mapping.

Jump to

Keyboard shortcuts

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