Prime generator Application
Ubuntu 18.04
This is a golang structure was cloned from https://github.com/golang-standards/project-layout. It is important to have well structured at the beginning of the project, otherwise we will suffer from painful like improper import, etc...
With Go 1.14 Go Modules
are finally ready for production. We should use unless we have a special reason for that.
My current environment is
- MacOS Catalina 10.15.1
- Clang version 11.0.0
- Go 1.14.6
- Docker version 19.03.2, build 6a30dfc
- docker-compose version 1.24.1, build 4667896b
Originally, Build a simple CLI application. Consider using cobra Cobra
a very powerful library to build cli.
secondly, Logging is critical part. Should pay attention first to make sure, We can track our mistake during development. Consider using Logrus
How to build locally
go build github.com/vietnamz/prime-generator/cmd/prime_cal
How to build from local.
./scripts/build.sh
How to build dependencies on clean ubuntu 18.04 linux machine.
./scripts/build-dependencies.sh
How to run.
./bin/prime
How to use docker
at the root folder run below command. docker and docker compose are required.
docker-compose up -d --build
Make sure port 5000 and 5001 are available for use.
AWS Host
http://52.12.23.4/