Supporting code for Go Clean article on Medium
- Docker and Docker Compose
- Dep
- Bazel
- GoImports
Make sure GOPATH is set and clone into the correct directory under GOPATH
git clone https://github.com/ubiqueworks/go-clean-architecture.git $GOPATH/src/github.com/ubiqueworks/go-clean-architecture
Go to the root directory of the project.
cd $GOPATH/src/github.com/ubiqueworks/go-clean-architecture
Ensure dependencies
dep ensure
Build the docker images
make package
Run the containers
docker-compose up
Delete the containers
docker-compose down -v
curl -X "POST" "http://localhost:8888/publish" \
-H 'Content-Type: application/json; charset=utf-8' \
-d $'{
"name": "Random Name",
"message": "Necessitatibus magnam animi magnam fuga nihil soluta est quis. Quo dolor sit sit ut quia aspernatur. Porro ut dolores consequatur optio harum et laborum magni. Illum incidunt amet molestias quo vitae. Inventore eos ut dolores deserunt. Ut error ut in est et temporibus."
}'
curl http://localhost:8888/messages | json_pp