db

package
v0.0.0-...-4273fad Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Copyright 2018 The trust-net Authors A DB interface that application needs to provide to DLT stack

Copyright 2018 The trust-net Authors In memory implementation of DB interface for testing purpose

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewInMemDatabase

func NewInMemDatabase(name string) *inMemDb

func NewInMemDbProvider

func NewInMemDbProvider() *inMemDbProvider

Types

type Database

type Database interface {
	Put(key []byte, value []byte) error
	Get(key []byte) ([]byte, error)
	GetAll() [][]byte
	Has(key []byte) (bool, error)
	Delete(key []byte) error
	Close() error
	Name() string
	Drop() error
}

type DbProvider

type DbProvider interface {
	DB(namespace string) Database
	CloseAll() error
}

Jump to

Keyboard shortcuts

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