Code Monkey home page Code Monkey logo

golang-sample's Introduction

Sample

Golang-Sample is a sample app that I use to initialise go-lang projects.

Getting Started

Golang-Samples lets you do the following

  • Supports multiple binaries
  • Uses travis-ci as the primary CI
  • Uses Codecov for aggregating test coverage
  • Uses dep for dependency management
  • Has a Dockerfile to ship the binary in a container
  • Has a docker-compose file in external which gives you a postgres, redis and rabbitmq
  • Supports 12factorapps

Prerequisites

Here are the things that you would require before you get started

  1. Install git
  2. Install golang
  3. Install docker, we use it both for deployment and development

Installing

Create a new_project and pull files into it

mkdir new_project
cd new_project
curl -L https://github.com/sudhanshuraheja/golang-sample/archive/master.tar.gz | tar -xzv --strip 1
make build_fresh

Setup postgres

$ cd external
$ docker-compose up
$ tanker migrate
repeat above till you see *Sadly, found no new migrations to run*

Running the tests

If you would like to run the automated tests for the complete package, run this

make coverage
open ./coverage.html

And coding style tests

We use the default golang coding conventions. Run the following to test for those

make fmt
make vet
make lint

Deployment

There is no functionality in this repo and hence cannot be deployed

Built With

  • DEP - For dependency management
  • CLI - For accessing the binary on CLI
  • VIPER - For configuration management
  • LOGRUS - For logging
  • NEGRONI - HTTP Middleware
  • MUX - For routing each request to the correct place
  • PQ - SQL driver for postgres
  • SQLX - For connecting to postgres
  • MIGRATE - For migrating postgres
  • TESTIFY - For asserting tests
  • GO-SQLMOCK - For mocking postgres

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning based on the recommendation from Dave Chaney. For the versions available, see the tags on this repository.

Authors

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details

Acknowledgments

  • Hat tip to every gopher out there who took the time to write articles so that newbies like me could learn

golang-sample's People

Contributors

sudhanshuraheja avatar

Watchers

 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.