Documentation ¶
Overview ¶
Package cmd implements methods for getting latest rates for crypto-currencies.
Index ¶
- func Contains(array []string, x string) bool
- func GetCoinConvertURL(coin, fiat string) (string, error)
- func GetCoinRate(code, fiat string, result *[]CryptoCurrency, wg *sync.WaitGroup, ...)
- func GetCoinURL(coin string) (string, error)
- func PrettyShow(result []CryptoCurrency, fiat string)
- func Run()
- type CoinChange
- type CoinConvert
- type CryptoCurrency
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCoinConvertURL ¶
GetCoinConvertURL returns REST JSON API URL of convertation specified coin into fiat.
func GetCoinRate ¶
func GetCoinRate(code, fiat string, result *[]CryptoCurrency, wg *sync.WaitGroup, mutex *sync.Mutex)
GetCoinRate returns rate of specified coin.
func GetCoinURL ¶
GetCoinURL returns REST JSON API URL of specified currency rate.
func PrettyShow ¶
func PrettyShow(result []CryptoCurrency, fiat string)
PrettyShow prints rates coins color, depending on their rates.
Types ¶
type CoinChange ¶
CoinChange parses json response from third party REST JSON API.
type CoinConvert ¶
type CoinConvert struct { Currency string `json:"currency"` Result interface{} `json:"result"` Coin string `json:"coin"` }
CoinConvert pareses json response from third party REST JSON API.
type CryptoCurrency ¶
type CryptoCurrency struct { Name string Price string `json:"price"` Change CoinChange `json:"change"` }
CryptoCurrency for third party REST JSON API.
Click to show internal directories.
Click to hide internal directories.