This script file is for generating golang simple crud api template with mysql database connectivity.
- Golang
- MySQL
- Git
-
First clone this repo on your local machine.
-
Then start this script file in your terminal by going to their path. To run the script just run this command "bash Goboilerplate.sh".
-
After it will check the prerequisite is installed in your system or not if not then install all the prerequisite for you.
-
In step 4 if everything is installed then it will give two options and you have to enter the no which is mentioned in front of them. List are
- New Project
- Add Module If you are doing first time always go with first one.
-
In next step it will clone the rest api repo and ask you for the name of the folder for your project you can provide any name as per your need or your project name as well.
-
In this step it will ask you for the git url in which repo you want to push the code. Example :- https://gitlab.com/$useranme/$projectname
-
In this step it will ask you for the name of controller file or this can also be your module name.
-
In this step it will ask you for your git username and password to push your code on your git repository.
-
That's it and the sample rest api bioler plate is ready to use.
-
When you want to create another module in the same repository then again run this script and choose 2nd option.
-
In first step it will ask you for the path of your repository just give the path up to your root folder. Example your folder is Test and it is located at home just provide path as /home/ubuntu/Test
-
In this step it will ask you for new module name please provide the module name whic you want to create.
-
In this last step it will ask you for the go.mod file module name and you have to provide your go.mod file module name.
-
That's it the new module will be created with the given module name.