Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/suhlig/euro-exchange-rates-resource
Concourse Resource providing Euro Exchange Rates via Frankfurter
https://github.com/suhlig/euro-exchange-rates-resource
concourse currency-exchange-rates frankfurter-api resource
Last synced: 18 days ago
JSON representation
Concourse Resource providing Euro Exchange Rates via Frankfurter
- Host: GitHub
- URL: https://github.com/suhlig/euro-exchange-rates-resource
- Owner: suhlig
- License: mit
- Created: 2024-01-22T13:33:47.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-01-24T17:54:21.000Z (10 months ago)
- Last Synced: 2024-06-19T14:45:27.372Z (5 months ago)
- Topics: concourse, currency-exchange-rates, frankfurter-api, resource
- Language: Go
- Homepage:
- Size: 3.4 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
- License: LICENSE
Awesome Lists containing this project
README
# Euro Exchange Rates Resource
This is an example resource for the [concourse-resource-go](https://github.com/suhlig/concourse-resource-go) interface. It fetches currency exchange rates from the European Central Bank via [Frankfurter](https://github.com/hakanensari/frankfurter).
# Development
## Check
Native:
```command
$ jo -d . source.verbose=true source.url=https://api.frankfurter.app | go run . check
```Docker:
```command
$ jo -d . source.verbose=true source.url=https://api.frankfurter.app | docker run --rm -i euro-exchange-rates-resource /opt/resource/check
```## Get
Native:
```command
$ 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:
```command
$ 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:
```command
$ 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:
```command
$ 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](https://github.com/shopspring/decimal) or store everything in microcents.