Self-use Development scaffolding
go get -u github.com/coder2z/yangon
or
git clone https://github.com.cnpmjs.org/coder2z/yangon.git
cd yangon
go install
input:
λ yangon --help
output:
Usage:
Yangon [command]
Available Commands:
go db,handle,server,route code production
help Help about any command
new Generate app scaffolding
version app version
Flags:
-h, --help help for Yangon
Use "Yangon [command] --help" for more information about a command.
input:
λ yangon new -a appname -p projectname
λ cd projectname
output:
├─build
│ └─appname // dockerfile
├─cmd // app main
│ └─appname
│ └─app
├─config // config
├─deployments // k8sfile
│ └─appname
│ └─templates
├─internal // business code
│ └─appname
│ ├─api
│ │ └─v1
│ │ ├─handle
│ │ ├─middleware
│ │ └─registry
│ ├─map
│ ├─model
│ ├─services
│ └─validator
├─pkg // Public package
│ ├─constant
│ ├─rand
│ ├─recaptcha
│ ├─response
│ └─rpc
├─scripts // construct
│ └─appname
└─test
Provided that your database has a corresponding table
vim config/config.toml
[mysql.main]
tablePrefix = ""
host = "127.0.0.1"
username = "root"
password = "root"
dbName = ""
type = "mysql"
debug = true
input:
λ yangon go -a appname -p projectname -v v1
output:
├─internal
│ └─appname
│ ├─api
│ │ └─v1
│ │ ├─handle //code Here
│ │ ├─middleware
│ │ └─registry //code Here
│ ├─map //code Here
│ ├─model //code Here
│ │ ├─access_token
│ │ └─user
│ ├─services //code Here
│ │ ├─access_token
│ │ └─user
│ └─validator
Open source projects are inseparable from everyone’s support. If you have a good idea, encountered some bugs and fixed them, and corrected the errors in the document, please submit a Pull Request~
- Fork this project to your own repo
- Clone the project in the past, that is, the project in your warehouse, to your local
- Modify the code
- Push to your own library after commit
- Initiate a PR (pull request) request and submit it to the
provide
branch - Waiting to merge
Distributed under MIT License, please see license file within the code for more details.