Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
OrderFormInput model.OrderInput
)
Functions ¶
func GetBalance ¶
func GetBalance(gtc chan apiData)
func GetTicker ¶
func GetTicker(gtc chan apiData)
GetTicker() takes in a channel(gtc) which provides a channel of float64 (tickerChan) It provides the ticker price via a function that interacts with the API Then sends the ticker price back to the caller of the function (HANLDER) through the tickerChan
func PlaceOrder ¶
func PlaceOrder(gtc chan apiData)
Types ¶
type AppHandler ¶
type AppHandler struct {
// contains filtered or unexported fields
}
AppHandler contains the chi mux and session and implements the http.ServeMux method, thus making it a handler
func NewAppHandler ¶
func NewAppHandler(s *Session) AppHandler
NewAppHandler returns a new instance of *AppHandler
func (AppHandler) ServeHTTP ¶
func (h AppHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
AppHandler implements ServeHTTP method making it a Handler
type Session ¶
type Session struct {
GetTickerChan chan apiData
GetBalanceChan chan apiData
PlaceOrderChan chan apiData
AddOrUpdateDbChan chan model.DbData
GetDbChan chan model.DbData
// contains filtered or unexported fields
}
Session carries the state parameters of a particular user
func (*Session) Authenticate ¶
Authenticate authorises user to access his account
Click to show internal directories.
Click to hide internal directories.