euro-exchange-rates-resource

command module
v0.0.0-...-a220720 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: MIT Imports: 5 Imported by: 0

README

Euro Exchange Rates Resource

This is an example resource for the concourse-resource-go interface. It fetches currency exchange rates from the European Central Bank via Frankfurter.

Development

Check

Native:

$ jo -d . source.verbose=true source.url=https://api.frankfurter.app | go run . check

Docker:

$ jo -d . source.verbose=true source.url=https://api.frankfurter.app | docker run --rm -i euro-exchange-rates-resource /opt/resource/check

Get

Native:

$ jo -d . source.verbose=true source.url=https://api.frankfurter.app 'source.currencies[]=SEK' 'source.currencies[]=USD' version.date=2024-01-15 | go run . get $(mktemp -d)

Get what check discovered:

$ jo -d . source.verbose=true source.url=https://api.frankfurter.app 'source.currencies[]=SEK' 'source.currencies[]=USD' version=$(
  jo -d . source.verbose=true source.url=https://api.frankfurter.app 'source.currencies[]=SEK' 'source.currencies[]=USD' | go run . check
) \
  | jq '.version=.version[0]' \
  | go run . get $(mktemp -d)

Docker:

$ jo -d . source.verbose=true source.url=https://api.frankfurter.app 'source.currencies[]=SEK' 'source.currencies[]=USD' version=$(
  jo -d . source.verbose=true source.url=https://api.frankfurter.app 'source.currencies[]=SEK' 'source.currencies[]=USD' | docker run --rm -i euro-exchange-rates-resource /opt/resource/check
) \
  | jq '.version=.version[0]' \
  | docker run --rm -i euro-exchange-rates-resource /opt/resource/in /tmp

Build

Until we have CI:

$ DOCKER_DEFAULT_PLATFORM=linux/amd64 docker build . -t suhligibm/euro-exchange-rates-resource
$ docker push suhligibm/euro-exchange-rates-resource:latest

TODO

  • float32 is not ideal for money. Consider shopspring/decimal or store everything in microcents.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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