Giter Site home page Giter Site logo

gofinalproject's Introduction

Go final project

Table of content

  1. Getting started
  2. Running
  3. End point
  4. Testing
  5. Copyright

Getting started

Requirement

  • Docker >= 20.10

Instructions

Clone the repository

git clone https://github.com/BagardHugo/GoFinalProject.git

You need to install docker first. Docker is available on linux and MacOs and Windows ( using Docker Desktop).

Running

Run with docker compose

docker-compose up

This command will create 3 docker container

  1. database
  2. Api
  3. Mock external Api

Stop docker compose

If you need to stop the containers:

docker-compose down

Call endpoint

The endpoint is exposed on the port 5001 :

http://localhost:5001/

The only method supported is POST

Header to provide :

Content-Type : application/json

Example of body :

{
    "username" : "Hugo",
    "password" : "myComplexPassword",
    "pin_code" : "123456"
}

Response

Success

This endpoint will successfully respond with a body like :

{
    "Id": 1,
    "username": "hugo",
    "password": "myComplexPassword",
    "pincode": "123456",
    "account": {
        "id": 1,
        "wallet_address": "829beafe-96c7-46dd-ae5f-0d35858dda8b",
        "currency_code": "ETH",
        "currency_balance": "0"
    }
}

Error

This endpoint will respond with an error body like :

{
    "error": "The error message"
}

Testing

For run unit test, execute command :

go test -v

Benchmark

For run benchmark test, execute command :

go test -bench .

Copyright

No copyright for this project :)

gofinalproject's People

Contributors

bagardhugo avatar

Watchers

 avatar

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.