Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CryptocurrencyData ¶
type CryptocurrencyData struct { Id CryptocurrencyID `json:"id"` Name string `json:"name"` Symbol string `json:"symbol"` Slug string `json:"slug"` CmcRank Rank `json:"cmc_rank,omitempty"` NumMarketPairs int `json:"num_market_pairs"` CirculatingSupply int `json:"circulating_supply"` TotalSupply int `json:"total_supply"` MaxSupply int `json:"max_supply"` LastUpdated time.Time `json:"last_updated"` DateAdded time.Time `json:"date_added"` Tags []string `json:"tags"` Platform interface{} `json:"platform"` Quote Quote `json:"quote"` }
type CryptocurrencyID ¶
type CryptocurrencyID int
type CurrencyQuote ¶
type CurrencyQuote struct { Price float64 `json:"price"` Volume24H float64 `json:"volume_24h"` PercentChange1H float64 `json:"percent_change_1h"` PercentChange24H float64 `json:"percent_change_24h"` PercentChange7D float64 `json:"percent_change_7d"` MarketCap float64 `json:"market_cap"` LastUpdated time.Time `json:"last_updated"` }
type GainersAndLosers ¶
GainersAndLosers represents the gainers and losers data.
func New ¶
func New(c *c.Client) *GainersAndLosers
func (*GainersAndLosers) FetchGainersLosers ¶
func (g *GainersAndLosers) FetchGainersLosers(params *Params) ([]CryptocurrencyData, error)
type Params ¶
type Params struct { Limit *int `json:"limit,omitempty"` TimePeriod *TimePeriod `json:"time_period,omitempty"` Convert *string `json:"convert,omitempty"` ConvertID *int `json:"convert_id,omitempty"` Sort *Sort `json:"sort,omitempty"` SortDir *SortDir `json:"sort_dir,omitempty"` }
Params represents the query parameters for fetching data.
type Quote ¶
type Quote map[string]CurrencyQuote
type Response ¶
type Response struct { Data struct { Data []CryptocurrencyData `json:"data"` Status Status `json:"status"` } `json:"data"` Status Status `json:"status"` }
type TimePeriod ¶
type TimePeriod string
TimePeriod represents the overall window of time for the gainers and losers.
const ( OneHour TimePeriod = "1h" TwentyFourHour TimePeriod = "24h" ThirtyDay TimePeriod = "30d" SevenDay TimePeriod = "7d" )
TimePeriod values represent the overall window of time for the gainers and losers.
Click to show internal directories.
Click to hide internal directories.