rate

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDataFormat = errors.New("unexpected data format")

Functions

This section is empty.

Types

type ExchangeRate

type ExchangeRate struct {
	From *currency.Currency
	To   *currency.Currency
	Rate float64
}

type Service

type Service interface {
	Fetch(ctx context.Context, base, to string) (*ExchangeRate, error)
	List(ctx context.Context) ([]*ExchangeRate, error)
}

func NewCachedExchangeRate

func NewCachedExchangeRate(service Service, cache *redis.Client, cfg *config.Config, logger *slog.Logger, currencyService currency.Service) Service

func NewService

func NewService(logger *slog.Logger, cfg *config.Config, currencyService currency.Service) Service

Jump to

Keyboard shortcuts

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