diff --git a/Makefile b/Makefile index 2dac822ec45..334e1e42150 100644 --- a/Makefile +++ b/Makefile @@ -70,7 +70,7 @@ router_cr: ln -s -f ../crystal/router.cr/bin/server_crystal_router_cr bin/. # --- Go --- -go: echo gorilla-mux fasthttprouter +go: echo gorilla-mux fasthttprouter gin # Echo echo: @@ -96,6 +96,11 @@ fasthttprouter: cd go/fasthttprouter; go build -o server_go_fasthttprouter main.go ln -s -f ../go/fasthttprouter/server_go_fasthttprouter bin/. +gin: + go get github.com/gin-gonic/gin + cd go/gin; go build -o server_go_gin main.go + ln -s -f ../go/gin/server_go_gin bin/. + # --- Rust --- rust: iron nickel rocket diff --git a/README.md b/README.md index 5362ce9f8ba..05e3cd5abf0 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,7 @@ CPU Cores: 8 - [gorilla-mux](https://github.com/gorilla/mux) - [iris](https://github.com/kataras/iris) - [fasthttprouter](https://github.com/buaazp/fasthttprouter) + - [Gin](https://github.com/gin-gonic/gin) - Rust - [IRON](https://github.com/iron/iron) - [nickel.rs](https://github.com/nickel-org/nickel.rs) diff --git a/go/gin/main.go b/go/gin/main.go new file mode 100644 index 00000000000..f7fbf211945 --- /dev/null +++ b/go/gin/main.go @@ -0,0 +1,26 @@ +package main + +import ( + "net/http" + + "github.com/gin-gonic/gin" +) + +func main() { + r := gin.Default() + + r.GET("/", func(c *gin.Context) { + c.String(http.StatusOK, "") + }) + + r.GET("/user/:name", func(c *gin.Context) { + name := c.Params.ByName("name") + c.String(http.StatusOK, name) + }) + + r.POST("/user", func(c *gin.Context) { + c.String(http.StatusOK, "") + }) + + r.Run(":3000") +} diff --git a/neph.yml b/neph.yml index 589ab2d66d8..581a1b942c7 100644 --- a/neph.yml +++ b/neph.yml @@ -98,6 +98,7 @@ go: - gorilla-mux - fasthttprouter - iris + - gin echo: command: | @@ -132,6 +133,14 @@ fasthttprouter: dir: go/fasthttprouter +gin: + command: | + go get github.com/gin-gonic/gin + go build -o server_go_gin main.go + ln -s -f ../go/iris/server_go_gin ../../bin/. + dir: + go/gin + rust: depends_on: - iron diff --git a/tools/src/benchmarker.cr b/tools/src/benchmarker.cr index 58c3a03564f..2ace681422e 100644 --- a/tools/src/benchmarker.cr +++ b/tools/src/benchmarker.cr @@ -23,6 +23,7 @@ LANGS = [ {name: "gorilla_mux", repo: "gorilla/mux"}, {name: "iris", repo: "kataras/iris"}, {name: "fasthttprouter", repo: "buaazp/fasthttprouter"}, + {name: "gin", repo: "gin-gonic/gin"} ]}, {lang: "rust", targets: [ {name: "iron", repo: "iron/iron"},