mirror of
https://github.com/labstack/echo.git
synced 2024-12-24 20:14:31 +02:00
parent
b9ac79d9d4
commit
abc669bd07
36
context.go
36
context.go
@ -26,6 +26,7 @@ type (
|
||||
// response objects, path parameters, data and registered handler.
|
||||
Context interface {
|
||||
netContext.Context
|
||||
SetNetContext(netContext.Context)
|
||||
Request() engine.Request
|
||||
Response() engine.Response
|
||||
Path() string
|
||||
@ -57,15 +58,16 @@ type (
|
||||
}
|
||||
|
||||
context struct {
|
||||
request engine.Request
|
||||
response engine.Response
|
||||
path string
|
||||
pnames []string
|
||||
pvalues []string
|
||||
query url.Values
|
||||
store store
|
||||
handler Handler
|
||||
echo *Echo
|
||||
netContext netContext.Context
|
||||
request engine.Request
|
||||
response engine.Response
|
||||
path string
|
||||
pnames []string
|
||||
pvalues []string
|
||||
query url.Values
|
||||
store store
|
||||
handler Handler
|
||||
echo *Echo
|
||||
}
|
||||
|
||||
store map[string]interface{}
|
||||
@ -87,24 +89,28 @@ func NewContext(req engine.Request, res engine.Response, e *Echo) Context {
|
||||
}
|
||||
}
|
||||
|
||||
func (c *context) Handle(ctx Context) error {
|
||||
return c.handler.Handle(ctx)
|
||||
func (c *context) SetNetContext(ctx netContext.Context) {
|
||||
c.netContext = ctx
|
||||
}
|
||||
|
||||
func (c *context) Deadline() (deadline time.Time, ok bool) {
|
||||
return
|
||||
return c.netContext.Deadline()
|
||||
}
|
||||
|
||||
func (c *context) Done() <-chan struct{} {
|
||||
return nil
|
||||
return c.netContext.Done()
|
||||
}
|
||||
|
||||
func (c *context) Err() error {
|
||||
return nil
|
||||
return c.netContext.Err()
|
||||
}
|
||||
|
||||
func (c *context) Value(key interface{}) interface{} {
|
||||
return nil
|
||||
return c.netContext.Value(key)
|
||||
}
|
||||
|
||||
func (c *context) Handle(ctx Context) error {
|
||||
return c.handler.Handle(ctx)
|
||||
}
|
||||
|
||||
// Request returns *http.Request.
|
||||
|
2
glide.lock
generated
2
glide.lock
generated
@ -1,5 +1,5 @@
|
||||
hash: f220137e9ccd9aaf3051be33c3c23ea8abd2c40df6cf96175c3994d482b5e007
|
||||
updated: 2016-03-13T09:34:16.391046379-07:00
|
||||
updated: 2016-03-14T08:16:01.763706114-07:00
|
||||
imports:
|
||||
- name: github.com/klauspost/compress
|
||||
version: 006acde2c5d283d2f8b8aa03d8f0cd2891c680cf
|
||||
|
Loading…
Reference in New Issue
Block a user