Skip to content

Commit

Permalink
Fixed labstack#399
Browse files Browse the repository at this point in the history
Signed-off-by: Vishal Rana <[email protected]>
  • Loading branch information
vishr committed Mar 14, 2016
1 parent b9ac79d commit abc669b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 16 deletions.
36 changes: 21 additions & 15 deletions context.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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{}
Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion glide.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit abc669b

Please sign in to comment.