go get



Build Status Godoc

Warning: This project is in the development

Gogen is lightweight resourceful code generator library written entirely in Go. It is based on resource definitions, pipes and executable configuration files.


To start with Gogen, we'll need resources(models, api schemes, blueprints, ...) and generators that should be used to generate results. We'll then mix everything in one or more configuration files, that will allow us to generate code.

Let's start by creating config.go file with already existing resources and generators.

package main

import (

func main() {
  // Define adds resources for the generators, this way
  // we are adding the user model that is already defined
  // for us to the generator resources

  // set output for the generator that is generating models

  // Pipe is set of generators. More pipes can go in parallel
  // and everything in pipe is executed in serie. This allows
  // generators to have dependencies on each other
  // This is creating our pipe with the ModelGenerator in it

  // start the generator

This configuration file will create new folder model in the current working directory, with generated user model file.

Known integrable generators