Skip to content

Latest commit

 

History

History
49 lines (30 loc) · 2.73 KB

README.md

File metadata and controls

49 lines (30 loc) · 2.73 KB

gboot

Go

🚀🚀🚀 Start a web project right away using gonic-gin/gin and other practical tools!!! 🚀🚀🚀

Use this framework to easily launch a Golang web service with the following features:

Install & Usage

Before All

  1. Install golang and configure golang environment.
  2. Create a project folder by mkdir myApp
  3. cd myApp

One-Click Script

In your project root directory and run:

wget https://raw.githubusercontent.com/gin-melodic/gboot/main/install.sh && bash install.sh && rm install.sh

Since the script needs to be an interactive shell, it cannot be executed using the previous wget -qO- with pipeline

The script will provide options that dynamically affect the code that creates the item.

These options are:

  1. project name Get the name of the current folder as the project name by default.
  2. author name The default value anonymous is actually meaningless and is highly recommended to be changed. One suggestion is to use your github username, which together with project name will form project address on github like https://github.com/<author>/<project>.
  3. use one-click installation If this option is Y, then all subsequent questions will be skipped and the created project will use 8000 as the listening port, './log/' as the directory for the log files, the log file rotation is set to 7 days, and the script will generate sample code for connecting to the database.
  4. project port Set the service listening port in the configuration file.
  5. log save path Set the log files saving path in the configuration file.
  6. log overwrite days Set the log file rotation time in the configuration file.
  7. database demo code If this option is Y, the script will generate sample code for connecting to the database. It's worth noting that the generated database connection initialisation code uses a glogger I wrote as the SQL execution print handle, which is particularly nice to have when Debugging.

In addition to the service code itself, the script generates a powerful Makefile for compiling and packaging the service. You can add more customisation to this makefile.

Demo video

gboot-demo.mp4