dbprovider

package
v2.3.5 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 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

GetMockDBConfig 返回一个存储配置对象 @Description: @param path @return *conf.StorageConfig

Types

type DBFactory

type DBFactory struct {
}

DBFactory db factory struct @Description:

func NewDBFactory

func NewDBFactory() *DBFactory

NewDBFactory new factory @Description: @return *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)

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

@Description:
@receiver f
@return unc

func (*DBFactory) NewSqlDB

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

NewSqlDB 创建 sqldb 对象

@Description:
@receiver f
@return unc

type EntryGenerator

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

EntryGenerator interface @Description:

func NewFullRandomEntryGenerator

func NewFullRandomEntryGenerator(start, n int) EntryGenerator

NewFullRandomEntryGenerator 创建迭代器 @Description: @param start @param n @return EntryGenerator

Jump to

Keyboard shortcuts

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