services

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: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddressService

type AddressService struct {
	AddressDao *daos.AddressDao
	// contains filtered or unexported fields
}

AddressService struct with daos required, responsible for communicating with daos

func NewAddressService

func NewAddressService(AddressDao *daos.AddressDao, balanceDao *daos.BalanceDao, tokenDao *daos.TokenDao) *AddressService

NewAddressService returns a new instance of addressService

func (*AddressService) Create

func (s *AddressService) Create(Address *types.UserAddress) error

Create validates the address and create wallet for the address

func (*AddressService) GetAll

func (s *AddressService) GetAll() ([]types.UserAddress, error)

GetAll fetches all the address entries in the db

func (*AddressService) GetByAddress

func (s *AddressService) GetByAddress(addr string) (*types.UserAddress, error)

GetByAddress fetches the address's details

func (*AddressService) GetByID

func (s *AddressService) GetByID(id bson.ObjectId) (*types.UserAddress, error)

GetByID fetches the address's details based on its mongoID

type BalanceService

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

func NewBalanceService

func NewBalanceService(balanceDao *daos.BalanceDao, tokenDao *daos.TokenDao) *BalanceService

func (*BalanceService) Create

func (s *BalanceService) Create(balance *types.Balance) error

func (*BalanceService) GetAll

func (s *BalanceService) GetAll() ([]types.Balance, error)

func (*BalanceService) GetByAddress

func (s *BalanceService) GetByAddress(addr string) (*types.Balance, error)

func (*BalanceService) GetByID

func (s *BalanceService) GetByID(id bson.ObjectId) (*types.Balance, error)

type OrderService

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

func NewOrderService

func NewOrderService(orderDao *daos.OrderDao, balanceDao *daos.BalanceDao, pairDao *daos.PairDao, tradeDao *daos.TradeDao) *OrderService

func (*OrderService) Create

func (s *OrderService) Create(order *types.Order) (err error)

func (*OrderService) GetAll

func (s *OrderService) GetAll() ([]types.Order, error)

func (*OrderService) GetByID

func (s *OrderService) GetByID(id bson.ObjectId) (*types.Order, error)

func (*OrderService) GetByUserAddress

func (s *OrderService) GetByUserAddress(address string) ([]*types.Order, error)

func (*OrderService) RelayUpdateOverSocket

func (s *OrderService) RelayUpdateOverSocket(er *engine.EngineResponse)

RelayUpdateOverSocket is responsible for notifying listening clients about new order/trade addition/deletion

func (*OrderService) UpdateUsingEngineResponse

func (s *OrderService) UpdateUsingEngineResponse(er *engine.EngineResponse)

type PairService

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

func NewPairService

func NewPairService(pairDao *daos.PairDao, tokenDao *daos.TokenDao, eng *engine.EngineResource, tradeService *TradeService) *PairService

func (*PairService) Create

func (s *PairService) Create(pair *types.Pair) error

func (*PairService) GetAll

func (s *PairService) GetAll() ([]types.Pair, error)

func (*PairService) GetByID

func (s *PairService) GetByID(id bson.ObjectId) (*types.Pair, error)

func (*PairService) RegisterForOrderBook

func (s *PairService) RegisterForOrderBook(conn *websocket.Conn, pairName string)

type TokenService

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

func NewTokenService

func NewTokenService(tokenDao *daos.TokenDao) *TokenService

func (*TokenService) Create

func (s *TokenService) Create(token *types.Token) error

func (*TokenService) GetAll

func (s *TokenService) GetAll() ([]types.Token, error)

func (*TokenService) GetByID

func (s *TokenService) GetByID(id bson.ObjectId) (*types.Token, error)

type TradeService

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

func NewTradeService

func NewTradeService(TradeDao *daos.TradeDao) *TradeService

func (*TradeService) GetByPairName

func (t *TradeService) GetByPairName(pairName string) ([]*types.Trade, error)

Jump to

Keyboard shortcuts

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