Skip to content

Concourse Resource providing Euro Exchange Rates via Frankfurter

License

Notifications You must be signed in to change notification settings

suhlig/euro-exchange-rates-resource

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Concourse Resource providing Euro Exchange Rates via Frankfurter

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published