- package models
- // HTTPError a silly structure to keep our error page data.
- type HTTPError struct {
- Title string
- Code int
- }
- package controllers
- import "github.com/kataras/iris/mvc"
- type IndexController struct{ mvc.Controller }
- func (c *IndexController) Get() {
- c.Data["Title"] = "Home Page"
- c.Tmpl = "index.html"
- }
- /*
- ../netcore-mvc-templates/wwwroot/css
- ../netcore-mvc-templates/wwwroot/images
- ../netcore-mvc-templates/wwwroot/js
- ../netcore-mvc-templates/wwwroot/lib
- ../netcore-mvc-templates/wwwroot/favicon.ico
- views/shared/layout.html
- views/shared/error.html
- views/about.html
- views/contact.html
- views/index.html
- These files are quite long to be shown in this article but you can view them at:
- https://github.com/kataras/iris/tree/master/_benchmarks/iris-mvc-templates
- */
运行 Go 办事项目:
运行 HTTP 基准对象:
- Bombarding http://localhost:5000 with 1000000 requests using 125 connections
- 1000000 / 1000000 [======================================================] 100.00% 37s
- Done!
- Statistics Avg Stdev Max
- Reqs/sec 26656.76 1944.73 31188
- Latency 4.69ms 1.20ms 22.52ms
- HTTP codes:
- 1xx — 0, 2xx — 1000000, 3xx — 0, 4xx — 0, 5xx — 0
- others — 0
- Throughput: 192.51MB/s
- $ cd iris-mvc-templates
- $ go run main.go
- Now listening
推荐阅读
SQL Server 2017正式发布;Oracle宣布开源Fn project
SQL Server 2017 正式宣布:同时支撑 Windows 和 Linux微软在客岁 3 月初次对外宣布了 Linux 版的 SQL Server,痊愈本年 7 月宣布了首个公开 RC 版。前几日在美国奥兰多召开的微软 Ignit>>>详细阅读
地址:http://www.17bianji.com/lsqh/37756.html
1/2 1

网友点评
精彩导读
科技快报
品牌展示