converter

package
v1.13.3 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package converter provides functionality for converting money from currency to currency.

Index

Constants

This section is empty.

Variables

View Source
var ErrCurrencyNotSet = errors.New("currency not set")

ErrCurrencyNotSet returned when currency code for conversion not set.

Functions

This section is empty.

Types

type Converter

type Converter interface {
	Convert(ctx context.Context, m models.Money, toCurrency string, date time.Time) (Response, error)
}

Converter is a converter of money from one currency to another.

func NewConverter

func NewConverter(client nbggovge.Client) Converter

NewConverter constructor.

type Response

type Response struct {
	models.Money
	Rate float64
}

Response of conversion.

Jump to

Keyboard shortcuts

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