Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CachedPricer ¶
type CachedPricer struct {
// contains filtered or unexported fields
}
func NewCachedPricer ¶
func NewCachedPricer(p Pricer) *CachedPricer
func (*CachedPricer) ClearCache ¶
func (c *CachedPricer) ClearCache()
type MockPricer ¶
type MockPricer struct {
// contains filtered or unexported fields
}
func NewMockPricer ¶
func NewMockPricer(prices map[Token]float64) *MockPricer
func (*MockPricer) SetPrice ¶
func (m *MockPricer) SetPrice(token Token, price float64)
type Pricer ¶
type Pricer interface { // Price returns the price of each provided token in USD. Price(ctx context.Context, tokens ...Token) (map[Token]float64, error) }
Pricer is the token price provider interface.
type Token ¶
type Token string
func FromCoingeckoID ¶
func MustFromCoingeckoID ¶
func (Token) CoingeckoID ¶
Click to show internal directories.
Click to hide internal directories.