Documentation ¶
Index ¶
Constants ¶
View Source
const ( ErrTickerForExchangeNotFound = "Ticker for exchange does not exist." ErrPrimaryCurrencyNotFound = "Error primary currency for ticker not found." ErrSecondaryCurrencyNotFound = "Error secondary currency for ticker not found." Spot = "SPOT" )
Const values for the ticker package
Variables ¶
View Source
var (
Tickers []Ticker
)
Vars for the ticker package
Functions ¶
func FirstCurrencyExists ¶
func FirstCurrencyExists(exchange string, currency pair.CurrencyItem) bool
FirstCurrencyExists checks to see if the first currency of the Price map exists
func ProcessTicker ¶
func ProcessTicker(exchangeName string, p pair.CurrencyPair, tickerNew Price, tickerType string)
ProcessTicker processes incoming tickers, creating or updating the Tickers list
func SecondCurrencyExists ¶
func SecondCurrencyExists(exchange string, p pair.CurrencyPair) bool
SecondCurrencyExists checks to see if the second currency of the Price map exists
Types ¶
type Price ¶
type Price struct { Pair pair.CurrencyPair `json:"Pair"` CurrencyPair string `json:"CurrencyPair"` Last float64 `json:"Last"` High float64 `json:"High"` Low float64 `json:"Low"` Bid float64 `json:"Bid"` Ask float64 `json:"Ask"` Volume float64 `json:"Volume"` PriceATH float64 `json:"PriceATH"` }
Price struct stores the currency pair and pricing information
type Ticker ¶
type Ticker struct { Price map[pair.CurrencyItem]map[pair.CurrencyItem]map[string]Price ExchangeName string }
Ticker struct holds the ticker information for a currency pair and type
func CreateNewTicker ¶
func CreateNewTicker(exchangeName string, p pair.CurrencyPair, tickerNew Price, tickerType string) Ticker
CreateNewTicker creates a new Ticker
func GetTickerByExchange ¶
GetTickerByExchange returns an exchange Ticker
func (*Ticker) PriceToString ¶
func (t *Ticker) PriceToString(p pair.CurrencyPair, priceType, tickerType string) string
PriceToString returns the string version of a stored price field
Click to show internal directories.
Click to hide internal directories.