dbprovider

package
v0.0.0-...-8b03266 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMockDBConfig

func GetMockDBConfig(path string) *conf.StorageConfig

返回一个存储配置对象

Types

type DBFactory

type DBFactory struct {
}

func NewDBFactory

func NewDBFactory() *DBFactory

func (*DBFactory) NewKvDB

func (f *DBFactory) NewKvDB(chainId, providerName, dbFolder string, config map[string]interface{},
	logger protocol.Logger, encryptor crypto.SymmetricKey) (protocol.DBHandle, error)

创建kvdb 对象 根据配置中,配置的不同的provider,创建不同的db对象

func (*DBFactory) NewSqlDB

func (f *DBFactory) NewSqlDB(chainId, dbName string, config map[string]interface{},
	logger protocol.Logger) (
	protocol.SqlDBHandle, error)

创建 sqldb 对象

type EntryGenerator

type EntryGenerator interface {
	Value(i int) []byte
	// contains filtered or unexported methods
}

func NewFullRandomEntryGenerator

func NewFullRandomEntryGenerator(start, n int) EntryGenerator

创建迭代器

Jump to

Keyboard shortcuts

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