payments

command module
v0.0.0-...-b1e0156 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2019 License: MIT Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

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

  • Web server:
    • -http_address string -- Http address for web server running (default "0.0.0.0:8080")
  • Database:
    • -db_address string -- Address to connect to PostgreSQL server (default "localhost:5432")
    • -database string -- PostgreSQL database name (default "payments")
    • -db_user string -- PostgreSQL connection user (default "postgres")
    • -db_password string -- PostgreSQL connection password
    • -pool_size int -- PostgreSQL connection pool size (default 10)
    • -app_name string -- PostgreSQL application name (for logging) (default "payments")
    • -db_log -- Switch for statements logging

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 8099:8080 payments-app --db_address=192.168.0.1:5432 --db_password=${DB_PASSWORD}

How to run tests

go test -race ./...

How to run code linting

golangci-lint run --presets=bugs,complexity,format

How to Contribute

We definitely welcome patches and contribution to this project!

Support

If you do have a contribution to the package, feel free to create a Pull Request or an Issue.

What to contribute

If you don't know what to do, there are some features and functions that need to be done

  • Refactor code
  • Edit docs and README: spellcheck, grammar and typo check
  • Create actual list of contributors and projects that currently using this package
  • Resolve issues and bugs
  • Implement benchmarking
  • Implement batch of examples
  • Look at forks for new features and fixes

Advice

Feel free to create what you want, but keep in mind when you implement new features:

  • Code must be clear and readable, names of variables/constants clearly describes what they are doing
  • Public functions must be documented and described in source file
  • There are must be unit-tests for any new functions and improvements

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package account provides handlers for work with accounts in the system.
Package account provides handlers for work with accounts in the system.
Package db provide PostgreSQL storage for application data repositories.
Package db provide PostgreSQL storage for application data repositories.
Package errs contain types and methods to help in error-handling.
Package errs contain types and methods to help in error-handling.
Package inmem provide in-memory storage for application data repositories.
Package inmem provide in-memory storage for application data repositories.
Package payment provides handlers for work with payments in the system.
Package payment provides handlers for work with payments in the system.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址