mirror of
https://github.com/kataras/iris.git
synced 2025-12-24 05:17:03 +00:00
❤️ awesome and unique features for end-developers are coming...
total refactor of the hero and mvc packages, see README#Next (it's not completed yet) Former-commit-id: b85ae99cbfe5965ba919c1e15cf4989e787982c0
This commit is contained in:
29
_benchmarks/_internal/vNext/di.go
Normal file
29
_benchmarks/_internal/vNext/di.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/kataras/iris/v12"
|
||||
)
|
||||
|
||||
type (
|
||||
testInput struct {
|
||||
Email string `json:"email"`
|
||||
}
|
||||
|
||||
testOutput struct {
|
||||
ID int `json:"id"`
|
||||
Name string `json:"name"`
|
||||
}
|
||||
)
|
||||
|
||||
func handler(id int, in testInput) testOutput {
|
||||
return testOutput{
|
||||
ID: id,
|
||||
Name: in.Email,
|
||||
}
|
||||
}
|
||||
|
||||
func main() {
|
||||
app := iris.New()
|
||||
app.HandleFunc(iris.MethodPost, "/{id:int}", handler)
|
||||
app.Listen(":5000", iris.WithOptimizations)
|
||||
}
|
||||
Reference in New Issue
Block a user