app

package
v0.0.0-...-1477443 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	OrderFormInput model.OrderInput
)

Functions

func DBService

func DBService(AddOrUpdateDbChan, GetDbChan, DeleteDbChan chan model.DbData)

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 NewSession

func NewSession() *Session

NewSession returns a new instance of *Session

func (*Session) Authenticate

func (s *Session) Authenticate() *model.User

Authenticate authorises user to access his account

func (*Session) SetWorker

func (s *Session) SetWorker(host string) error

SetWorker sets the worker for the user based on the trading site selected

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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