leveldbstore

package
v0.4.8 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package leveldbstore implements a simple key-value local store. It's efficient and can be used by stores to save key-value pairs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Path where key-value pairs will be saved.
	Path string
}

Config contains configuration options for the store.

type LevelDBStore

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

LevelDBStore implements github.com/stratumn/go-core/store.KeyValueStore.

func New

func New(config *Config) (*LevelDBStore, error)

New creates an instance of a LevelDBStore.

func (*LevelDBStore) DeleteValue

func (a *LevelDBStore) DeleteValue(ctx context.Context, key []byte) ([]byte, error)

DeleteValue implements github.com/stratumn/go-core/store.KeyValueStore.DeleteValue.

func (*LevelDBStore) GetValue

func (a *LevelDBStore) GetValue(ctx context.Context, key []byte) ([]byte, error)

GetValue implements github.com/stratumn/go-core/store.KeyValueStore.GetValue.

func (*LevelDBStore) SetValue

func (a *LevelDBStore) SetValue(ctx context.Context, key []byte, value []byte) error

SetValue implements github.com/stratumn/go-core/store.KeyValueStore.SetValue.

Jump to

Keyboard shortcuts

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