Documentation ¶
Index ¶
- Variables
- func DeleteSwapPending(db *gorm.DB, record *types.SwapPending) error
- func GetQGasSwapInfoByUniqueID(db *gorm.DB, hash string, action types.QGasSwapType) (*types.QGasSwapInfo, error)
- func GetQGasSwapInfoByUserTxHash(db *gorm.DB, hash string) (*types.QGasSwapInfo, error)
- func GetQGasSwapInfos(db *gorm.DB, page, pageSize int) ([]*types.QGasSwapInfo, error)
- func GetQGasSwapInfosByState(db *gorm.DB, page, pageSize int, state types.QGasSwapState) ([]*types.QGasSwapInfo, error)
- func GetQGasSwapInfosByUserAddr(db *gorm.DB, page, pageSize int, addr string, action types.QGasSwapType) ([]*types.QGasSwapInfo, error)
- func GetSwapInfoByTxHash(db *gorm.DB, hash string, action types.ChainType) (*types.SwapInfo, error)
- func GetSwapInfos(db *gorm.DB, page, pageSize int) ([]*types.SwapInfo, error)
- func GetSwapInfosByAddr(db *gorm.DB, page, pageSize int, addr string, action types.ChainType) ([]*types.SwapInfo, error)
- func GetSwapInfosByState(db *gorm.DB, page, pageSize int, state types.SwapState) ([]*types.SwapInfo, error)
- func GetSwapPendingByTxEthHash(db *gorm.DB, hash string) (*types.SwapPending, error)
- func GetSwapPendingByTxNeoHash(db *gorm.DB, hash string) (*types.SwapPending, error)
- func GetSwapPendings(db *gorm.DB, page, pageSize int) ([]*types.SwapPending, error)
- func InsertQGasSwapInfo(db *gorm.DB, record *types.QGasSwapInfo) error
- func InsertSwapInfo(db *gorm.DB, record *types.SwapInfo) error
- func InsertSwapPending(db *gorm.DB, record *types.SwapPending) error
- func NewDB(url string) (*gorm.DB, error)
- func Paginate(page, pageSize int) func(db *gorm.DB) *gorm.DB
- func UpdateQGasSwapInfo(db *gorm.DB, record *types.QGasSwapInfo) error
- func UpdateSwapInfo(db *gorm.DB, record *types.SwapInfo) error
- type ActionType
- type BadgerStore
- func (b *BadgerStore) Action(at ActionType) (interface{}, error)
- func (b *BadgerStore) Batch(canRead bool) Batch
- func (b *BadgerStore) BatchWrite(canRead bool, fn func(batch Batch) error) error
- func (b *BadgerStore) Close() error
- func (b *BadgerStore) Count(prefix []byte) (uint64, error)
- func (b *BadgerStore) Delete(k []byte) error
- func (b *BadgerStore) Drop(prefix []byte) error
- func (b *BadgerStore) Get(k []byte) ([]byte, error)
- func (b *BadgerStore) Has(k []byte) (bool, error)
- func (b *BadgerStore) Iterator(prefix []byte, end []byte, fn func(k, v []byte) error) error
- func (b *BadgerStore) Purge() error
- func (b *BadgerStore) Put(k, v []byte) error
- func (b *BadgerStore) PutBatch(batch Batch) error
- func (b *BadgerStore) Upgrade(int) error
- type BadgerTransaction
- func (b *BadgerTransaction) Delete(k []byte) error
- func (b *BadgerTransaction) Discard()
- func (b *BadgerTransaction) Drop(prefix []byte) error
- func (b *BadgerTransaction) Get(k []byte) (interface{}, error)
- func (b *BadgerTransaction) Iterator(prefix []byte, end []byte, fn func(k, v []byte) error) error
- func (b *BadgerTransaction) Put(k []byte, v interface{}) error
- type BadgerWriteBatch
- func (b *BadgerWriteBatch) Delete(k []byte) error
- func (b *BadgerWriteBatch) Discard()
- func (b *BadgerWriteBatch) Drop([]byte) error
- func (b *BadgerWriteBatch) Get([]byte) (interface{}, error)
- func (b *BadgerWriteBatch) Iterator([]byte, []byte, func(k []byte, v []byte) error) error
- func (b *BadgerWriteBatch) Put(k []byte, v interface{}) error
- type Batch
- type KeyPrefix
- type Store
Constants ¶
This section is empty.
Variables ¶
View Source
var KeyNotFound = errors.New("key not found")
Functions ¶
func DeleteSwapPending ¶ added in v1.0.1
func DeleteSwapPending(db *gorm.DB, record *types.SwapPending) error
func GetQGasSwapInfoByUniqueID ¶ added in v1.0.1
func GetQGasSwapInfoByUniqueID(db *gorm.DB, hash string, action types.QGasSwapType) (*types.QGasSwapInfo, error)
func GetQGasSwapInfoByUserTxHash ¶ added in v1.0.1
func GetQGasSwapInfos ¶ added in v1.0.1
func GetQGasSwapInfosByState ¶ added in v1.0.1
func GetQGasSwapInfosByState(db *gorm.DB, page, pageSize int, state types.QGasSwapState) ([]*types.QGasSwapInfo, error)
func GetQGasSwapInfosByUserAddr ¶ added in v1.0.1
func GetQGasSwapInfosByUserAddr(db *gorm.DB, page, pageSize int, addr string, action types.QGasSwapType) ([]*types.QGasSwapInfo, error)
func GetSwapInfoByTxHash ¶ added in v1.0.1
func GetSwapInfos ¶ added in v1.0.1
func GetSwapInfosByAddr ¶ added in v1.0.1
func GetSwapInfosByState ¶ added in v1.0.1
func GetSwapPendingByTxEthHash ¶ added in v1.0.1
func GetSwapPendingByTxNeoHash ¶ added in v1.0.1
func GetSwapPendings ¶ added in v1.0.1
func InsertQGasSwapInfo ¶ added in v1.0.1
func InsertQGasSwapInfo(db *gorm.DB, record *types.QGasSwapInfo) error
func InsertSwapInfo ¶ added in v1.0.1
func InsertSwapPending ¶ added in v1.0.1
func InsertSwapPending(db *gorm.DB, record *types.SwapPending) error
func UpdateQGasSwapInfo ¶ added in v1.0.1
func UpdateQGasSwapInfo(db *gorm.DB, record *types.QGasSwapInfo) error
Types ¶
type BadgerStore ¶
type BadgerStore struct {
// contains filtered or unexported fields
}
func (*BadgerStore) Action ¶
func (b *BadgerStore) Action(at ActionType) (interface{}, error)
func (*BadgerStore) Batch ¶
func (b *BadgerStore) Batch(canRead bool) Batch
func (*BadgerStore) BatchWrite ¶
func (b *BadgerStore) BatchWrite(canRead bool, fn func(batch Batch) error) error
func (*BadgerStore) Close ¶
func (b *BadgerStore) Close() error
func (*BadgerStore) Delete ¶
func (b *BadgerStore) Delete(k []byte) error
func (*BadgerStore) Drop ¶
func (b *BadgerStore) Drop(prefix []byte) error
func (*BadgerStore) Purge ¶
func (b *BadgerStore) Purge() error
func (*BadgerStore) Put ¶
func (b *BadgerStore) Put(k, v []byte) error
func (*BadgerStore) PutBatch ¶
func (b *BadgerStore) PutBatch(batch Batch) error
func (*BadgerStore) Upgrade ¶
func (b *BadgerStore) Upgrade(int) error
type BadgerTransaction ¶
type BadgerTransaction struct {
// contains filtered or unexported fields
}
func (*BadgerTransaction) Delete ¶
func (b *BadgerTransaction) Delete(k []byte) error
func (*BadgerTransaction) Discard ¶
func (b *BadgerTransaction) Discard()
func (*BadgerTransaction) Drop ¶
func (b *BadgerTransaction) Drop(prefix []byte) error
func (*BadgerTransaction) Get ¶
func (b *BadgerTransaction) Get(k []byte) (interface{}, error)
func (*BadgerTransaction) Put ¶
func (b *BadgerTransaction) Put(k []byte, v interface{}) error
type BadgerWriteBatch ¶
type BadgerWriteBatch struct {
// contains filtered or unexported fields
}
func (*BadgerWriteBatch) Delete ¶
func (b *BadgerWriteBatch) Delete(k []byte) error
func (*BadgerWriteBatch) Discard ¶
func (b *BadgerWriteBatch) Discard()
func (*BadgerWriteBatch) Drop ¶
func (b *BadgerWriteBatch) Drop([]byte) error
func (*BadgerWriteBatch) Get ¶
func (b *BadgerWriteBatch) Get([]byte) (interface{}, error)
func (*BadgerWriteBatch) Put ¶
func (b *BadgerWriteBatch) Put(k []byte, v interface{}) error
type Store ¶
type Store interface { Delete(k []byte) error Get([]byte) ([]byte, error) Put(k, v []byte) error Has(k []byte) (bool, error) Batch(bool) Batch PutBatch(Batch) error BatchWrite(bool, func(batch Batch) error) error //BatchView(func(batch Batch) error) error Iterator(prefix []byte, end []byte, f func(k, v []byte) error) error Count(prefix []byte) (uint64, error) Purge() error Drop(prefix []byte) error Upgrade(version int) error Action(at ActionType) (interface{}, error) Close() error }
func NewBadgerStore ¶
NewBadgerStore initializes/opens a badger database in the given directory.
Click to show internal directories.
Click to hide internal directories.