{"id":34130420,"url":"https://github.com/qlu1990/gos","last_synced_at":"2026-03-12T03:31:06.521Z","repository":{"id":57601194,"uuid":"196396280","full_name":"qlu1990/gos","owner":"qlu1990","description":"demo web  framework","archived":false,"fork":false,"pushed_at":"2019-07-17T14:24:13.000Z","size":41,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-12-17T11:20:27.029Z","etag":null,"topics":["framework","golang-server","web"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/qlu1990.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-11T13:06:02.000Z","updated_at":"2019-07-17T14:24:15.000Z","dependencies_parsed_at":"2022-09-26T20:00:32.574Z","dependency_job_id":null,"html_url":"https://github.com/qlu1990/gos","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/qlu1990/gos","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qlu1990%2Fgos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qlu1990%2Fgos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qlu1990%2Fgos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qlu1990%2Fgos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qlu1990","download_url":"https://codeload.github.com/qlu1990/gos/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qlu1990%2Fgos/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30414263,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-12T00:40:14.898Z","status":"online","status_checked_at":"2026-03-12T02:00:07.260Z","response_time":114,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["framework","golang-server","web"],"created_at":"2025-12-15T00:30:52.654Z","updated_at":"2026-03-12T03:31:06.516Z","avatar_url":"https://github.com/qlu1990.png","language":"Go","readme":"# 狗子\n - 不错这个webframework 就是叫狗子，我的golang 成长之路\n# start\n\n```golang\n   package main\n   import \"github.com/qlu1990/gos\"\n   \n   func hello(c *gos.Context) {\n\tfmt.Fprintln(c.ResponseWriter, \"hello world\")\n    }\n\n\n   func main(){\n       r := gos.NewGos()\n       r.AddGet(\"/hello\", hello)\n       r.Run(\":8000\") //runing listen port 8000\n   }\n  \n\n\n\n```\n\n\n\n# 路由\n  - ~~路由使用map 可以优化 可以参考gin 使用属树~~(已经实现)\n  - ~~路由还不能支持路径中带参数~~ (已实现)\n\n  \n## 路由函数\n\n```golang\n    type HandlerFunc func(*Context)\n    r := gos.NewGos()\n    r.AddGet(url string ,f HandlerFunc) // 路由get\n    r.AddPost(url string ,f HandlerFunc) // 路由post\n    r.AddHead(url string ,f HandlerFunc) // 路由head\n    r.AddDelete(url string ,f HandlerFunc) // 路由delete\n\n```\n - 请求路径中带参数\n  ```golang\n    func GetPerson(c *gos.Context) {\n\tname := c.Param(\"name\")\n\tgos.Response(c.ResponseWriter,\"hello \"+name, http.StatusOK)\n    }\n    func main(){\n    r := gos.NewGos()\n    r.AddGet(\"/hello/:name\",GetPerson)\n    }\n    \n\n  ```\n\n# Middleware\n\n## 实现数据结构 \n\n - `Name` 中间件名称不能重名\n - `HandlerFunc`  被调用调用函数 \n```golang\n    type Middleware struct {  \n\tName        string\n\tHandlerFunc HandlerFunc      \n    }\n    \n    type HandlerFunc func(*Context)\n```\n\n## 使用方法\n以glog 为例\n\n```golang\n    r := gos.NewGos()\n   var Mlog = Middleware{\n\tName: \"log\",\n\tHandlerFunc: func(c *Context) {\n\t\tGlog.Info(\"Request : \", c.Request.Method, \" \", c.Request.RequestURI)\n\t},\n    }\n   r.Use(Mlog)\n\n```\n\n#日志模块\n## 使用\n\n```golang\n\n   r := gos.NewGos()\n   r.Info(\"info log\")\n   r.Debug(\"debug log\")\n   r.Error(\"error log\")\n   r.Fatal（\"fatal log\")\n   r.Warn(\"warn log\")\n\n```\n\n# 案例\n[案例 gos-example](https://github.com/qlu1990/gos-example)\n\nemail： 876392131@qq.com\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqlu1990%2Fgos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqlu1990%2Fgos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqlu1990%2Fgos/lists"}