exchangerateapi

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewExchangeRateAPIProvider

func NewExchangeRateAPIProvider(
	cfg *config.ExchangeRateApi,
	logger *slog.Logger,
) *exchangeRateAPI

NewExchangeRateAPIProvider creates a new ExchangeRate API provider using config

func NewFakeExchangeRate

func NewFakeExchangeRate() *fakeExchangeRate

Types

type ExchangeRateAPIResponseV6

type ExchangeRateAPIResponseV6 struct {
	Result             string             `json:"result"`
	Documentation      string             `json:"documentation"`
	TermsOfUse         string             `json:"terms_of_use"`
	TimeLastUpdateUnix int64              `json:"time_last_update_unix"`
	TimeNextUpdateUnix int64              `json:"time_next_update_unix"`
	TimeNextUpdateUTC  string             `json:"time_next_update_utc"`
	BaseCode           string             `json:"base_code"`
	ConversionRates    map[string]float64 `json:"conversion_rates"`
	// Error fields (if any)
	ErrorType string `json:"error-type,omitempty"`
}

ExchangeRateAPIResponseV6 represents the v6 response from the ExchangeRate API See: https://www.exchangerate-api.com/docs/standard-requests Example: { "result": "success", "documentation": "...", "terms_of_use": "...", "time_last_update_unix": 1585267200, ... }

Jump to

Keyboard shortcuts

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