Ginbro is a scaffold tool for Gin-Gorm-MySQL which you just need to input one command to create a mighty RESTful APIs App.
- fastest way to generate a RESTful APIs application with MySQL in Go
- support JWT Authorization Bearer Auth and JWT middleware
- support brute-force-login firewall
- build in swift golang-memory cache
- generate GORM model from MySQL database schema
- powered with Swagger document and SwaggerUI
- capable of serve VueJs app's static files
- configurable CORS middleware
- user friendly configuration
- fully build-in cron task support
- travis CI/CD
example
felix ginbro -a dev.wordpress.com:3306 -P go_package_name -n db_name -u db_username -p 'my_db_password' -d '~/thisDir'
$ felix ginbro -h
generate a RESTful APIs app with gin and gorm for gophers
Usage:
felix ginbro [flags]
Examples:
felix ginbro -u root -p password -a "127.0.0.1:3306" -d dbname -c utf8 --authTable=users --authColumn=pw_column -P=APP_PACKAGE_NAME" -d '~/thisDir'
Flags:
-l, --appListen string app's listening addr (default "127.0.0.1:5555")
--authColumn string bcrypt password column (default "password")
--authTable string login user table (default "users")
-a, --dbAddr string database connection addr (default "127.0.0.1:3306")
-c, --dbCharset string database charset (default "utf8")
-n, --dbName string database name
-p, --dbPassword string database user password (default "password")
-t, --dbType string database type: mysql/postgres/mssql/sqlite (default"mysql")
-u, --dbUser string database username (default "root")
-d, --dir string code project output directory,default is current working dir (default ".")
-h, --help help for ginbro
-P, --pkg string eg1: github.com/dejavuzhou/ginSon, eg2: ginbroSon
Global Flags:
--verbose verbose
the generated project directory ginbro DEMO-code-repository
- my development environment
- Windows 10 pro 64
- go version go1.11.1 windows/amd64
- mysql version <= 5.7
- resource table'schema which has no "ID","id","Id'" or "iD" will not generate model or route.
- the column which type is json value must be a string which is able to decode into a JSON, when resource is called POST or PATCH from the swaggerUI.