go-server-example

command module
v0.0.0-...-677c301 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2022 License: MIT Imports: 6 Imported by: 0

README

Go Server Example

Build Status Man Hours

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.

Recent Additions

  • 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
Tech

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
Installation

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
Todos
  • Add End to End testing Example
  • Add database based DAO interface

License

MIT

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg
cmd
dao

Jump to

Keyboard shortcuts

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