Skip to content

Commit f414535

Browse files
authored
updated docs, readme and benchmark tests (#718)
* updated docs, readme and benchmark tests Signed-off-by: Vishal Rana <[email protected]> * fixed #719 Signed-off-by: Vishal Rana <[email protected]>
1 parent a96c564 commit f414535

File tree

6 files changed

+402
-248
lines changed

6 files changed

+402
-248
lines changed

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# [Echo](http://labstack.com/echo) [![GoDoc](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](http://godoc.org/github.com/labstack/echo) [![License](http://img.shields.io/badge/license-mit-blue.svg?style=flat-square)](https://raw.githubusercontent.com/labstack/echo/master/LICENSE) [![Build Status](http://img.shields.io/travis/labstack/echo.svg?style=flat-square)](https://travis-ci.org/labstack/echo) [![Coverage Status](http://img.shields.io/coveralls/labstack/echo.svg?style=flat-square)](https://coveralls.io/r/labstack/echo) [![Join the chat at https://gitter.im/labstack/echo](https://img.shields.io/badge/gitter-join%20chat-brightgreen.svg?style=flat-square)](https://gitter.im/labstack/echo) [![Twitter](https://img.shields.io/badge/[email protected]?style=flat-square)](https://twitter.com/labstack)
1+
# [Echo v3] (https://echo.labstack.com) [![GoDoc](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](http://godoc.org/github.com/labstack/echo) [![License](http://img.shields.io/badge/license-mit-blue.svg?style=flat-square)](https://raw.githubusercontent.com/labstack/echo/master/LICENSE) [![Build Status](http://img.shields.io/travis/labstack/echo.svg?style=flat-square)](https://travis-ci.org/labstack/echo) [![Coverage Status](http://img.shields.io/coveralls/labstack/echo.svg?style=flat-square)](https://coveralls.io/r/labstack/echo) [![Join the chat at https://gitter.im/labstack/echo](https://img.shields.io/badge/gitter-join%20chat-brightgreen.svg?style=flat-square)](https://gitter.im/labstack/echo) [![Twitter](https://img.shields.io/badge/[email protected]?style=flat-square)](https://twitter.com/labstack)
22

3-
#### Fast and unfancy HTTP server framework for Go (Golang). Up to 10x faster than the rest.
3+
## Fast and unfancy HTTP server framework for Go (Golang).
44

55
## Feature Overview
66

@@ -26,7 +26,7 @@
2626
- Test Suite: https://github.com/vishr/web-framework-benchmark
2727
- Date: 4/4/2016
2828

29-
![Performance](https://i.imgur.com/fZVnK52.png)
29+
![Performance](http://i.imgur.com/F2V7TfO.png)
3030

3131
## Quick Start
3232

@@ -266,7 +266,6 @@ Middleware | Description
266266
[Secure](https://echo.labstack.com/middleware/secure) | Protection against attacks
267267
[CORS](https://echo.labstack.com/middleware/cors) | Cross-Origin Resource Sharing
268268
[CSRF](https://echo.labstack.com/middleware/csrf) | Cross-Site Request Forgery
269-
[Static](https://echo.labstack.com/middleware/static) | Serve static files
270269
[HTTPSRedirect](https://echo.labstack.com/middleware/redirect#httpsredirect-middleware) | Redirect HTTP requests to HTTPS
271270
[HTTPSWWWRedirect](https://echo.labstack.com/middleware/redirect#httpswwwredirect-middleware) | Redirect HTTP requests to WWW HTTPS
272271
[WWWRedirect](https://echo.labstack.com/middleware/redirect#wwwredirect-middleware) | Redirect non WWW requests to WWW

echo.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Example:
1111
"github.com/labstack/echo"
1212
"github.com/labstack/echo/engine/standard"
1313
"github.com/labstack/echo/middleware"
14+
"net"
15+
"net"
1416
)
1517
1618
// Handler
@@ -523,8 +525,7 @@ func (e *Echo) StartTLS(address string, certFile, keyFile string) (err error) {
523525
}
524526

525527
// StartAutoTLS starts the HTTPS server using certificates automatically from https://letsencrypt.org.
526-
func (e *Echo) StartAutoTLS(hosts []string, cacheFile string) (err error) {
527-
address := ":443"
528+
func (e *Echo) StartAutoTLS(address string, hosts []string, cacheFile string) (err error) {
528529
config := new(tls.Config)
529530
config.GetCertificate = e.tlsManager.GetCertificate
530531
e.tlsManager.SetHosts(hosts) // Added security
@@ -573,11 +574,10 @@ func (e *Echo) ShutdownTLS(timeout time.Duration) {
573574
}
574575

575576
// NewHTTPError creates a new HTTPError instance.
576-
func NewHTTPError(code int, msg ...string) *HTTPError {
577+
func NewHTTPError(code int, msg ...interface{}) *HTTPError {
577578
he := &HTTPError{Code: code, Message: http.StatusText(code)}
578579
if len(msg) > 0 {
579-
m := msg[0]
580-
he.Message = m
580+
he.Message = fmt.Sprint(msg...)
581581
}
582582
return he
583583
}

0 commit comments

Comments
 (0)