exchange

package
v0.0.0-...-de70ca6 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config interface {
	Logger() logging.Logger
	ExchangeBaseURL() string
	ExchangeAPIKey() string
}

Config is the config for Converter

type Converter

type Converter struct {
	// contains filtered or unexported fields
}

Converter will convert the base price to the currency supplied Note: we are expecting sane inputs and therefore skipping input validation

func NewConverter

func NewConverter(cfg Config) *Converter

NewConverter creates and initializes the converter

func (*Converter) Exchange

func (c *Converter) Exchange(ctx context.Context, basePrice float64, currency string) (float64, error)

Exchange will perform the conversion

Jump to

Keyboard shortcuts

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