datastore

package
v0.0.0-...-29fd846 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Db *sql.DB

Functions

func GetCurrencies

func GetCurrencies() map[string]int

GetCurrencies generates a hash of currency code and its DB id value

func GetExchangeRates

func GetExchangeRates(date string) map[string]float64

GetExchangeRates returns a hash of converted currency code and their rate for a given date. If the "date" data is missing fetch from the last available date in the DB

func LogAPIRequest

func LogAPIRequest(ip, from, to, date string)

LogAPIRequest logs all API request for future analytics

func SaveExchangeRates

func SaveExchangeRates(date string, exchangeRates map[string]float64) error

SaveCurrencyRates saves exchange rates to the DB

Types

This section is empty.

Jump to

Keyboard shortcuts

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