This is a sample project using Golang and the Gin web framework, MySQL as the database, and Redis for caching. The project implements a search functionality where users can search for books based on a provided query. The API receives the search query through the URL, performs a search in the MySQL database, and returns relevant book information.
docker-compose up
- swagger documentation:
http://localhost:8888/docs/index.html
go get -u github.com/swaggo/swag/cmd/swag
go install github.com/swaggo/swag/cmd/swag@latest
go get -u github.com/swaggo/files
go get -u github.com/swaggo/gin-swagger
- add middleware in mian.go
router.GET("/docs/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))
swag init