This is an example project to show how to setup a simple go server that produces either a webpage or an API endpoint of data. Currently data is generated with mockaroo and that data is stored in a CSV file under data, this information is stored in a slice for quick access of in memory data.
- Metrics Exposure and scrapping via prometheus server
- Logging via file and injection pipeline with FileBeat, Elastic, and Kibana
- Tracing with jaeger and opentracing
- Kubernetes deployment example
- Routing on 404 and home redirect
- CRUD actions for mock user data
- Streamline Main Server and Router setup
- Add config file based startup sequence
The specific goal of this project was to teach a basic structure for a golang application and the surrounding components to productionalize the service. Using as many native golang libraries and very few 3rd party libraries the project is meant to be easily understood and clear from the start.
- Golang
- Docker
- TravisCI
The server requires Go to run.
Once golang has been installed, run make
command to start service.
$ make
For production environments...
$ make docker
$ docker run -e LOG_FILE=service-name --rm -d -p 8080:8080 IMAGE_TAG
- Add End to End testing Example
- Add database based DAO interface