Command-line tool to generate GO applications and libraries
Clone or download
Latest commit 5c12923 Oct 14, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src Update golang version Oct 14, 2018
.gitignore Add travisci configuration May 9, 2017
.travis.yml Update go version in TravisCI Oct 14, 2018
LICENSE Fix copyright period Feb 17, 2017
Makefile Use Makefile dir instead of current dir Aug 15, 2018
README.md Add PyGen info Apr 20, 2018
RELEASE First commit Oct 19, 2016
VERSION Update golang version Oct 14, 2018
default.cfg Add project link Oct 27, 2016

README.md

gogen

Command-line tool to generate GO services, applications and libraries with reusable logic.

Master Build Status Donate via PayPal Please consider supporting this project by making a donation via PayPal

Description

This is a command-line tool to quickly generate GO services, applications and libraries with a common set of features and reusable logic.

For an equivalent project in Python please check PyGen.

Each GO project built with this tool adheres to the set of conventions detailed in the following articles:

Each generated project is immediately functional and can be fully tested using the make qa command.

To understand the logic of the generated applications please start with the main.go file and follow the code.

Quick Start

This project includes a Makefile that allows you to test and build the project in a Linux-compatible system with simple commands.
All the artifacts and reports produced using this Makefile are stored in the target folder.

To see all available options:

make help

Usage

make new TYPE=app CONFIG=myproject.cfg
  • TYPE is the project type:

    • lib : library
    • app : command-line application
    • srv : HTTP API service
  • CONFIG is the configuration file containing the project settings.

To create a new configuration please clone the default.cfg file and change the values.

All projects are creted inside the target directory and should be moved to the correct path inside the $GOPATH/src.

Features

Services (srv)

  • Web HTTP RESTful JSON API;
  • Standard command line options;
  • Multiple configuration options, including remote configuration via Consul or Etcd;
  • Logging;
  • StatsD client to collect usage metrics;
  • Unit tests;
  • Makefile;
  • Docker build;
  • RPM, DEB and Docker packaging.

Applications (app)

  • Standard command line options;
  • Multiple configuration options, including remote configuration via Consul or Etcd;
  • Logging;
  • Unit tests;
  • Makefile;
  • Docker build;
  • RPM, DEB and Docker packaging.

Libraries (lib)

  • Unit tests;
  • Makefile;
  • Docker build;