db

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2021 License: MIT Imports: 7 Imported by: 0

README

tm-db-go-datastore

An implementation of tendermint/tm-db database interface by wrapping bdware/go-datastore.

License

MIT

Copyright (c) 2021 The BDWare Authors. All rights reserved.

Documentation

Overview

https://github.com/tendermint/tm-db/blob/3157a928986298875ca48e6d5f77132a32dfb1f0/test_helpers.go

Index

Constants

View Source
const (
	// Backend type for bdware/go-datastore backed tm-db implementation
	GoDatastoreBackend db.BackendType = "go-datastore"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

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

DB implements db.DB by wrapping a bdware/go-datastore Datastore instance

func New

func New(ds ds.Datastore) *DB

New creates a new in-memory database.

func (*DB) Close

func (db *DB) Close() error

Close implements DB.

func (*DB) Datastore

func (db *DB) Datastore() ds.Datastore

func (*DB) Delete

func (db *DB) Delete(key []byte) error

Delete implements DB.

func (*DB) DeleteSync

func (db *DB) DeleteSync(key []byte) error

DeleteSync implements DB.

func (*DB) Get

func (db *DB) Get(key []byte) ([]byte, error)

Get implements DB.

func (*DB) Has

func (db *DB) Has(key []byte) (bool, error)

Has implements DB.

func (*DB) Iterator

func (db *DB) Iterator(start, end []byte) (db.Iterator, error)

iterator implements DB.

func (*DB) NewBatch

func (db *DB) NewBatch() db.Batch

NewBatch implements DB.

func (*DB) Print

func (db *DB) Print() error

Print implements DB.

func (*DB) ReverseIterator

func (db *DB) ReverseIterator(start, end []byte) (db.Iterator, error)

ReverseIterator implements DB. Takes out a read-lock on the database until the iterator is closed.

func (*DB) Set

func (db *DB) Set(key []byte, value []byte) error

Set implements DB.

func (*DB) SetSync

func (db *DB) SetSync(key []byte, value []byte) error

SetSync implements DB.

func (*DB) Stats

func (db *DB) Stats() map[string]string

Stats implements DB.

Jump to

Keyboard shortcuts

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