用Golang实现的基于gin的web框架
- 使用 Golang 实现,参考 Gin 实现的网络框架
- 设计上下文(Context),封装 Request 和 Response ,提供对 JSON、HTML 等返回类型的支持
- 使用 Trie 树实现动态路由( dynamic route )解析
- 实现路由分组控制( Route Group Control )
- 设计并实现 Web 框架的中间件(Middlewares)机制
- 实现静态资源服务( Static Resource),支持HTML模板渲染。
RobGin
|-- Day1 http-base http基础
| |-- main.go
| |-- rob
| | `-- rob.go
|-- Day2-context 上下文
| |-- go.mod
| |-- main.go
| |-- rob
| | |-- context.go
| | |-- rob.go
| | `-- router.go
|-- Day3-trie 前缀树路由
| |-- go.mod
| |-- main.go
| |-- rob
| | |-- context.go
| | |-- rob.go
| | |-- router.go
| | |-- router_test.go
| | `-- trie.go
|-- Day4-groupcontrol 路由分组控制
| |-- go.mod
| |-- main.go
| |-- rob
| | |-- context.go
| | |-- rob.go
| | |-- router.go
| | `-- trie.go
|-- Day5-middleware 中间件
| |-- go.mod
| |-- main.go
| |-- rob
| | |-- context.go
| | |-- logger.go
| | |-- rob.go
| | |-- router.go
| | `-- trie.go
|-- Day6-template 模板
| |-- go.mod
| |-- main.go
| |-- rob
| | |-- context.go
| | |-- logger.go
| | |-- rob.go
| | |-- router.go
| | `-- trie.go
| |-- static
| | `-- css
| | `-- test.css
| |-- templates
| | |-- arr.tmpl
| | |-- css.tmpl
| | `-- custom_func.tmpl
|-- Day7-errorRecovery 错误恢复
| |-- go.mod
| |-- main.go
| |-- rob
| | |-- context.go
| | |-- logger.go
| | |-- recovery.go
| | |-- rob.go
| | |-- rob_test.go
| | |-- router.go
| | |-- router_test.go
| | `-- trie.go
|-- README.md
请阅读README.md 查阅为该项目做出贡献的开发者。
贡献使开源社区成为一个学习、激励和创造的绝佳场所。你所作的任何贡献都是非常感谢的。
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
QQ邮箱:2768817839@qq.com
您也可以在贡献者名单中参看所有参与该项目的开发者。
该项目签署了MIT 授权许可,详情请参阅 LICENSE.txt