Documentation
¶
Index ¶
- Constants
- func GetCurrencyID() string
- func GetFavourites() map[string]bool
- func GetPortfolio() map[string]float64
- func LoopTick(ctx context.Context, t time.Duration, action func(errChan chan error)) error
- func MaxFloat64(a ...float64) float64
- func MinFloat64(a ...float64) float64
- func RoundValues(num1, num2 float64) ([]float64, string)
- func SaveMetadata(favourites map[string]bool, currency string, portfolio map[string]float64) error
- func SortData(data [][]string, sortIdx int, sortAsc bool, sortCase string)
- type AllCurrencyData
- type Currency
- type Metadata
Constants ¶
const ( // UpArrow provides the symbol for increase UpArrow = "▲" // DownArrow provides the symbol for decrease DownArrow = "▼" )
Variables ¶
This section is empty.
Functions ¶
func GetCurrencyID ¶ added in v1.0.1
func GetCurrencyID() string
GetCurrencyID returns the currencyID stored from metadata
func GetFavourites ¶
GetFavourites reads stored favourite coin details from ~/.cryptgo-data.json and returns a map.
func GetPortfolio ¶
GetPortfolio reads stored portfolio details from ~/.cryptgo-data.json and returns a map.
func LoopTick ¶
LoopTick runs a given action in a loop in periods of 't' duration. It exits when the context is cancelled
func MaxFloat64 ¶
MaxFloat64 returns maximum float from a given number of floats
func MinFloat64 ¶
MinFloat64 returns minimum float from a given number of floats
func RoundValues ¶
RoundValues rounds off a pair of given floats to Thousands (kilo), Millions (mega) or Billions (giga).
func SaveMetadata ¶
SaveMetadata exports favourites, currency and portfolio to disk. Data is saved on ~/.cryptgo-data.json
Types ¶
type AllCurrencyData ¶
AllCurrencyData holds data of a group of currencies fetched from CoinCap