fx

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

fx does Foreign Exchange / currency conversions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FX

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

FX represents the currency coversion (Foreign Exchange) package.

func New

func New(o Opt) *FX

New returns an instace of the FX converter.

func (*FX) Dump

func (fx *FX) Dump() ([]byte, error)

Dump produces a gob dump of the cached data.

func (*FX) Load

func (fx *FX) Load(b []byte) error

Load loads a gob dump of cached data.

func (*FX) Query

func (fx *FX) Query(q string) ([]string, error)

Query handles a currency rate conversion query. Format: 100USD-INR.FX

type Opt

type Opt struct {
	RefreshInterval time.Duration `json:"refresh_interval"`
}

Opt represents the config options for the FX converter.

Jump to

Keyboard shortcuts

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