daos

package
v0.0.0-...-8768773 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

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) Create

func (dao *BalanceDao) Create(balance *types.Balance) (err error)

func (*BalanceDao) GetAll

func (dao *BalanceDao) GetAll() (response []types.Balance, err error)

func (*BalanceDao) GetByAddress

func (dao *BalanceDao) GetByAddress(addr string) (response *types.Balance, err error)

func (*BalanceDao) GetByID

func (dao *BalanceDao) GetByID(id bson.ObjectId) (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) Create

func (d *Database) Create(dbName, collection string, data ...interface{}) (err error)

func (*Database) Get

func (d *Database) Get(dbName, collection string, query interface{}, offset, limit int, response interface{}) (err error)

func (*Database) GetByID

func (d *Database) GetByID(dbName, collection string, id bson.ObjectId, response interface{}) (err error)

func (*Database) GetWithSort

func (d *Database) GetWithSort(dbName, collection string, query interface{}, sort []string, offset, limit int, response interface{}) (err error)

func (*Database) Update

func (d *Database) Update(dbName, collection string, query interface{}, update interface{}) (err error)

type OrderDao

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

func NewOrderDao

func NewOrderDao() *OrderDao

func (*OrderDao) Create

func (dao *OrderDao) Create(order *types.Order) (err error)

func (*OrderDao) GetAll

func (dao *OrderDao) GetAll() (response []types.Order, err error)

func (*OrderDao) GetByID

func (dao *OrderDao) GetByID(id bson.ObjectId) (response *types.Order, err error)

func (*OrderDao) GetByUserAddress

func (dao *OrderDao) GetByUserAddress(addr string) (response []*types.Order, err error)

func (*OrderDao) Update

func (dao *OrderDao) Update(id bson.ObjectId, order *types.Order) (response []types.Order, err error)

type PairDao

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

func NewPairDao

func NewPairDao() *PairDao

func (*PairDao) Create

func (dao *PairDao) Create(pair *types.Pair) (err error)

func (*PairDao) GetAll

func (dao *PairDao) GetAll() (response []types.Pair, err error)

func (*PairDao) GetByID

func (dao *PairDao) GetByID(id bson.ObjectId) (response *types.Pair, err error)

func (*PairDao) GetByName

func (dao *PairDao) GetByName(name string) (response *types.Pair, err error)

type TokenDao

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

func NewTokenDao

func NewTokenDao() *TokenDao

func (*TokenDao) Create

func (dao *TokenDao) Create(token *types.Token) (err error)

func (*TokenDao) GetAll

func (dao *TokenDao) GetAll() (response []types.Token, err error)

func (*TokenDao) GetByID

func (dao *TokenDao) GetByID(id bson.ObjectId) (response *types.Token, err error)

type TradeDao

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

func NewTradeDao

func NewTradeDao() *TradeDao

func (*TradeDao) Create

func (dao *TradeDao) Create(trades ...*types.Trade) (err error)

func (*TradeDao) GetAll

func (dao *TradeDao) GetAll() (response []types.Trade, err error)

func (*TradeDao) GetByID

func (dao *TradeDao) GetByID(id bson.ObjectId) (response *types.Trade, err error)

func (*TradeDao) GetByPairName

func (dao *TradeDao) GetByPairName(name string) (response []*types.Trade, err error)

func (*TradeDao) Update

func (dao *TradeDao) Update(id bson.ObjectId, trade *types.Trade) (response []types.Trade, err error)

Jump to

Keyboard shortcuts

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