Documentation ¶
Overview ¶
Package crypto package with common coin interface for all crypto related API
Index ¶
- Constants
- type Coin
- type Coinmarketcap
- func (c Coinmarketcap) GetAllCoinData(currency string, limit int) ([]Coin, error)
- func (c Coinmarketcap) GetCoinData(cryptoCurrency string, currency string) ([]Coin, error)
- func (c Coinmarketcap) GetCoinDataByUSD(cryptoCurrency string) ([]Coin, error)
- func (c *Coinmarketcap) SetBaseURL(baseURL string)
- type Crypto
Constants ¶
View Source
const ( DEFAULT_CURRENCY = "USD" DEFAULT_CRYPTO_CURRENCY_ID = "all" DEFAULT_LIMIT = -1 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Coin ¶
type Coin struct { Name string Symbol string Price float64 Currency string Volume24 float64 Maxsupply float64 }
Coin struct
type Coinmarketcap ¶
type Coinmarketcap struct {
// contains filtered or unexported fields
}
Coinmarketcap impliments the Crypto interface Coinmarketcap struct
func NewCoinmarketcap ¶
func NewCoinmarketcap() *Coinmarketcap
NewCoinmarketcap creates new intance It returns the new instance of Coinmarketcap
func (Coinmarketcap) GetAllCoinData ¶
func (c Coinmarketcap) GetAllCoinData(currency string, limit int) ([]Coin, error)
GetAllCoinData returns coins in currency (such as: USD or CAD) and limit
func (Coinmarketcap) GetCoinData ¶
func (c Coinmarketcap) GetCoinData(cryptoCurrency string, currency string) ([]Coin, error)
GetCoinData returns coin by crypocurrency (such as: BTC ETH and currency (such as: USD or CAD)
func (Coinmarketcap) GetCoinDataByUSD ¶
func (c Coinmarketcap) GetCoinDataByUSD(cryptoCurrency string) ([]Coin, error)
GetCoinDataByUSD returns coin by crypocurrency in default currency: USD
func (*Coinmarketcap) SetBaseURL ¶
func (c *Coinmarketcap) SetBaseURL(baseURL string)
SetBaseURL sets baseURL
Click to show internal directories.
Click to hide internal directories.