All Projects → yangyuqian → Genus

yangyuqian / Genus

Licence: mit
A general code generation tools for Go applications

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Genus

Library Template Android
A Kotlin + Android library template (with a sample project).
Stars: ✭ 151 (+1272.73%)
Mutual labels:  library, template
Goview
Goview is a lightweight, minimalist and idiomatic template library based on golang html/template for building Go web application.
Stars: ✭ 213 (+1836.36%)
Mutual labels:  library, template
Tosin
Initialize a npm package with everything included, from CI to documentation website
Stars: ✭ 142 (+1190.91%)
Mutual labels:  library, template
Typescript Starter
Quickly create and configure a new library or Node.js project
Stars: ✭ 2,953 (+26745.45%)
Mutual labels:  library, template
Typin
Declarative framework for interactive CLI applications
Stars: ✭ 126 (+1045.45%)
Mutual labels:  command-line-tool, library
Swaggen
OpenAPI/Swagger 3.0 Parser and Swift code generator
Stars: ✭ 385 (+3400%)
Mutual labels:  library, template
Svelte Component Template
A base for building shareable Svelte 3 components
Stars: ✭ 208 (+1790.91%)
Mutual labels:  library, template
Php Library Template
+ 📒 Provides a GitHub repository template for a PHP library, using GitHub actions.
Stars: ✭ 249 (+2163.64%)
Mutual labels:  library, template
Text Minimap
Generate text minimap/preview using Braille Patterns
Stars: ✭ 21 (+90.91%)
Mutual labels:  command-line-tool, library
Hledger
A reliable, user-friendly Plain Text Accounting tool with command line, terminal and web interfaces.
Stars: ✭ 1,887 (+17054.55%)
Mutual labels:  command-line-tool, library
Papis
Powerful and highly extensible command-line based document and bibliography manager.
Stars: ✭ 636 (+5681.82%)
Mutual labels:  command-line-tool, library
Ng Suggest
AngularJS module to provide Typeahead via OpenSearch Suggestions
Stars: ✭ 9 (-18.18%)
Mutual labels:  library
Latex Mimosis
A minimal & modern LaTeX template for your (bachelor's | master's | doctoral) thesis
Stars: ✭ 850 (+7627.27%)
Mutual labels:  template
Taco
The Tensor Algebra Compiler (taco) computes sparse tensor expressions on CPUs and GPUs
Stars: ✭ 846 (+7590.91%)
Mutual labels:  library
Abclinuxuapi
API for http://abclinuxu.cz.
Stars: ✭ 8 (-27.27%)
Mutual labels:  library
Fileup
FileUp - JQuery File Upload
Stars: ✭ 10 (-9.09%)
Mutual labels:  library
Mypythonlib
🐍 Python 库(工欲善其事,必先利其器) 标准库(https://docs.python.org/zh-cn/2.7/library/index.html)
Stars: ✭ 9 (-18.18%)
Mutual labels:  library
Usbmuxd
A socket daemon to multiplex connections from and to iOS devices
Stars: ✭ 847 (+7600%)
Mutual labels:  library
Librg
🚀 Making multi-player gamedev simpler since 2017
Stars: ✭ 813 (+7290.91%)
Mutual labels:  library
Cute php
PHP version of the beanstalkd-backed job queuing system.
Stars: ✭ 7 (-36.36%)
Mutual labels:  library

License Build Status Go Report Card

中文版

List of Contents:

genus

A general code generation tools in Go.

New to code generation? Refer text/template for basic knowledge.

Why Another Generator?

Code generation has been becoming a popular way of metaprogramming in Go.

For example, when working with a ORM framework, you may want to create models with a given database schema with json tag support. it's trivial and burdensome when it comes with a database with hundreds even thousands of tables.

A code generation tool can help on this kind of issues through retriving database schema and rendering templates to go code.

However, before it turns into reality, you'll have to build a tool to

  • reading and organizing templates properly
  • formating the generated source code
  • fixing imports, especially removing unused imports
  • handle relative imports(imports among the generated code)
  • naming of generated file names

Today, generators are handling code generation in their own ways, which means that you can not generate models of Beego ORM with generators or gorm. It doesn't make sense to build a new generator becuase those models are generated from the same database schema.

Genus provides a clean way to perform code generation. Go to Examples to see more details.

Installation

Genus has built-in CLI support, you can install it by performing

go get -u github.com/yangyuqian/genus/cmd/genus

Features - V1

  • [x] Template Wrapper

    • [x] loading templates from diretories, files and bytes easily
    • [x] grouping templates for Go packages
    • [x] formating, fixing imports after code generation
  • [x] Generation Planner

    • [x] planning generation scenarios on template repository
    • [x] planner for regular files(non-Golang)
  • [x] Language specified helper funcs

    • [x] Golang helper funcs
  • [x] Generation Plan Specification

    • [x] JSON schema and validation support
    • [x] Reference and pointer support for complex specfications
  • [x] Command-line Interface

    • [x] accept context in JSON and do generation without writing any code
    • [x] create Generation Plan Specification of Database from given database
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].