Documentation ¶
Index ¶
- func InitSession() error
- type AddressDao
- func (dao *AddressDao) Create(address *types.UserAddress) (err error)
- func (dao *AddressDao) GetAll() (response []types.UserAddress, err error)
- func (dao *AddressDao) GetByAddress(addr string) (response *types.UserAddress, err error)
- func (dao *AddressDao) GetByID(id bson.ObjectId) (response *types.UserAddress, err error)
- type BalanceDao
- func (dao *BalanceDao) Create(balance *types.Balance) (err error)
- func (dao *BalanceDao) GetAll() (response []types.Balance, err error)
- func (dao *BalanceDao) GetByAddress(addr string) (response *types.Balance, err error)
- func (dao *BalanceDao) GetByID(id bson.ObjectId) (response *types.Balance, err error)
- func (dao *BalanceDao) UpdateAmount(address string, token string, amount *types.TokenBalance) (err error)
- type Database
- func (d *Database) Create(dbName, collection string, data ...interface{}) (err error)
- func (d *Database) Get(dbName, collection string, query interface{}, offset, limit int, ...) (err error)
- func (d *Database) GetByID(dbName, collection string, id bson.ObjectId, response interface{}) (err error)
- func (d *Database) GetWithSort(dbName, collection string, query interface{}, sort []string, offset, limit int, ...) (err error)
- func (d *Database) Update(dbName, collection string, query interface{}, update interface{}) (err error)
- type OrderDao
- func (dao *OrderDao) Create(order *types.Order) (err error)
- func (dao *OrderDao) GetAll() (response []types.Order, err error)
- func (dao *OrderDao) GetByID(id bson.ObjectId) (response *types.Order, err error)
- func (dao *OrderDao) GetByUserAddress(addr string) (response []*types.Order, err error)
- func (dao *OrderDao) Update(id bson.ObjectId, order *types.Order) (response []types.Order, err error)
- type PairDao
- type TokenDao
- type TradeDao
- func (dao *TradeDao) Create(trades ...*types.Trade) (err error)
- func (dao *TradeDao) GetAll() (response []types.Trade, err error)
- func (dao *TradeDao) GetByID(id bson.ObjectId) (response *types.Trade, err error)
- func (dao *TradeDao) GetByPairName(name string) (response []*types.Trade, err error)
- func (dao *TradeDao) Update(id bson.ObjectId, trade *types.Trade) (response []types.Trade, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitSession ¶
func InitSession() error
Types ¶
type AddressDao ¶
type AddressDao struct {
// contains filtered or unexported fields
}
func NewAddressDao ¶
func NewAddressDao() *AddressDao
func (*AddressDao) Create ¶
func (dao *AddressDao) Create(address *types.UserAddress) (err error)
func (*AddressDao) GetAll ¶
func (dao *AddressDao) GetAll() (response []types.UserAddress, err error)
func (*AddressDao) GetByAddress ¶
func (dao *AddressDao) GetByAddress(addr string) (response *types.UserAddress, err error)
func (*AddressDao) GetByID ¶
func (dao *AddressDao) GetByID(id bson.ObjectId) (response *types.UserAddress, err error)
type BalanceDao ¶
type BalanceDao struct {
// contains filtered or unexported fields
}
func NewBalanceDao ¶
func NewBalanceDao() *BalanceDao
func (*BalanceDao) GetByAddress ¶
func (dao *BalanceDao) GetByAddress(addr string) (response *types.Balance, err error)
func (*BalanceDao) UpdateAmount ¶
func (dao *BalanceDao) UpdateAmount(address string, token string, amount *types.TokenBalance) (err error)
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
var DB *Database
func (*Database) GetWithSort ¶
type OrderDao ¶
type OrderDao struct {
// contains filtered or unexported fields
}
func NewOrderDao ¶
func NewOrderDao() *OrderDao
func (*OrderDao) GetByUserAddress ¶
type PairDao ¶
type PairDao struct {
// contains filtered or unexported fields
}
func NewPairDao ¶
func NewPairDao() *PairDao
type TokenDao ¶
type TokenDao struct {
// contains filtered or unexported fields
}
func NewTokenDao ¶
func NewTokenDao() *TokenDao
type TradeDao ¶
type TradeDao struct {
// contains filtered or unexported fields
}
func NewTradeDao ¶
func NewTradeDao() *TradeDao
func (*TradeDao) GetByPairName ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.