migration

package
v0.0.0-...-2d1ab9f Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SupportedCurrencies = []string{
		"USD",
		"EUR",
		"JPY",
		"GBP",
		"CNY",
		"CAD",
		"AUD",
		"CHF",
		"HKD",
		"SEK",
		"SGD",
		"PLN",
		"NOK",
		"DKK",
		"NZD",
		"MXN",
		"CZK",
		"ZAR",
		"HUF",
		"THB",
		"SAR",
		"ILS",
		"RUB",
		"TRY",
	}
)

Functions

func Migrate

func Migrate(ctx context.Context, pool *pgxpool.Pool) (result error)

Types

type ExchangeRatesManager

type ExchangeRatesManager interface {
	PopulateCurrencies(ctx context.Context) error
	PopulateHistoricalRates(context.Context, HistoricalExchangeRatesPeriod) error
	PopulateMissingExchangeRates(context.Context) error
}

func NewExchangeRatesManager

func NewExchangeRatesManager(currencyAPIKey string, pool *pgxpool.Pool) ExchangeRatesManager

type HistoricalExchangeRatesPeriod

type HistoricalExchangeRatesPeriod string
const (
	Full   HistoricalExchangeRatesPeriod = "full"
	Latest HistoricalExchangeRatesPeriod = "latest"
)

Jump to

Keyboard shortcuts

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