Documentation
¶
Index ¶
- type Article
- type CryptoService
- func (t *CryptoService) History(request *HistoryRequest) (*HistoryResponse, error)
- func (t *CryptoService) News(request *NewsRequest) (*NewsResponse, error)
- func (t *CryptoService) Price(request *PriceRequest) (*PriceResponse, error)
- func (t *CryptoService) Quote(request *QuoteRequest) (*QuoteResponse, error)
- type HistoryRequest
- type HistoryResponse
- type NewsRequest
- type NewsResponse
- type PriceRequest
- type PriceResponse
- type QuoteRequest
- type QuoteResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CryptoService ¶
type CryptoService struct {
// contains filtered or unexported fields
}
func NewCryptoService ¶
func NewCryptoService(token string) *CryptoService
func (*CryptoService) History ¶
func (t *CryptoService) History(request *HistoryRequest) (*HistoryResponse, error)
Returns the history for the previous close
func (*CryptoService) News ¶
func (t *CryptoService) News(request *NewsRequest) (*NewsResponse, error)
Get news related to a currency
func (*CryptoService) Price ¶
func (t *CryptoService) Price(request *PriceRequest) (*PriceResponse, error)
Get the last price for a given crypto ticker
func (*CryptoService) Quote ¶
func (t *CryptoService) Quote(request *QuoteRequest) (*QuoteResponse, error)
Get the last quote for a given crypto ticker
type HistoryRequest ¶
type HistoryRequest struct {
// the crypto symbol e.g BTCUSD
Symbol string `json:"symbol"`
}
type HistoryResponse ¶
type HistoryResponse struct {
// the close price
Close float64 `json:"close"`
// the date
Date string `json:"date"`
// the peak price
High float64 `json:"high"`
// the low price
Low float64 `json:"low"`
// the open price
Open float64 `json:"open"`
// the crypto symbol
Symbol string `json:"symbol"`
// the volume
Volume float64 `json:"volume"`
}
type NewsRequest ¶
type NewsRequest struct {
// cryptocurrency ticker to request news for e.g BTC
Symbol string `json:"symbol"`
}
type NewsResponse ¶
type PriceRequest ¶
type PriceRequest struct {
// the crypto symbol e.g BTCUSD
Symbol string `json:"symbol"`
}
type PriceResponse ¶
type QuoteRequest ¶
type QuoteRequest struct {
// the crypto symbol e.g BTCUSD
Symbol string `json:"symbol"`
}
type QuoteResponse ¶
type QuoteResponse struct {
// the asking price
AskPrice float64 `json:"askPrice"`
// the ask size
AskSize float64 `json:"askSize"`
// the bidding price
BidPrice float64 `json:"bidPrice"`
// the bid size
BidSize float64 `json:"bidSize"`
// the crypto symbol
Symbol string `json:"symbol"`
// the UTC timestamp of the quote
Timestamp string `json:"timestamp"`
}
Click to show internal directories.
Click to hide internal directories.