datamanager

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBCreator

type DBCreator func(dbname string) database.Database

DBCreator to create db instance

type DataManager

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

DataManager data access between app and database

func NewDataManager

func NewDataManager(dbname string, dbc DBCreator) (*DataManager, error)

NewDataManager create data manager

func (*DataManager) AddV3Ledger

func (m *DataManager) AddV3Ledger(data *database.V3Ledger) (uint64, error)

func (*DataManager) AddV3Payment

func (m *DataManager) AddV3Payment(data *database.V3Payment) (uint64, error)

func (*DataManager) AddV3PaymentStmt

func (m *DataManager) AddV3PaymentStmt(stmt *sql.Stmt, data *database.V3Payment) (err error)

func (*DataManager) AddV3Transaction

func (m *DataManager) AddV3Transaction(data *database.V3Transaction) (uint64, error)

func (*DataManager) AddV3TransactionStmt

func (m *DataManager) AddV3TransactionStmt(stmt *sql.Stmt, data *database.V3Transaction) (err error)

func (*DataManager) Close

func (m *DataManager) Close()

Close close all dbs

func (*DataManager) PrepareV3Payment

func (m *DataManager) PrepareV3Payment() (*sql.Stmt, error)

func (*DataManager) PrepareV3Transaction

func (m *DataManager) PrepareV3Transaction() (*sql.Stmt, error)

func (*DataManager) QTxBegin

func (m *DataManager) QTxBegin() error

QTxBegin start database transaction of wdb

func (*DataManager) QTxCommit

func (m *DataManager) QTxCommit() error

QTxCommit commit database transaction of wdb

func (*DataManager) QTxRollback

func (m *DataManager) QTxRollback() error

QTxRollback rollback database transaction of wdb

func (*DataManager) QueryV3AccountTxs

func (m *DataManager) QueryV3AccountTxs(address string, begin, end uint64, cursor, limit uint64, order string) ([]database.V3Transaction, error)

func (*DataManager) QueryV3AllLedger

func (m *DataManager) QueryV3AllLedger(begin, end uint64, cursor, limit uint64, order string) ([]database.V3Ledger, error)

func (*DataManager) QueryV3AllPayments

func (m *DataManager) QueryV3AllPayments(symbol, contract string, begin, end uint64, cursor, limit uint64, order string) ([]database.V3Payment, error)

func (*DataManager) QueryV3AllTxs

func (m *DataManager) QueryV3AllTxs(begin, end uint64, cursor, limit uint64, order string) ([]database.V3Transaction, error)

func (*DataManager) QueryV3BlockTxs

func (m *DataManager) QueryV3BlockTxs(height int64, begin, end uint64, cursor, limit uint64, order string) ([]database.V3Transaction, error)

func (*DataManager) QueryV3Ledger

func (m *DataManager) QueryV3Ledger(height int64) (*database.V3Ledger, error)

func (*DataManager) QueryV3PaymentsByAddress

func (m *DataManager) QueryV3PaymentsByAddress(address, symbol, contract string, begin, end uint64, cursor, limit uint64, order string) ([]database.V3Payment, error)

func (*DataManager) QueryV3PaymentsByHash

func (m *DataManager) QueryV3PaymentsByHash(hash, symbol, contract string, begin, end uint64, cursor, limit uint64, order string) ([]database.V3Payment, error)

func (*DataManager) QueryV3PaymentsByHeight

func (m *DataManager) QueryV3PaymentsByHeight(height int64, symbol, contract string, begin, end uint64, cursor, limit uint64, order string) ([]database.V3Payment, error)

func (*DataManager) QueryV3SingleTx

func (m *DataManager) QueryV3SingleTx(hash string) (*database.V3Transaction, error)

Jump to

Keyboard shortcuts

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