Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSubscribeRatesResponse ¶
func NewSubscribeRatesResponse(currency string, currencyRate rate.CurrencyRate) *ferprpc.SubscribeRatesResponse
Types ¶
type Exchange ¶
type Exchange interface { GetRate(currency string) (*rate.CurrencyRate, error) Start(shutdownCtx context.Context, waitGroup *sync.WaitGroup) SubscribeRates(cancelCtx context.Context) chan *rate.CurrencyRate }
func NewService ¶
func NewService() Exchange
type ExchangeService ¶
type ExchangeService struct {
// contains filtered or unexported fields
}
func (*ExchangeService) GetRate ¶
func (s *ExchangeService) GetRate(currency string) (*rate.CurrencyRate, error)
func (*ExchangeService) Start ¶
func (s *ExchangeService) Start(shutdownCtx context.Context, waitGroup *sync.WaitGroup)
func (*ExchangeService) SubscribeRates ¶
func (s *ExchangeService) SubscribeRates(cancelCtx context.Context) chan *rate.CurrencyRate
type RateHandler ¶
type RateHandler func(currency string, currencyRate rate.CurrencyRate)
Click to show internal directories.
Click to hide internal directories.