1
0
mirror of https://github.com/labstack/echo.git synced 2025-07-05 00:58:47 +02:00

fixed docs

Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana
2016-11-14 23:54:21 -08:00
parent c5a3575d4c
commit 43e95a6924
6 changed files with 26 additions and 70 deletions

View File

@ -9,10 +9,7 @@ Example:
"net/http"
"github.com/labstack/echo"
"github.com/labstack/echo/engine/standard"
"github.com/labstack/echo/middleware"
"net"
"net"
)
// Handler

View File

@ -1,8 +0,0 @@
+++
title = "engine"
[menu.side]
name = "engine"
parent = "godoc"
weight = 3
url = "https://godoc.org/github.com/labstack/echo/engine"
+++

View File

@ -1,8 +0,0 @@
+++
title = "fasthttp"
[menu.side]
name = "engine/fasthttp"
parent = "godoc"
weight = 5
url = "https://godoc.org/github.com/labstack/echo/engine/fasthttp"
+++

View File

@ -4,6 +4,6 @@ title = "middleware"
name = "middleware"
identifier = "godoc-middleware"
parent = "godoc"
weight = 1
weight = 2
url = "https://godoc.org/github.com/labstack/echo/middleware"
+++

View File

@ -1,8 +0,0 @@
+++
title = "standard"
[menu.side]
name = "engine/standard"
parent = "godoc"
weight = 4
url = "https://godoc.org/github.com/labstack/echo/engine/standard"
+++

View File

@ -12,8 +12,8 @@ description = "Context in Echo"
`echo.Context` represents the context of the current HTTP request. It holds request and
response reference, path, path parameters, data, registered handler and APIs to read
request and write response. Context is 100% compatible with standard `context.Context`.
As Context is an interface, it is easy to extend it with custom APIs.
request and write response. As Context is an interface, it is easy to extend it with
custom APIs.
#### Extending Context
@ -56,20 +56,3 @@ e.GET("/", func(c echo.Context) error {
return cc.String(200, "OK")
})
```
### Standard Context
`echo.Context` embeds standard `context.Context` interface, so all it's functions
are available right from `echo.Context`.
*Example*
```go
e.GET("/users/:name", func(c echo.Context) error) {
c.SetContext(context.WithValue(nil, "key", "val"))
// Pass it down...
// Use it...
val := c.Value("key").(string)
return c.String(http.StatusOK, name)
})
```