Coder Social home page Coder Social logo

cuihaoweb / generago Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 16 KB

该项目是一个go的代码生成器, 功能包括:Mysql表和go之间的映射、dao层基本生成、service层基本生成。由于用户使用的框架无法强制规定, 所以该项目并没有controller层的代码生成。该项目还处于起步阶段,希望广大go的爱好者可以积极提供我一些建议。

Go 100.00%

generago's Introduction

generago 介绍

generago 是一个代码生成器的库, 目的是为了将开发者平时重复的代码批量生成。

目前支持的功能如下:

  • 批量生成 go 和数据库之间的映射

下一步将要增加的功能:

  • 实现 dao 层的增删改查

使用

该库保持简约的风格, 用户不用填写十分繁琐的配置,即可立即使用, 做到了真正的开箱即用。

步骤:

  1. go get -u github.com/cuihaoweb/generago

  2. 添加如下配置, 使用者需要根据自己的配置填写

func main() {
	generago.SetDataSource(generago.DataSource{
		DbName:   "数据库",
		User:     "用户",
		Password: "密码",
	})
	generago.SetOutDir("./model")
	generago.Execute()
}
  1. 执行 go run xx.go, xx 表示 main 包所在的文件,然后就会在指定目录下生成对应的文件。

  2. 不要忘记在生产环境中删除该库,减少项目的体积。

Tip:

  1. ./ 表示的是运行时目录,使用者不要忘记哦!

generago's People

Contributors

cuihaoweb avatar

Stargazers

 avatar

Watchers

 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.