Versions in this module Expand all Collapse all v1 v1.2.2 Oct 8, 2020 Changes in this version + type AssetToken struct + Code common.Hash + Id common.Hash + MetaData string + Owner common.Address + func (a *AssetToken) UnmarshalJSON(input []byte) error + func (a AssetToken) MarshalJSON() ([]byte, error) + type AssetTokenDao struct + func NewAssetTokenDao(db DBEngine) *AssetTokenDao + func (dao *AssetTokenDao) Get(id common.Hash) (*AssetToken, error) + func (dao *AssetTokenDao) GetPage(addr common.Address, start, limit int) ([]*AssetToken, error) + func (dao *AssetTokenDao) GetPageByCode(code common.Hash, start, limit int) ([]*AssetToken, error) + func (dao *AssetTokenDao) GetPageByCodeWithTotal(code common.Hash, start, limit int) ([]*AssetToken, int, error) + func (dao *AssetTokenDao) GetPageWithTotal(addr common.Address, start, limit int) ([]*AssetToken, int, error) + func (dao *AssetTokenDao) Set(assetToken *AssetToken) error type TxDao + func (dao *TxDao) GetByType(addr common.Address, txType uint16, start, limit int) ([]*Tx, error) + func (dao *TxDao) GetByTypeWithTotal(addr common.Address, txType uint16, start, limit int) ([]*Tx, int, error) v1.2.1 Sep 5, 2020 v1.2.0 Aug 31, 2020 Changes in this version + var DRIVER_MYSQL = "mysql" + var ErrBigIntSetString = errors.New("big int setString error") + var HOST_MYSQL = "root:123456@tcp(localhost:3306)/lemochain?charset=utf8mb4" + func GetStorageKey(hash common.Hash) []byte + type MetaData struct + Code common.Hash + Id common.Hash + Owner common.Address + Profile string + func (m *MetaData) UnmarshalJSON(input []byte) error + func (m MetaData) MarshalJSON() ([]byte, error) + type MetaDataDao struct + func NewMetaDataDao(db DBEngine) *MetaDataDao + func (dao *MetaDataDao) Get(id common.Hash) (*MetaData, error) + func (dao *MetaDataDao) GetPage(addr common.Address, start, limit int) ([]*MetaData, error) + func (dao *MetaDataDao) GetPageByCode(code common.Hash, start, limit int) ([]*MetaData, error) + func (dao *MetaDataDao) GetPageByCodeWithTotal(code common.Hash, start, limit int) ([]*MetaData, int, error) + func (dao *MetaDataDao) GetPageWithTotal(addr common.Address, start, limit int) ([]*MetaData, int, error) + func (dao *MetaDataDao) Set(metaData *MetaData) error type Tx + AssetCode common.Hash + AssetId common.Hash + Flag int + PHash common.Hash + PackageTime uint32 type TxDao + func (dao *TxDao) GetByAddressAndAssetCodeOrAssetId(addr common.Address, assetCodeOrId common.Hash, start, limit int) ([]*Tx, error) + func (dao *TxDao) GetByAddressAndAssetCodeOrAssetIdWithTotal(addr common.Address, assetCodeOrId common.Hash, start, limit int) ([]*Tx, int, error) v0 v0.9.0 Apr 25, 2019 Changes in this version + var ContextKeyCurrentBlock = "context.chain.current_block" + var ErrArgInvalid = errors.New("invalid argument") + var ErrExist = errors.New("item already exists") + var ErrNoEvents = errors.New("the times of pop event is more than push") + var ErrNotExist = errors.New("item does not exist") + var ErrOutOfMemory = errors.New("out of memory") + var ErrRlpEncode = errors.New("rlp encode err") + var ErrUnKnown = errors.New("") + 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 struct + func NewAccountDao(db DBEngine) *AccountDao + func (dao *AccountDao) Get(addr common.Address) (*types.AccountData, error) + func (dao *AccountDao) GetDB() *sql.DB + func (dao *AccountDao) Set(addr common.Address, account *types.AccountData) error + type AssetDao struct + func NewAssetDao(db DBEngine) *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 struct + func NewBlockDao(db DBEngine) *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 struct + func NewCandidateDao(engine DBEngine) *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 struct + User common.Address + Votes *big.Int + type Context struct + type ContextDao struct + func NewContextDao(db DBEngine) *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 interface + GetDB func() *sql.DB + type EquityDao struct + func NewEquityDao(db DBEngine) *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 struct + func NewKvDao(db DBEngine) *KvDao + func (dao *KvDao) Get(key []byte) ([]byte, error) + func (dao *KvDao) Set(key []byte, val []byte) error + type MateData struct + Code common.Hash + Id common.Hash + Owner common.Address + Profile string + type MateDataDao struct + func NewMateDataDao(db DBEngine) *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 struct + func NewMySqlDB(driver string, dns string) *MySqlDB + func (db *MySqlDB) Clear() error + func (db *MySqlDB) Close() + func (db *MySqlDB) GetDB() *sql.DB + type Tx struct + BHash common.Hash + From common.Address + Height uint32 + St int64 + THash common.Hash + To common.Address + Tx *types.Transaction + type TxDao struct + func NewTxDao(db DBEngine) *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