go get github.com/pasan1/GoLang-Gin-CRUD-App-using-MySQL
go run main.go
GET /users
POST /users
├── app
│ ├── controllers
│ │ └── user_controller.go
│ ├── models
│ │ └── user_model.go
│ ├── repositories
│ │ └── user_repository.go
│ ├── routes
│ │ └── router.go
│ └── main.go
├── config
│ └── database.go
├── go.mod
└── go.sum
app/controllers
: This folder contains the controllers responsible for handling HTTP requests and defining the application's behavior. In this example, we have auser_controller.go
file.app/models
: This folder contains the model definitions for your application. Here, we have auser_model.go
file.app/repositories
: This folder contains the repository layer that interacts with the database. In this example, we have auser_repository.go
file.app/routes
: This folder contains the router configuration for your application. Here, we have arouter.go
file.app/main.go
: This is the entry point of your application. It initializes the server and sets up the routes.config/database
.go: This file contains the configuration details for connecting to your MySQL database.go.mod
andgo.sum
: These files manage the Go modules and their dependencies.
Email: contact@pasanabeysekara.com
Website: https://pasanabeysekara.com
LinkedIn: https://www.linkedin.com/in/pasanabeysekara