🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

github.com/xialingxiao/go-example

Package Overview
Dependencies
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/xialingxiao/go-example

Source
Go Modules
Version
v0.0.0-20170828161843-508a1858948d
Version published
Created
Source

Task:

Create a stand alone HTTP service written in Golang that returns the current foreign exchange rates within the hour.

Specifics:

Openexchange to be used as the source of forex data and retrieved rates should be cached for an hour at a time. You are free to use any version of Golang above 1.5.

Endpoints that must be implemented:

All endpoints should return JSON

GET /current_rates

  • Returns the list of latest rates retrieved from Openexchange.

GET /current_rates?currency=<currency_code>

  • Returns the current rate for the desired currency code e.g /current_rates?currency=USD

Things you may need:

  • https://tour.golang.org/welcome/1
  • https://docs.openexchangerates.org/ (you would need to sign up for a free API key)

To run

make run should start the web application at port 8080

To test

make test should test the web application

FAQs

Package last updated on 28 Aug 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts