/account-lib

This Go client library abstract an Account HTTP API

Primary LanguageGoBSD 2-Clause "Simplified" LicenseBSD-2-Clause

account-lib

GitHub go.mod Go version license

TL;DR:

make compose-test

Prerequisites

Docker Docker-compose GNU Make GNU Bash

Table of Contents

About The Project

This Go client library abstract an Account HTTP API that is simulated using this docker-compose. Aiming to be simple as possible, this project follows the same structure as decimal library. It also applies the patterns found in Uber Style Guide. This guide has useful insights about of writing Go code in general.

Testing

This project has one hundred percentage of code coverage. It could be checked with the following commands:

Unit tests

make unit-test

It will run unit tests in the local environment. It is necessary to have Go installed.

Integration tests

make it-test

It will run integration tests in the local environment. It is necessary to have Go installed and run dependencies. See make and make install.

All tests

make test

This is going to apply fmt and run both unit and integration tests.

Setup Local Environment

Build application and run tests in a containerized environment is the easy way to run it isolated from environment noise. Although this is quite useful, sometimes is necessary debug the application or even debug an integration test. In this case, run the follow command pipeline:

./configure && make && make install

configure script will certificate that your environment is able to assemble the application locally. make target will assemble the application with go build running go vet, go fmt and go lint before it. For the last, make install will run docker-compose with all dependencies.

Documentation

This library has the basic documentation for use it, to see it in your browser:

make doc

Open your browser, it will be running in localhost address at 6060 TCP port.

Clean

To remove all docker containers downloaded and installed by this project, run:

make clean

This script will run clean.sh which is a basic shell script with a couple of docker commands.