rater

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 8, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCoinGeckoWaitDuration = errors.New("coin gecko wait duration exceeded")
)

Functions

func NewExchangeRateClient

func NewExchangeRateClient(
	assetCurrencySymbolPair map[string]string,
	coinGeckoNumOfCallsPerMin *int,
	coinGeckoRefreshInterval *time.Duration,
	coinGeckoWaitDuration *time.Duration,
) port.RateService

Types

type CoinGeckoService

type CoinGeckoService interface {
	CoinsList() (*types.CoinList, error)
	SimplePrice(ids []string, vsCurrencies []string) (*map[string]map[string]float32, error)
}

func NewCoinGeckoService

func NewCoinGeckoService(httpClient *http.Client) CoinGeckoService

type CryptoCoin

type CryptoCoin struct {
	Id     string `json:"id"`
	Symbol string `json:"symbol"`
	Name   string `json:"name"`
}

type MockCoinGeckoService

type MockCoinGeckoService struct {
	mock.Mock
}

MockCoinGeckoService is an autogenerated mock type for the CoinGeckoService type

func (*MockCoinGeckoService) CoinsList

func (_m *MockCoinGeckoService) CoinsList() (*types.CoinList, error)

CoinsList provides a mock function with given fields:

func (*MockCoinGeckoService) SimplePrice

func (_m *MockCoinGeckoService) SimplePrice(ids []string, vsCurrencies []string) (*map[string]map[string]float32, error)

SimplePrice provides a mock function with given fields: ids, vsCurrencies

type RateResponse

type RateResponse struct {
	Base  string             `json:"base"`
	Date  string             `json:"date"`
	Rates map[string]float64 `json:"rates"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL