Documentation
¶
Index ¶
- type DataPerTokenAndCurrency
- type DataPoint
- type Manager
- func (pm *Manager) FetchPrice(symbol string, currency string) (float64, error)
- func (pm *Manager) FetchPrices(symbols []string, currencies []string) (map[string]map[string]float64, error)
- func (pm *Manager) GetCachedPrices() DataPerTokenAndCurrency
- func (pm *Manager) GetOrFetchPrices(symbols []string, currencies []string, maxAgeInSeconds int64) (DataPerTokenAndCurrency, error)
- type Provider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataPerTokenAndCurrency ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func (*Manager) FetchPrice ¶
func (*Manager) FetchPrices ¶
func (*Manager) GetCachedPrices ¶
func (pm *Manager) GetCachedPrices() DataPerTokenAndCurrency
func (*Manager) GetOrFetchPrices ¶
func (pm *Manager) GetOrFetchPrices(symbols []string, currencies []string, maxAgeInSeconds int64) (DataPerTokenAndCurrency, error)
Return cached price if present in cache and age is less than maxAgeInSeconds. Fetch otherwise.
Click to show internal directories.
Click to hide internal directories.