Documentation ¶
Index ¶
- type BuyOrder
- type SellOrder
- type Server
- func (s *Server) AddNewUser(username string, startingMoney float64)
- func (s *Server) AddStockPrice(st *stocks.Stock)
- func (s *Server) AddToUserBalance(username string, money float64)
- func (s *Server) AddToUserStockAmount(username string, ticker string, amount int64)
- func (s *Server) BuyStock(username string, ticker string, amount int64)
- func (s *Server) CloseDB()
- func (s *Server) GetCurrentStockPrice(tr string) float64
- func (s *Server) GetStockPrices(st *stocks.Stock) []TimePricePair
- func (s *Server) GetStockPricesByTicker(tr string) []TimePricePair
- func (s *Server) GetUserBalance(username string) float64
- func (s *Server) GetUserBalances() map[string]float64
- func (s *Server) GetUserStockAmount(username string, ticker string) int64
- func (s *Server) GetUserSummaries() map[string](map[string]int64)
- func (s *Server) IsStockPresentForUser(username string, ticker string) bool
- func (s *Server) NewStockTable(st *stocks.Stock)
- func (s *Server) SellStock(username string, ticker string, amount int64)
- func (s *Server) Start()
- type TimePricePair
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct { TickTime time.Duration Ticker *time.Ticker DB *sql.DB Stocks map[string]*stocks.Stock }
func (*Server) AddNewUser ¶
func (*Server) AddStockPrice ¶
func (*Server) AddToUserBalance ¶
func (*Server) AddToUserStockAmount ¶
func (*Server) GetCurrentStockPrice ¶
func (*Server) GetStockPrices ¶
func (s *Server) GetStockPrices(st *stocks.Stock) []TimePricePair
func (*Server) GetStockPricesByTicker ¶
func (s *Server) GetStockPricesByTicker(tr string) []TimePricePair
func (*Server) GetUserBalance ¶
func (*Server) GetUserBalances ¶
func (*Server) GetUserStockAmount ¶
func (*Server) IsStockPresentForUser ¶
func (*Server) NewStockTable ¶
type TimePricePair ¶
Click to show internal directories.
Click to hide internal directories.