Code Monkey home page Code Monkey logo

go-currency's Introduction

This project is REST Full API for managing currency rates, using docker with 2 container first currency-go container for web app second is mysql container for database ,if you want to deploy this app please follow this guide :

Requiretment

  • golang
  • docker
  • mysql

Technical Feature

  • ORM
  • RAW Query (Advanced)
  • Integration Test
  • Docker as Environment

Quick Installation

Manual Installation

  • $ mkdir go-currency
  • $ cd go-currency
  • $ git clone https://github.com/viyancs/go-currency.git .
  • $ cd src
  • $ docker run --name mysqldb -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=test_go -e MYSQL_ROOT_HOST=% -d mysql:5.7 (run mysql container)
  • $ docker build -t viyancs/golang-mysql-api --no-cache=true . (making image)
  • $ docker run -p 8282:8282 --link mysqldb:mysqldb --name currency-go -d viyancs/golang-mysql-api (run web app container that provide http REST API)
  • $ docker exec -ti currency-go sh -c "cd cmd/schema && go build -a -o bintask task.go && ./bintask orm syncdb -force && ./bintask sample" (build and rebuild table with data sample)

API Docs Usage

{"code":200,"results":[{"avg 2 days ago":"90","c_from":"GBP","c_to":"INR","date":"2018-07-25 00:00:00","id":"4","rate":"90.4866"},{"avg 2 days ago":"14750","c_from":"USD","c_to":"IDR","date":"2018-07-25 00:00:00","id":"5","rate":"14750"},{"avg 2 days ago":"1","c_from":"USD","c_to":"GBP","date":"2018-07-25 00:00:00","id":"6","rate":"0.761913"},{"avg 2 days ago":"0","c_from":"USD","c_to":"JPN","date":"2018-07-25 00:00:00","id":"7","rate":"insufficient data"},{"avg 2 days ago":"0","c_from":"JPN","c_to":"GBP","date":"2018-07-25 00:00:00","id":"8","rate":"insufficient data"},{"avg 2 days ago":"130000000","c_from":"BTC","c_to":"IDR","date":"2018-07-25 00:00:00","id":"10","rate":"130000000"}],"msg":"","total":6}
    {
    "code": 200,
    "results": null,
    "msg": "12",
    "total": 0
    }
{
   "code": 200,
   "results": null,
   "msg": "success delete",
   "total": 0
}

go-currency's People

Contributors

viyancs avatar

Watchers

 avatar  avatar

Forkers

xiaoxiaoleng

go-currency's Issues

dailyexchange means ?

LOL, why you get daily exchange from database ? i think daily exchange from API exchange(ex : indodax or bittrex) not from database. haha

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.