Documentation
¶
Index ¶
- Variables
- func CreateDB(db *sql.DB) (sql.Result, error)
- func Del(db *sql.DB, key string) error
- func ErrIsNotExist(err error) bool
- func GetAddressKey(addr common.Address) []byte
- func GetBlockHashKey(hash common.Hash) []byte
- func GetCanonicalKey(height uint32) []byte
- func NewAccountData(address common.Address) *types.AccountData
- func Open(driver string, dns string) (*sql.DB, error)
- type AccountDao
- type AssetDao
- func (dao *AssetDao) Get(code common.Hash) (*types.Asset, error)
- func (dao *AssetDao) GetPage(addr common.Address, start, limit int) ([]*types.Asset, error)
- func (dao *AssetDao) GetPageWithTotal(addr common.Address, start, limit int) ([]*types.Asset, int, error)
- func (dao *AssetDao) Set(asset *types.Asset) error
- type BlockDao
- func (dao *BlockDao) GetBlock(hash common.Hash) (*types.Block, error)
- func (dao *BlockDao) GetBlockByHeight(height uint32) (*types.Block, error)
- func (dao *BlockDao) GetDB() *sql.DB
- func (dao *BlockDao) IsExist(hash common.Hash) (bool, error)
- func (dao *BlockDao) SetBlock(hash common.Hash, block *types.Block) error
- type CandidateDao
- func (dao *CandidateDao) Del(user common.Address) error
- func (dao *CandidateDao) GetPage(start, limit int) ([]*CandidateItem, error)
- func (dao *CandidateDao) GetPageWithTotal(start, limit int) ([]*CandidateItem, int, error)
- func (dao *CandidateDao) GetTop(size int) ([]*CandidateItem, error)
- func (dao *CandidateDao) Set(item *CandidateItem) error
- type CandidateItem
- type Context
- type ContextDao
- func (dao *ContextDao) ContextGet(key string) ([]byte, error)
- func (dao *ContextDao) ContextLoad() ([]*Context, error)
- func (dao *ContextDao) ContextSet(key string, val []byte) error
- func (dao *ContextDao) GetCurrentBlock() (*types.Block, error)
- func (dao *ContextDao) SetCurrentBlock(block *types.Block) error
- type DBEngine
- type EquityDao
- func (dao *EquityDao) Get(addr common.Address, id common.Hash) (*types.AssetEquity, error)
- func (dao *EquityDao) GetPage(addr common.Address, start, limit int) ([]*types.AssetEquity, error)
- func (dao *EquityDao) GetPageByCode(addr common.Address, code common.Hash, start, limit int) ([]*types.AssetEquity, error)
- func (dao *EquityDao) GetPageByCodeWithTotal(addr common.Address, code common.Hash, start, limit int) ([]*types.AssetEquity, int, error)
- func (dao *EquityDao) GetPageWithTotal(addr common.Address, start, limit int) ([]*types.AssetEquity, int, error)
- func (dao *EquityDao) Set(addr common.Address, assetEquity *types.AssetEquity) error
- type KvDao
- type MateData
- type MateDataDao
- func (dao *MateDataDao) Get(id common.Hash) (*MateData, error)
- func (dao *MateDataDao) GetPage(addr common.Address, start, limit int) ([]*MateData, error)
- func (dao *MateDataDao) GetPageByCode(code common.Hash, start, limit int) ([]*MateData, error)
- func (dao *MateDataDao) GetPageByCodeWithTotal(code common.Hash, start, limit int) ([]*MateData, int, error)
- func (dao *MateDataDao) GetPageWithTotal(addr common.Address, start, limit int) ([]*MateData, int, error)
- func (dao *MateDataDao) Set(mateData *MateData) error
- type MySqlDB
- type Tx
- type TxDao
- func (dao *TxDao) Get(hash common.Hash) (*Tx, error)
- func (dao *TxDao) GetByAddr(addr common.Address, start, limit int) ([]*Tx, error)
- func (dao *TxDao) GetByAddrWithTotal(addr common.Address, start, limit int) ([]*Tx, int, error)
- func (dao *TxDao) GetByFrom(addr common.Address, start, limit int) ([]*Tx, error)
- func (dao *TxDao) GetByFromWithTotal(addr common.Address, start, limit int) ([]*Tx, int, error)
- func (dao *TxDao) GetByTime(addr common.Address, stStart, stStop int64, start, limit int) ([]*Tx, error)
- func (dao *TxDao) GetByTimeWithTotal(addr common.Address, stStart, stStop int64, start, limit int) ([]*Tx, int, error)
- func (dao *TxDao) GetByTo(addr common.Address, start, limit int) ([]*Tx, error)
- func (dao *TxDao) GetByToWithTotal(addr common.Address, start, limit int) ([]*Tx, int, error)
- func (dao *TxDao) Set(tx *Tx) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrArgInvalid = errors.New("invalid argument") ErrExist = errors.New("item already exists") ErrNoEvents = errors.New("the times of pop event is more than push") ErrNotExist = errors.New("item does not exist") ErrRlpEncode = errors.New("rlp encode err") ErrOutOfMemory = errors.New("out of memory") ErrUnKnown = errors.New("") )
View Source
var (
ContextKeyCurrentBlock = "context.chain.current_block"
)
Functions ¶
func ErrIsNotExist ¶
func GetAddressKey ¶
func GetBlockHashKey ¶
func GetCanonicalKey ¶
func NewAccountData ¶
func NewAccountData(address common.Address) *types.AccountData
Types ¶
type AccountDao ¶
type AccountDao struct {
// contains filtered or unexported fields
}
func NewAccountDao ¶
func NewAccountDao(db DBEngine) *AccountDao
func (*AccountDao) Get ¶
func (dao *AccountDao) Get(addr common.Address) (*types.AccountData, error)
func (*AccountDao) GetDB ¶
func (dao *AccountDao) GetDB() *sql.DB
func (*AccountDao) Set ¶
func (dao *AccountDao) Set(addr common.Address, account *types.AccountData) error
type AssetDao ¶
type AssetDao struct {
// contains filtered or unexported fields
}
func NewAssetDao ¶
func (*AssetDao) GetPageWithTotal ¶
type BlockDao ¶
type BlockDao struct {
// contains filtered or unexported fields
}
func NewBlockDao ¶
func (*BlockDao) GetBlockByHeight ¶
type CandidateDao ¶
type CandidateDao struct {
// contains filtered or unexported fields
}
func NewCandidateDao ¶
func NewCandidateDao(engine DBEngine) *CandidateDao
func (*CandidateDao) GetPage ¶
func (dao *CandidateDao) GetPage(start, limit int) ([]*CandidateItem, error)
func (*CandidateDao) GetPageWithTotal ¶
func (dao *CandidateDao) GetPageWithTotal(start, limit int) ([]*CandidateItem, int, error)
func (*CandidateDao) GetTop ¶
func (dao *CandidateDao) GetTop(size int) ([]*CandidateItem, error)
func (*CandidateDao) Set ¶
func (dao *CandidateDao) Set(item *CandidateItem) error
type ContextDao ¶
type ContextDao struct {
// contains filtered or unexported fields
}
func NewContextDao ¶
func NewContextDao(db DBEngine) *ContextDao
func (*ContextDao) ContextGet ¶
func (dao *ContextDao) ContextGet(key string) ([]byte, error)
func (*ContextDao) ContextLoad ¶
func (dao *ContextDao) ContextLoad() ([]*Context, error)
func (*ContextDao) ContextSet ¶
func (dao *ContextDao) ContextSet(key string, val []byte) error
func (*ContextDao) GetCurrentBlock ¶
func (dao *ContextDao) GetCurrentBlock() (*types.Block, error)
func (*ContextDao) SetCurrentBlock ¶
func (dao *ContextDao) SetCurrentBlock(block *types.Block) error
type EquityDao ¶
type EquityDao struct {
// contains filtered or unexported fields
}
func NewEquityDao ¶
func (*EquityDao) GetPageByCode ¶
func (*EquityDao) GetPageByCodeWithTotal ¶
func (*EquityDao) GetPageWithTotal ¶
type KvDao ¶
type KvDao struct {
// contains filtered or unexported fields
}
*
- (1) hash => block
- (2) hash => tx
- (3) address => account
type MateDataDao ¶
type MateDataDao struct {
// contains filtered or unexported fields
}
func NewMateDataDao ¶
func NewMateDataDao(db DBEngine) *MateDataDao
func (*MateDataDao) GetPageByCode ¶
func (*MateDataDao) GetPageByCodeWithTotal ¶
func (*MateDataDao) GetPageWithTotal ¶
func (*MateDataDao) Set ¶
func (dao *MateDataDao) Set(mateData *MateData) error
type TxDao ¶
type TxDao struct {
// contains filtered or unexported fields
}
func (*TxDao) GetByAddrWithTotal ¶
func (*TxDao) GetByFromWithTotal ¶
func (*TxDao) GetByTimeWithTotal ¶
func (*TxDao) GetByToWithTotal ¶
Click to show internal directories.
Click to hide internal directories.