stateleveldb

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeValue added in v1.2.0

func DecodeValue(encodedValue []byte) ([]byte, *version.Height)

DecodeValue separates the version and value from a binary value

func EncodeValue added in v1.2.0

func EncodeValue(value []byte, version *version.Height) []byte

EncodeValue appends the value to the version, allows storage of version and value in binary form

Types

type TestVDBEnv

type TestVDBEnv struct {
	DBProvider statedb.VersionedDBProvider
	// contains filtered or unexported fields
}

TestVDBEnv provides a level db backed versioned db for testing

func NewTestVDBEnv

func NewTestVDBEnv(t testing.TB) *TestVDBEnv

NewTestVDBEnv instantiates and new level db backed TestVDB

func (*TestVDBEnv) Cleanup

func (env *TestVDBEnv) Cleanup()

Cleanup closes the db and removes the db folder

type VersionedDBProvider

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

VersionedDBProvider implements interface VersionedDBProvider

func NewVersionedDBProvider

func NewVersionedDBProvider() *VersionedDBProvider

NewVersionedDBProvider instantiates VersionedDBProvider

func (*VersionedDBProvider) Close

func (provider *VersionedDBProvider) Close()

Close closes the underlying db

func (*VersionedDBProvider) GetDBHandle

func (provider *VersionedDBProvider) GetDBHandle(dbName string) (statedb.VersionedDB, error)

GetDBHandle gets the handle to a named database

Jump to

Keyboard shortcuts

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