/task1

Primary LanguageGo

Payments

Table of Contents

Project purpose

Payment system, provides ability to transfer money between accounts.

System also provide reports:

  • all registered accounts;
  • all registered payments (transfers).

API Documentation see here

Usage

Command-line flags

Running locally

To run project locally with docker-compose use:

docker-compose up

This command will create .env file from .env.dist and start Docker cluster with following components:

Dependencies

  • go-kit -- toolkit for building microservices, recommended by design;
  • govalidator -- package of validators and sanitizers for strings, numerical, slices and structures;
  • decimal -- arbitrary-precision fixed-point decimal numbers in go;
  • uuid -- go package for UUIDs based on RFC 4122 and DCE 1.1;
  • gorilla/mux -- a powerful HTTP router and URL matcher for building Go web servers;
  • prometheus client -- prometheus instrumentation library for Go applications;
  • go-cmp -- package for comparing Go values in tests;
  • go-pg -- golang ORM with focus on PostgreSQL features and performance.

How to set up

Step 1. Build docker image

 docker build -t payments-app .

Step 2. Run it

docker run --rm -p 8080:8080 payments-app --db_address=${DB_ADDR} --db_password=${DB_PASSWORD}