converter

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

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 struct {
	// contains filtered or unexported fields
}

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

func NewConverter

func NewConverter(client nbggovge.Client) *Converter

NewConverter constructor.

func (Converter) Convert

func (c Converter) Convert(ctx context.Context, m models.Money, to string, date time.Time) (Response, error)

Convert converts amount from currency to with rates according to passed date.

func (Converter) ConvertToGel

func (c Converter) ConvertToGel(ctx context.Context, m models.Money, date time.Time) (Response, error)

ConvertToGel shortcut for Convert to GEL.

type Response

type Response struct {
	models.Money
}

Response of conversion.

Jump to

Keyboard shortcuts

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