Giter VIP home page Giter VIP logo

go-server-example's Introduction

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

go-server-example's People

Contributors

dependabot[bot] avatar hunter32292 avatar jessemillar avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.