Documentation
¶
Overview ¶
You can add custom sources. Please make them as simple as possible There is no need to use caching or repeated requests The exchanger will regulate the number of repeated requests.
Package provider is a generated GoMock package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExchangeRate ¶
type ExchangeRate interface { // Time - date on which the exchange rate was issued Time() time.Time // From USD to EUR => 1USD ~ 1.17EUR From() label.Currency To() label.Currency Rate() float64 }
ExchangeRate represents the exchange rate of a particular currency pair
type MockExchangeRate ¶
type MockExchangeRate struct {
// contains filtered or unexported fields
}
MockExchangeRate is a mock of ExchangeRate interface.
func NewMockExchangeRate ¶
func NewMockExchangeRate(ctrl *gomock.Controller) *MockExchangeRate
NewMockExchangeRate creates a new mock instance.
func (*MockExchangeRate) EXPECT ¶
func (m *MockExchangeRate) EXPECT() *MockExchangeRateMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockExchangeRate) From ¶
func (m *MockExchangeRate) From() label.Currency
From mocks base method.
type MockExchangeRateMockRecorder ¶
type MockExchangeRateMockRecorder struct {
// contains filtered or unexported fields
}
MockExchangeRateMockRecorder is the mock recorder for MockExchangeRate.
func (*MockExchangeRateMockRecorder) From ¶
func (mr *MockExchangeRateMockRecorder) From() *gomock.Call
From indicates an expected call of From.
func (*MockExchangeRateMockRecorder) Rate ¶
func (mr *MockExchangeRateMockRecorder) Rate() *gomock.Call
Rate indicates an expected call of Rate.
func (*MockExchangeRateMockRecorder) Time ¶
func (mr *MockExchangeRateMockRecorder) Time() *gomock.Call
Time indicates an expected call of Time.
func (*MockExchangeRateMockRecorder) To ¶
func (mr *MockExchangeRateMockRecorder) To() *gomock.Call
To indicates an expected call of To.
type MockSource ¶
type MockSource struct {
// contains filtered or unexported fields
}
MockSource is a mock of Source interface.
func NewMockSource ¶
func NewMockSource(ctrl *gomock.Controller) *MockSource
NewMockSource creates a new mock instance.
func (*MockSource) EXPECT ¶
func (m *MockSource) EXPECT() *MockSourceMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockSource) FetchLatest ¶
func (m *MockSource) FetchLatest(ctx context.Context) ([]ExchangeRate, error)
FetchLatest mocks base method.
func (*MockSource) GetExchangeable ¶
func (m *MockSource) GetExchangeable() []label.Symbol
GetExchangeable mocks base method.
type MockSourceMockRecorder ¶
type MockSourceMockRecorder struct {
// contains filtered or unexported fields
}
MockSourceMockRecorder is the mock recorder for MockSource.
func (*MockSourceMockRecorder) FetchLatest ¶
func (mr *MockSourceMockRecorder) FetchLatest(ctx interface{}) *gomock.Call
FetchLatest indicates an expected call of FetchLatest.
func (*MockSourceMockRecorder) GetExchangeable ¶
func (mr *MockSourceMockRecorder) GetExchangeable() *gomock.Call
GetExchangeable indicates an expected call of GetExchangeable.
type Source ¶
type Source interface { // FetchLatest of obtaining the latest exchange rate data FetchLatest(ctx context.Context) ([]ExchangeRate, error) // GetExchangeable declares to give a list of exchangeable currencies GetExchangeable() []label.Symbol }
Source is an interface for getting data from external sources. Source takes care of receiving data, working with proxies and giving back exchange rates