Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrClient = errs.Class("Client")
ErrClient is an error class for coinmarketcap API client error.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is used to query the coinmarketcap API for the STORJ token price. implements tokenprice.Client interface.
func (*Client) GetLatestPrice ¶
GetLatestPrice gets the latest available ticker price. todo - verify fields in status, and add alerts.
type Config ¶
type Config struct { BaseURL string `help:"base URL for ticker price API" default:"https://pro-api.coinmarketcap.com" testDefault:"$TESTBASEURL"` APIKey string `help:"API Key used to access coinmarketcap" default:"" testDefault:"$TESTAPIKEY"` Timeout time.Duration `help:"coinmarketcap API response timeout" default:"10s" testDefault:"$TESTTIMEOUT"` }
Config holds coinmarketcap configuration.
type TestClient ¶
type TestClient struct{}
TestClient implements the Client interface for test purposes (bypassing coinmarketcap 3rd party api calls).
func NewTestClient ¶
func NewTestClient() *TestClient
NewTestClient returns a new test token price client.
func (*TestClient) GetLatestPrice ¶
GetLatestPrice gets the latest available ticker price.
Click to show internal directories.
Click to hide internal directories.