An API that provides a small but well-thought service converting Euro to US Dollar and vice-versa

Currency Converter

###Problem An API that provides a small but well-thought service converting Euro to US Dollar and vice-versa. That API should only be accessible if you are in the possession of an API-KEY.

###dependent service To get rates, you can use the free plan of this API: https://fixer.io

###end points

  1. localhost:8000/v1/currency_converter/api_key
  2. localhost:8000/v1/currency_converter/currency/convert?base=EUR&amount=100
  3. localhost:8000/v1/currency_converter/currency/convert?base=USD&amount=100

Run test

make test

Build Code

make build

Run server

docker-compose up or go run main.go or make start-server

Usage

Please Check LaundryList.md for the changes need to be made to enable this code for production.

  1. hit the generate api curl
  2. get the api key and pass it on to convertion api
    1. conversion api takes base, amount and api_key as params
    2. base is the current currency
    3. the result will be in euro if the base is in dollar and the result will be in dollar if the base in eur

###sample curls

  1. Generate API key curl localhost:8000/v1/currency_converter/api_key
    1. response:
      1. {"success":true,"api_key":"XVlBzgbaiCMRAjWwhTHctcuAxhxKQFDa"}
  2. Convert Euro to Dollar
    1. localhost:8000/v1/currency_converter/currency/convert?base=EUR&amount=100&api_key=XVlBzgbaiCMRAjWwhTHctcuAxhxKQFDa
      1. { "success": true, "converted_amount": 111.47890000000001 }
  3. Convert Dollar to Euro
    1. localhost:8000/v1/currency_converter/currency/convert?base=USD&amount=100&api_key=XVlBzgbaiCMRAjWwhTHctcuAxhxKQFDa
      1. { "success": true, "converted_amount": 89.7029933888894 }

breaks taken

  1. 2022-01-30 19:36 +0530 88ef33359b890829cbdd21f98fea6e38cdb3432c 30 min break
  2. 2022-01-30 21:21 +0530 3b8fe805d6edea11536363802d12188e64b7edcc 30 min break
  3. 2022-01-30 22:36 +0530 9a3ed31b60a75d2af72c9bdbf183b799daac5f5d 15 min break
Owner
Akshay Nambiar
knowledge portfolio is my aim
Akshay Nambiar
Similar Resources

go-linereader: A small library for streaming lines from an io.Reader.

go-linereader: A small library for streaming lines from an io.Reader.

Oct 25, 2021

A small & fast dependency-free library for parsing micro expressions.

MicroExpr A small & fast dependency-free library for parsing micro expressions. This library was originally built for use in templating languages (e.g

Nov 25, 2022

Go Small Library

Go Small Library (gosl) Copyright Gon Y. Yi 2021 Goal General No import of any library whatsoever including standard libr

Jan 12, 2022

A small utility to extract your Telegram contacts as VCF file.

Telegram to VCF A small utility to extract your Telegram contacts as VCF file. Usage At first build this application or use the precompiled binaries o

Nov 16, 2022

This is a small utility that finds unused exported Go symbols (functions, methods ...) in Go

This is a small utility that finds unused exported Go symbols (functions, methods ...) in Go. For all other similar use cases

Nov 8, 2022

Small utility to cleanup entries with unexpected/erroneous ttl in redis

Small utility to cleanup entries with unexpected/erroneous ttl in redis

Apr 28, 2022

Small tool for splitting files found in a path into multiple groups

Small tool for splitting files found in a path into multiple groups. Usefull for parallelisation of whatever can be paralleled with multiple files.

Jan 30, 2022

This project provides some working examples using Go and Hotwire Turbo.

hotwire-golang-website This project provides some working examples using Go the hotwire/turbo library published by basecamp.

Dec 29, 2022

Extremely flexible golang deep comparison, extends the go testing package, tests HTTP APIs and provides tests suite

Extremely flexible golang deep comparison, extends the go testing package, tests HTTP APIs and provides tests suite

go-testdeep Extremely flexible golang deep comparison, extends the go testing package. Latest news Synopsis Description Installation Functions Availab

Jan 5, 2023
Support converting Vault Secrets to diffrent formats.

Vault Converter Support converting Vault Secrets to different formats. vault-converter is a tool designed to synchronize variables from local to Vault

Sep 13, 2022
This utility can be used for converting BSE Mutual fund scheme

go-mf-scheme-master-generator This utility can be used for converting BSE Mutual

Jan 21, 2022
A well tested and comprehensive Golang statistics library package with no dependencies.

Stats - Golang Statistics Package A well tested and comprehensive Golang statistics library / package / module with no dependencies. If you have any s

Dec 30, 2022
sigbypass4xx is a utility to automate well-know techniques used to bypass access control restrictions.

sigbypass4xx sigbypass4xx is a utility to automate well-know techniques used to bypass access control restrictions. Resources Usage Installation From

Nov 9, 2022
A set of instrumentation features for collecting relevant tracing data as well as secure an application

Go Agent goagent provides a set of instrumentation features for collecting relevant tracing data as well as secure an application by blocking requests

Dec 21, 2021
Golang io.Reader and io.Writer but with limits

LimitIO io.Reader and io.Writer with limit.

Dec 14, 2022
A program to create assembly 8086 strings to print without using any printing/strings related function but only mov-xchg-int and loops

Assembly String builder tool A program to create assembly 8086 strings to print without using any printing/strings related function but only mov-xchg-

Feb 1, 2022
A collection of small Go utilities to make life easier.

The simplego package provides a collection of Go utilities for common tasks.

Jan 4, 2023
Small utility to allow simpler, quicker testing of parsing files in crowdsec

cs_parser_test Small utility to allow simpler, quicker testing of parsing files in crowdsec Usage $ sudo cs_parser_test -t syslog /var/log/mail.log N

Jul 13, 2021
MNA - stands for mobile number assignment - a small zero external dependency golang library that is used to identify mobile number assignment in tanzania

MNA - stands for mobile number assignment - a small zero external dependency golang library that is used to identify mobile number assignment in tanzania

Nov 29, 2021