An implementation for a Go mocroserivce, which validates whether an IBAN number is valid or not

  • By Mohammad H Nuairat
  • Last update: Apr 21, 2022
  • Comments: 0

RESTful go-iban-validator written in Go

An implementation for a Go mocroserivce, which validates whether an IBAN number is valid or not

Dependencies

  • You are running MacOS or Ubuntu
  • Make sure you have go installed.

Installation

  1. Clone the repo: You can do this using the go get instead of running git clone manually:

    go get github.com/MHzarini/go-iban-validator
  2. Install dependencies by running make deps.

  3. Make sure everything is running properly by running the tests using make test.

  4. Check the configuration file config/config.yaml make chenges if needed.

Running locally

  1. Run using make run-local
  2. If using MacOS, hit Allow when asked "Do you want the application “main” to accept incoming network connections?".

Running on Docker

  1. Run using make docker to create and build your container with the tag docker-go-iban-validator
  2. Run using make run

Local Development

You can test the API after running the project with the following CURL

curl --location --request POST 'http://localhost:9090/' \
--data-raw '{
    "iban": "SI56 1910 0000 0123 438"
}'

Note

This code was build as a Programming Assignment for a Backend Engineer position

Download

go-iban-validator.zip