Files
zhuangang/topics/backend/gin/index.md
T

41 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
id: backend.gin.index
title: Gin Web 框架
type: index
domain: backend
stack: [gin]
tags: [Go, Gin, REST, 中间件]
week: [1, 2, 3]
---
# Gin Web 框架
Gin 是 Go 里使用最广的 Web 框架之一:在标准库 `net/http` 之上提供了高性能路由、参数绑定和校验、中间件链。学会 Gin,看懂其他 Go 框架(Echo、Fiber、Hertz)也很快。
## 学习路线
| 顺序 | 课程 | 级别 | 预计 |
| --- | --- | --- | --- |
| 1 | [路由、参数绑定和校验](01-routing-binding.md) | 基础 | 3 小时 |
| 2 | [中间件、JWT 鉴权和统一错误处理](02-middleware-auth.md) | 进阶 | 3 小时 |
## 企业场景
- [企业后台接口规范:统一响应、错误码、请求 ID 和参数校验](scenarios/unified-api-response.md)
## 面试题
- [Gin 面试题](interview.md)
## 示例代码
- [examples/unified-api](examples/unified-api/):统一响应 + 错误码 + 请求 ID + 参数校验中文提示 + panic 兜底 + 测试(`go test ./...`)
## 在 16 周计划中
- [第 1 周](../../../plan/week01-go-gin.md)(Gin 接口)、[第 2 周](../../../plan/week02-db-auth.md)(JWT 鉴权)、[第 3 周](../../../plan/week03-project1.md)(权限、限流中间件)
## 官方资料
- Gin 文档(中文):https://gin-gonic.com/zh-cn/docs/ ;参数校验 validator:https://github.com/go-playground/validator