{"id":46064241,"url":"https://github.com/lookteas/go-web-api-study","last_synced_at":"2026-03-01T12:03:32.329Z","repository":{"id":309355802,"uuid":"1035943857","full_name":"lookteas/go-web-api-study","owner":"lookteas","description":"Go 语言 Web 开发与接口开发学习笔记与实践项目集合","archived":false,"fork":false,"pushed_at":"2025-11-14T16:45:51.000Z","size":6944,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-14T17:37:57.073Z","etag":null,"topics":["goapi","golang","golang-library"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lookteas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-11T10:27:01.000Z","updated_at":"2025-11-14T16:40:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"1297fb1b-52fd-4132-b7b4-75511491281d","html_url":"https://github.com/lookteas/go-web-api-study","commit_stats":null,"previous_names":["lookteas/go-web-api-study"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/lookteas/go-web-api-study","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lookteas%2Fgo-web-api-study","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lookteas%2Fgo-web-api-study/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lookteas%2Fgo-web-api-study/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lookteas%2Fgo-web-api-study/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lookteas","download_url":"https://codeload.github.com/lookteas/go-web-api-study/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lookteas%2Fgo-web-api-study/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29969243,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T11:43:06.159Z","status":"ssl_error","status_checked_at":"2026-03-01T11:43:03.887Z","response_time":124,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["goapi","golang","golang-library"],"created_at":"2026-03-01T12:03:31.803Z","updated_at":"2026-03-01T12:03:32.315Z","avatar_url":"https://github.com/lookteas.png","language":"Go","readme":"# go-web-api-study\n\n📚 Go 语言 Web 开发与接口开发学习笔记与实践项目集合\n\n\u003e 记录使用 Go (Golang) 进行 Web 开发和 API 接口开发过程中的学习笔记、代码示例、实战项目与最佳实践。\n\n---\n\n## 🌱 项目目标\n\n本仓库旨在系统性地学习和掌握 Go 语言在后端 Web 开发和 RESTful API 开发中的应用，涵盖从基础语法到框架使用、项目结构设计、数据库操作、中间件开发、接口测试等完整技能链。\n\n适合：\n- Go 初学者入门 Web 开发\n- 想深入理解 Go 后端工程实践的开发者\n- 寻找可复用代码示例的学习者\n\n---\n\n![](./docs/1.jpg)\n\n## 🚀 快速开始\n\n### 启动学习环境\n\n```bash\n# 克隆项目\ngit clone https://github.com/lookteas/go-web-api-study.git\ncd go-web-api-study\n\n# 启动Web学习服务器\ngo run cmd/api/main.go\n# 或者构建后运行\ngo build -o server.exe cmd/api/main.go\n./server.exe\n```\n\n### 访问学习界面\n\n启动服务器后，访问以下地址：\n\n- **🏠 主页**: http://localhost:8080\n- **📝 每日练习**: http://localhost:8080/exercises ([练习计划详情](./exercises/README.md))\n- **🔧 基础模块**: http://localhost:8080/gobase\n- **💚 健康检查**: http://localhost:8080/health\n\n---\n\n## 📚 学习内容概览\n\n| 主题 | 内容 | 状态 |\n|------|------|------|\n| ✅ 基础语法回顾 | 变量、函数、结构体、接口、并发等 | 已完成 |\n| ✅ HTTP 服务开发 | 使用 `net/http` 构建基础 Web 服务 | 已完成 |\n| ✅ RESTful API 设计 | 请求处理、JSON 序列化、状态码规范 | 已完成 |\n| ✅ 数据库操作 | SQL操作、连接池、事务、ORM基础 | 已完成 |\n| ✅ 高级特性 | 并发模式、反射、泛型、性能优化、设计模式 | 已完成 |\n| ✅ 中间件开发 | 日志、认证、CORS、限流等 | 已完成 |\n| ✅ 用户认证 | JWT、Session、OAuth2 基础实现 | 已完成 |\n| ✅ 配置管理 | 使用 `Viper` 管理配置文件 | 已完成 |\n| ✅ 错误处理 | 统一错误响应结构 | 已完成 |\n| ✅ 接口测试 | 使用 `testing` 包进行单元测试与集成测试 | 已完成 |\n| ✅ 项目结构设计 | 推荐的 Go 项目分层结构 | 已完成 |\n| ✅ 部署实践 | Docker 打包、简单部署流程 | 已完成 |\n\n---\n\n![](./docs/2.jpg)\n\n## 📁 项目结构\n\n```bash\n.\n├── cmd/                   # 主程序入口\n│   └── api/\n│       └── main.go        # Web服务器主程序\n├── docs/                  # 文档目录\n│   └── learning_plan.md   # 学习计划文档\n├── exercises/             # 每日练习目录\n│   ├── README.md          # 6周练习计划\n│   ├── day01/             # 第1天练习\n│   │   └── hello_world.go\n│   ├── day02/             # 第2天练习\n│   │   └── hello_world.go\n│   └── day03/             # 第3天练习\n│       └── ......\n├── gobase/                # Go基础学习模块\n│   ├── README.md          # 模块说明\n│   ├── 01_variables_and_types.go    # 变量和类型\n│   ├── 02_functions.go              # 函数\n│   ├── 03_structs_and_interfaces.go # 结构体和接口\n│   ├── 04_concurrency.go           # 并发编程\n│   ├── 05_http_basics.go           # HTTP基础\n│   ├── 06_api_development.go       # API开发\n│   ├── 07_database_basics.go       # 数据库操作\n│   └── 08_advanced_features.go     # 高级特性\n├── internal/              # 内部逻辑代码\n│   ├── handler/           # HTTP 请求处理器\n│   │   └── handler.go\n│   ├── middleware/        # 自定义中间件\n│   │   ├── cors.go\n│   │   └── logger.go\n│   ├── model/             # 数据结构与数据库模型\n│   │   └── user.go\n│   └── service/           # 业务逻辑\n│       └── user_service.go\n├── go.mod                 # Go模块文件\n├── server.exe             # 编译后的可执行文件\n└── README.md              # 项目说明文档\n```\n\n---\n\n## 🎯 学习路径\n\n### 第一阶段：基础语法 (gobase模块)\n1. **变量和类型** - 掌握Go的基本数据类型和变量声明\n2. **函数** - 学习函数定义、参数传递、闭包等\n3. **结构体和接口** - 理解Go的面向对象编程\n4. **并发编程** - 掌握goroutine和channel\n\n### 第二阶段：Web开发 (gobase模块)\n5. **HTTP基础** - 学习HTTP服务器开发\n6. **API开发** - 构建RESTful API\n7. **数据库操作** - 数据持久化和ORM\n8. **高级特性** - 性能优化和设计模式\n\n### 第三阶段：实践练习 (exercises目录)\n- **6周练习计划** - 每日一练，循序渐进 📋 [详细练习计划](./exercises/README.md)\n- **项目实战** - 结合所学知识构建完整项目\n\n#### 📅 练习计划概览\n- **第1-2周**: Go语言基础入门和核心概念\n- **第3-4周**: HTTP和Web开发、数据库操作\n- **第5-6周**: 项目实战和部署优化\n\n\u003e 💡 **提示**: 点击 [练习计划详情](./exercises/README.md) 查看完整的42天学习安排\n\n---\n\n## 🔧 功能特性\n\n### Web学习界面\n- 📱 响应式设计，支持多设备访问\n- 🎨 美观的UI界面，提升学习体验\n- 📝 源代码在线查看，支持语法高亮\n- 🔗 便捷的导航链接，快速跳转\n\n### 学习模块\n- 📚 **8个基础模块** - 从入门到进阶的完整知识体系\n- 💡 **丰富的代码示例** - 每个概念都有实际代码演示\n- 📖 **详细的注释说明** - 帮助理解每行代码的作用\n- 🛠️ **实用工具函数** - 可直接在项目中使用\n\n### 练习系统\n- 📅 **6周学习计划** - 科学安排学习进度 ([查看详细计划](./exercises/README.md))\n- 🎯 **循序渐进** - 从简单到复杂，逐步提升\n- 💻 **命令行运行** - 支持直接运行练习代码\n- 🌐 **Web端查看** - 在浏览器中查看源代码\n- 📋 **42天练习** - 每日一练，持续学习\n\n---\n\n## 🤝 贡献指南\n\n欢迎提交 Issue 和 Pull Request 来完善这个学习项目！\n\n### 贡献方式\n1. Fork 本仓库\n2. 创建你的特性分支 (`git checkout -b feature/AmazingFeature`)\n3. 提交你的修改 (`git commit -m 'Add some AmazingFeature'`)\n4. 推送到分支 (`git push origin feature/AmazingFeature`)\n5. 打开一个 Pull Request\n\n---\n\n## 📄 许可证\n\n本项目采用 MIT 许可证 - 查看 [LICENSE](LICENSE) 文件了解详情\n\n---\n\n## 🙏 致谢\n\n感谢所有为Go语言生态系统做出贡献的开发者们！\n\n---\n\n**Happy Coding! 🚀**\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flookteas%2Fgo-web-api-study","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flookteas%2Fgo-web-api-study","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flookteas%2Fgo-web-api-study/lists"}