A CLI to initialize and work on go projects, mainly designed for API's.
💡 You need to have go installed correctly on your machine. More informations are available in the wiki.
Install the CLI by running :
go get github.com/edwinvautier/go-gadgeto
Run go-gadgeto -h
in order to know more about commands.
You can initialize a project in your working directory by running the create
command.
go-gadgeto create
# or with app name
go-gadgeto create my-app-name
The CLI will eventually ask you your git username, the DB management system you'd like to use and if you want to dockerize the application or not.
You can install bundles by using the install command of the CLI. This command will look for a bundle located inside the bundles folder of the repository and install it.
go-gadgeto install authenticator
Each bundle should have the following elements :
templates
folderinstall.sh
scriptREADME.md
file to explain how bundle works and how to use it
The templates part must follow the same filetree as the project that is created.
With go-gadgeto, you can use the make model
command. It will create a new model and repository file with fields of your choice !
go-gadgeto make model modelYouWant
go-gadgeto can generate your controllers, to do so, you just have to use the make crud
command :
go-gadgeto make crud entityName
go-gadgeto will eventually asks you to run the go-gadgeto update
command, that reads the models files, and parse their fields to the config.
go-gadgeto can generate your fixtures, to do so, you just have to use the make fixtures
command :
go-gadgeto make fixtures entityName
go-gadgeto will eventually asks you to run the go-gadgeto update
command, that reads the models files, and parse their fields to the config.
Only works with models files for the moment.
go-gadgeto can generate your tests, to do so, you just have to use the make tests
command :
go-gadgeto make tests entityName
go-gadgeto will eventually asks you to run the go-gadgeto update
command, that reads the models files, and parse their fields to the config.