{"id":14987718,"url":"https://github.com/dxvgef/tsing","last_synced_at":"2025-06-11T09:34:59.471Z","repository":{"id":57485616,"uuid":"179769201","full_name":"dxvgef/tsing","owner":"dxvgef","description":"微核心、高性能的Go语言Web框架","archived":false,"fork":false,"pushed_at":"2024-04-16T05:58:44.000Z","size":201,"stargazers_count":36,"open_issues_count":0,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-15T00:22:39.574Z","etag":null,"topics":["chi","echo","framework","gin","http","httprouter","tsing","web"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dxvgef.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-05T23:51:30.000Z","updated_at":"2023-10-19T07:08:39.000Z","dependencies_parsed_at":"2022-09-02T00:02:23.445Z","dependency_job_id":"fa2b4e83-b071-4de0-adb4-54ced094ce3f","html_url":"https://github.com/dxvgef/tsing","commit_stats":null,"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dxvgef%2Ftsing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dxvgef%2Ftsing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dxvgef%2Ftsing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dxvgef%2Ftsing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dxvgef","download_url":"https://codeload.github.com/dxvgef/tsing/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248498045,"owners_count":21114027,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["chi","echo","framework","gin","http","httprouter","tsing","web"],"created_at":"2024-09-24T14:15:15.629Z","updated_at":"2025-04-12T00:20:24.790Z","avatar_url":"https://github.com/dxvgef.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tsing\nTsing是一个Go语言的HTTP API框架，具有以下功能特性：\n- 高性能，零内存分配\n- 微核心，仅包含路由和会话管理两大模块\n- 轻量，无第三方包依赖，兼容`net/http`标准包\n- 可自动处理路由处理器中的`Panic`错误，防止进程退出\n- 使用回调函数代替传统的内置`Logger`机掉，异常处理更灵活\n- 支持后置回调处理器`AfterHandler`（仅在路由命中时有效）\n\n`Tsing`是汉字【青】以及同音字做为名词时的英文，例如：清华大学(Tsinghua University)、青岛(Tsing Tao)。\n\n已经在多个项目中稳定运行。\n\n## 执行流程\n1. 根据`URI`查找路由\n2. 执行`Use()`方法注册的中间件\n3. 执行`GET()`等方法注册的路由处理器\n4. 执行`AfterHandler`后置处理器，无视之前处理器的执行结果\n\n- 如果任意环节的处理器出现了以下情况，会中止执行后面的处理器\n    - 处理器返回了`error`\n    - 处理器中执行了`Context.Break()`\n    - 处理器执行时触发了`panic`\n- 如果路由未命中，只会执行`ErrorHandler`错误回调处理器，不会触发中间件和后置处理器\n\n## 安装\n要求：Go 1.18+\n```\ngithub.com/dxvgef/tsing/v2\n```\n\n## 示例\n请参考[/example_test.go](https://github.com/dxvgef/tsing/blob/master/example_test.go)文件\n\n## 基准测试\n\n测试代码：[github.com/dxvgef/tsing-benchmark](https://github.com/dxvgef/tsing-benchmark)\n\n```\nBenchmark_TsingV2-8                        50865             23725 ns/op               0 B/op          0 allocs/op\nBenchmark_TsingV2_Recover-8                48708             24582 ns/op               0 B/op          0 allocs/op\nBenchmark_TsingV1-8                        48664             24875 ns/op               0 B/op          0 allocs/op\nBenchmark_TsingV1_Recover-8                45986             26267 ns/op               0 B/op          0 allocs/op\nBenchmark_Gin-8                            47978             24542 ns/op               0 B/op          0 allocs/op\nBenchmark_Gin_Recover-8                    43753             27390 ns/op               0 B/op          0 allocs/op\nBenchmark_Httprouter-8                     46738             25555 ns/op           13792 B/op        167 allocs/op\nBenchmark_Httprouter_Recover-8             44786             26703 ns/op           13792 B/op        167 allocs/op\nBenchmark_Echo-8                           38401             31216 ns/op               0 B/op          0 allocs/op\nBenchmark_Echo_Recover-8                   28674             41750 ns/op            9748 B/op        203 allocs/op\nBenchmark_HTTPTreemux-8                    15448             77755 ns/op           65857 B/op        671 allocs/op\n```\n\n## 相关资源\n\n- [dxvgef/tsing-demo](https://github.com/dxvgef/tsing-demo) `Tsing`整合常见功能的示例项目，可以做为新项目初始化使用\n- [dxvgef/filter](https://github.com/dxvgef/filter) 参数值过滤包，由数据输入、格式化、校验、输出几个部份组成\n- [Tsing Gateway](https://github.com/dxvgef/tsing-gateway) 跨平台、去中心化集群、动态配置的API网关\n- [Tsing Center](https://github.com/dxvgef/tsing-center) 跨平台、去中心化集群、动态配置的服务中心\n\n## 用户案例\n\n如果你在使用本项目，请通过[Issues](https://github.com/dxvgef/tsing/issues)告知我们项目的简介\n\n## 帮助反馈\n\n本项目已在多个项目的生产环境中稳定运行。如有问题可在[Issues](https://github.com/dxvgef/tsing/issues)里提出。\n\n诚邀更多的开发者参与到本项目维护中，帮助这个开源项目更好的发展。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdxvgef%2Ftsing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdxvgef%2Ftsing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdxvgef%2Ftsing/lists"}