{"id":15096049,"url":"https://github.com/alimy/gin","last_synced_at":"2025-10-08T00:32:00.687Z","repository":{"id":57522351,"uuid":"162862162","full_name":"alimy/gin","owner":"alimy","description":"Gin is a HTTP web framework written in Go (Golang). It features a Martini-like API with much better performance -- up to 40 times faster. If you need smashing performance, get yourself some Gin.","archived":false,"fork":true,"pushed_at":"2024-10-17T11:46:47.000Z","size":3850,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-14T13:54:09.168Z","etag":null,"topics":["gin","go","http"],"latest_commit_sha":null,"homepage":"https://gin-gonic.github.io/gin/","language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"gin-gonic/gin","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alimy.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-12-23T04:28:58.000Z","updated_at":"2024-10-17T11:47:09.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/alimy/gin","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alimy%2Fgin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alimy%2Fgin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alimy%2Fgin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alimy%2Fgin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alimy","download_url":"https://codeload.github.com/alimy/gin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235669382,"owners_count":19026815,"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":["gin","go","http"],"created_at":"2024-09-25T15:45:13.902Z","updated_at":"2025-10-08T00:32:00.680Z","avatar_url":"https://github.com/alimy.png","language":"Go","readme":"# Gin Web Framework\n\n\u003cimg align=\"right\" width=\"159px\" src=\"https://raw.githubusercontent.com/gin-gonic/logo/master/color.png\"\u003e\n\n[![Build Status](https://github.com/gin-gonic/gin/actions/workflows/gin.yml/badge.svg?branch=master)](https://github.com/gin-gonic/gin/actions/workflows/gin.yml)\n[![codecov](https://codecov.io/gh/gin-gonic/gin/branch/master/graph/badge.svg)](https://codecov.io/gh/gin-gonic/gin)\n[![Go Report Card](https://goreportcard.com/badge/github.com/gin-gonic/gin)](https://goreportcard.com/report/github.com/gin-gonic/gin)\n[![Go Reference](https://pkg.go.dev/badge/github.com/gin-gonic/gin?status.svg)](https://pkg.go.dev/github.com/gin-gonic/gin?tab=doc)\n[![Sourcegraph](https://sourcegraph.com/github.com/gin-gonic/gin/-/badge.svg)](https://sourcegraph.com/github.com/gin-gonic/gin?badge)\n[![Open Source Helpers](https://www.codetriage.com/gin-gonic/gin/badges/users.svg)](https://www.codetriage.com/gin-gonic/gin)\n[![Release](https://img.shields.io/github/release/gin-gonic/gin.svg?style=flat-square)](https://github.com/gin-gonic/gin/releases)\n[![TODOs](https://badgen.net/https/api.tickgit.com/badgen/github.com/gin-gonic/gin)](https://www.tickgit.com/browse?repo=github.com/gin-gonic/gin)\n\nGin is a web framework written in [Go](https://go.dev/). It features a martini-like API with performance that is up to 40 times faster thanks to [httprouter](https://github.com/julienschmidt/httprouter).\nIf you need performance and good productivity, you will love Gin.\n\n**Gin's key features are:**\n\n- Zero allocation router\n- Speed\n- Middleware support\n- Crash-free\n- JSON validation\n- Route grouping\n- Error management\n- Built-in rendering\n- Extensible\n\n## Getting started\n\n### Prerequisites\n\nGin requires [Go](https://go.dev/) version [1.23](https://go.dev/doc/devel/release#go1.23.0) or above.\n\n### Getting Gin\n\nWith [Go's module support](https://go.dev/wiki/Modules#how-to-use-modules), `go [build|run|test]` automatically fetches the necessary dependencies when you add the import in your code:\n\n```sh\nimport \"github.com/gin-gonic/gin\"\n```\n\nAlternatively, use `go get`:\n\n```sh\ngo get -u github.com/gin-gonic/gin\n```\n\n### Running Gin\n\nA basic example:\n\n```go\npackage main\n\nimport (\n  \"net/http\"\n\n  \"github.com/gin-gonic/gin\"\n)\n\nfunc main() {\n  r := gin.Default()\n  r.GET(\"/ping\", func(c *gin.Context) {\n    c.JSON(http.StatusOK, gin.H{\n      \"message\": \"pong\",\n    })\n  })\n  r.Run() // listen and serve on 0.0.0.0:8080 (for windows \"localhost:8080\")\n}\n```\n\nTo run the code, use the `go run` command, like:\n\n```sh\ngo run example.go\n```\n\nThen visit [`0.0.0.0:8080/ping`](http://0.0.0.0:8080/ping) in your browser to see the response!\n\n### See more examples\n\n#### Quick Start\n\nLearn and practice with the [Gin Quick Start](docs/doc.md), which includes API examples and builds tag.\n\n#### Examples\n\nA number of ready-to-run examples demonstrating various use cases of Gin are available in the [Gin examples](https://github.com/gin-gonic/examples) repository.\n\n## Documentation\n\nSee the [API documentation on go.dev](https://pkg.go.dev/github.com/gin-gonic/gin).\n\nThe documentation is also available on [gin-gonic.com](https://gin-gonic.com) in several languages:\n\n- [English](https://gin-gonic.com/en/docs/)\n- [简体中文](https://gin-gonic.com/zh-cn/docs/)\n- [繁體中文](https://gin-gonic.com/zh-tw/docs/)\n- [日本語](https://gin-gonic.com/ja/docs/)\n- [Español](https://gin-gonic.com/es/docs/)\n- [한국어](https://gin-gonic.com/ko-kr/docs/)\n- [Turkish](https://gin-gonic.com/tr/docs/)\n- [Persian](https://gin-gonic.com/fa/docs/)\n- [Português](https://gin-gonic.com/pt/docs/)\n- [Russian](https://gin-gonic.com/ru/docs/)\n- [Indonesian](https://gin-gonic.com/id/docs/)\n\n### Articles\n\n- [Tutorial: Developing a RESTful API with Go and Gin](https://go.dev/doc/tutorial/web-service-gin)\n\n## Benchmarks\n\nGin uses a custom version of [HttpRouter](https://github.com/julienschmidt/httprouter), [see all benchmarks](/BENCHMARKS.md).\n\n| Benchmark name                 |       (1) |             (2) |          (3) |             (4) |\n| ------------------------------ | --------: | --------------: | -----------: | --------------: |\n| BenchmarkGin_GithubAll         | **43550** | **27364 ns/op** |   **0 B/op** | **0 allocs/op** |\n| BenchmarkAce_GithubAll         |     40543 |     29670 ns/op |       0 B/op |     0 allocs/op |\n| BenchmarkAero_GithubAll        |     57632 |     20648 ns/op |       0 B/op |     0 allocs/op |\n| BenchmarkBear_GithubAll        |      9234 |    216179 ns/op |   86448 B/op |   943 allocs/op |\n| BenchmarkBeego_GithubAll       |      7407 |    243496 ns/op |   71456 B/op |   609 allocs/op |\n| BenchmarkBone_GithubAll        |       420 |   2922835 ns/op |  720160 B/op |  8620 allocs/op |\n| BenchmarkChi_GithubAll         |      7620 |    238331 ns/op |   87696 B/op |   609 allocs/op |\n| BenchmarkDenco_GithubAll       |     18355 |     64494 ns/op |   20224 B/op |   167 allocs/op |\n| BenchmarkEcho_GithubAll        |     31251 |     38479 ns/op |       0 B/op |     0 allocs/op |\n| BenchmarkGocraftWeb_GithubAll  |      4117 |    300062 ns/op |  131656 B/op |  1686 allocs/op |\n| BenchmarkGoji_GithubAll        |      3274 |    416158 ns/op |   56112 B/op |   334 allocs/op |\n| BenchmarkGojiv2_GithubAll      |      1402 |    870518 ns/op |  352720 B/op |  4321 allocs/op |\n| BenchmarkGoJsonRest_GithubAll  |      2976 |    401507 ns/op |  134371 B/op |  2737 allocs/op |\n| BenchmarkGoRestful_GithubAll   |       410 |   2913158 ns/op |  910144 B/op |  2938 allocs/op |\n| BenchmarkGorillaMux_GithubAll  |       346 |   3384987 ns/op |  251650 B/op |  1994 allocs/op |\n| BenchmarkGowwwRouter_GithubAll |     10000 |    143025 ns/op |   72144 B/op |   501 allocs/op |\n| BenchmarkHttpRouter_GithubAll  |     55938 |     21360 ns/op |       0 B/op |     0 allocs/op |\n| BenchmarkHttpTreeMux_GithubAll |     10000 |    153944 ns/op |   65856 B/op |   671 allocs/op |\n| BenchmarkKocha_GithubAll       |     10000 |    106315 ns/op |   23304 B/op |   843 allocs/op |\n| BenchmarkLARS_GithubAll        |     47779 |     25084 ns/op |       0 B/op |     0 allocs/op |\n| BenchmarkMacaron_GithubAll     |      3266 |    371907 ns/op |  149409 B/op |  1624 allocs/op |\n| BenchmarkMartini_GithubAll     |       331 |   3444706 ns/op |  226551 B/op |  2325 allocs/op |\n| BenchmarkPat_GithubAll         |       273 |   4381818 ns/op | 1483152 B/op | 26963 allocs/op |\n| BenchmarkPossum_GithubAll      |     10000 |    164367 ns/op |   84448 B/op |   609 allocs/op |\n| BenchmarkR2router_GithubAll    |     10000 |    160220 ns/op |   77328 B/op |   979 allocs/op |\n| BenchmarkRivet_GithubAll       |     14625 |     82453 ns/op |   16272 B/op |   167 allocs/op |\n| BenchmarkTango_GithubAll       |      6255 |    279611 ns/op |   63826 B/op |  1618 allocs/op |\n| BenchmarkTigerTonic_GithubAll  |      2008 |    687874 ns/op |  193856 B/op |  4474 allocs/op |\n| BenchmarkTraffic_GithubAll     |       355 |   3478508 ns/op |  820744 B/op | 14114 allocs/op |\n| BenchmarkVulcan_GithubAll      |      6885 |    193333 ns/op |   19894 B/op |   609 allocs/op |\n\n- (1): Total Repetitions achieved in constant time, higher means more confident result\n- (2): Single Repetition Duration (ns/op), lower is better\n- (3): Heap Memory (B/op), lower is better\n- (4): Average Allocations per Repetition (allocs/op), lower is better\n\n## Middleware\n\nYou can find many useful Gin middlewares at [gin-contrib](https://github.com/gin-contrib) and [gin-gonic/contrib](https://github.com/gin-gonic/contrib).\n\n## Uses\n\nHere are some awesome projects that are using the [Gin](https://github.com/gin-gonic/gin) web framework.\n\n- [gorush](https://github.com/appleboy/gorush): A push notification server.\n- [fnproject](https://github.com/fnproject/fn): A container native, cloud agnostic serverless platform.\n- [photoprism](https://github.com/photoprism/photoprism): Personal photo management powered by Google TensorFlow.\n- [lura](https://github.com/luraproject/lura): Ultra performant API Gateway with middleware.\n- [picfit](https://github.com/thoas/picfit): An image resizing server.\n- [dkron](https://github.com/distribworks/dkron): Distributed, fault tolerant job scheduling system.\n\n## Contributing\n\nGin is the work of hundreds of contributors. We appreciate your help!\n\nPlease see [CONTRIBUTING.md](CONTRIBUTING.md) for details on submitting patches and the contribution workflow.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falimy%2Fgin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falimy%2Fgin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falimy%2Fgin/lists"}