repo

package
v0.0.0-...-3ef2293 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type ExchangeRateDTO

type ExchangeRateDTO struct {
	BaseCurrencyCode   string    `json:"base_currency_code"`
	TargetCurrencyCode string    `json:"target_currency_code"`
	ExchangeRate       float64   `json:"exchange_rate"`
	CreatedAt          time.Time `json:"created_at"`
	UpdatedAt          time.Time `json:"updated_at"`
}

type ExchangeRateHistoryDTO

type ExchangeRateHistoryDTO struct {
	BaseCurrencyCode   string    `json:"base_currency_code"`
	TargetCurrencyCode string    `json:"target_currency_code"`
	Rate               float64   `json:"exchange_rate"`
	Timestamp          time.Time `json:"timestamp"`
}

type ExchangeRateHistoryRepository

type ExchangeRateHistoryRepository interface {
	InsertRateHistory(ctx context.Context, baseCurrency string, targetCurrency string, exchangeRate float64) error
	GetRateHistory(ctx context.Context, baseCurrency string, targetCurrency string, startTime time.Time, endTime time.Time) ([]ExchangeRateHistoryDTO, error)
}

func NewExchangeRateHistoryRepository

func NewExchangeRateHistoryRepository(db *db.Database) ExchangeRateHistoryRepository

type ExchangeRateRepository

type ExchangeRateRepository interface {
	GetSupportedCurrencies(ctx context.Context) ([]string, error)
	GetExchangeRate(ctx context.Context, baseCurrency string, targetCurrent string) (*ExchangeRateDTO, error)
	UpdateExchangeRates(ctx context.Context, baseCurrency string, rates map[string]float64) error
}

func NewExchangeRateRepository

func NewExchangeRateRepository(db *db.Database) ExchangeRateRepository

type UserRepository

type UserRepository interface{}

func NewUserRepository

func NewUserRepository(db *db.Database) UserRepository

Jump to

Keyboard shortcuts

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