exchange

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2022 License: MIT Imports: 10 Imported by: 0

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)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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