- app_key: 1234
- secret: abcd
- version: v1.0
- sub_code: fee431abhd4772
go mod init project_name
go run main.go
go get -u github.com/gin-gonic/gin
git clone https://github.com/cosmtrek/air.git
cd air
go build -o project_directly
cd project
./air
go install github.com/cosmtrek/air@latest
air init
./air
注意: ファイルの名前は、点の後ろの名前は”ael”で設定します。
aelファイルを解析します。
── config
│ ├── db.json ## db.ael
│ ├── config.json ## config.ael
│ ├── .env.json ## .env.ael
db.json
{
"prod": {
"user": "user id",
"password": "password",
"host": "host.url",
"port": "3306",
"dbname": "dbname",
"charset": "utf8mb4",
"parseTime": "True",
"loc": "Asia/Tokyo"
},
"test": {
},
"development": {
}
}
.env.json
{
"gin_mode": "debug" // debug, prod, test
} config.json
{
"port": 1234, // your custom port
"db": true,
"redis": false,
"cache": true,
"log": true,
"environment_checker": true,
"error_warning": true,
"console_error":false,
"auto_db_checker": true,
"listener": false,
"test": true
}https://github.com/air-verse/air/releases ページに訪問して適切なバッションを選択し、ダウンロードします
This project is a simple web application built with Go.
プロジェクトのドキュメント、プロジェクトの概要、セットアップ手順、その他の重要な情報が含まれいます。
The entry point of the application. This file contains the main function that starts the server and initializes the application.
Contains configuration files.
Handles the loading and management of configuration settings.
Contains specific configuration settings for different environments or services.
Handles the application logic for different routes.
Manages the logic for the home page and related routes.
Manages user-related routes and functionality, such as user registration and login.
Defines data models representing entities in the application.
Defines the User model and its associated methods.
Defines the Product model and its associated methods.