Remove the golang.org/x/net/context

This commit is contained in:
Makis Maropoulos 2016-06-04 23:33:34 +03:00
parent 1a9102706b
commit 7f5fd1904b
3 changed files with 2 additions and 35 deletions

View File

@ -6,6 +6,8 @@
- NEW: Implement feature request [#165](https://github.com/kataras/iris/issues/165). Routes can now be selected by `a custom name`, and this allows us to use the {{ url "custom-name" "any" "named" "parameters"}}`` inside HTMLEngine's templates. Example [here](https://github.com/iris-contrib/examples/tree/master/templates_9). - NEW: Implement feature request [#165](https://github.com/kataras/iris/issues/165). Routes can now be selected by `a custom name`, and this allows us to use the {{ url "custom-name" "any" "named" "parameters"}}`` inside HTMLEngine's templates. Example [here](https://github.com/iris-contrib/examples/tree/master/templates_9).
- Remove the [x/net/context](https://godoc.org/golang.org/x/net/context), it has been useless after v2.
## 3.0.0-alpha.beta -> 3.0.0-beta ## 3.0.0-alpha.beta -> 3.0.0-beta

View File

@ -8,7 +8,6 @@ package iris
import ( import (
"reflect" "reflect"
"runtime" "runtime"
"time"
"github.com/kataras/iris/context" "github.com/kataras/iris/context"
"github.com/kataras/iris/sessions/store" "github.com/kataras/iris/sessions/store"
@ -65,38 +64,6 @@ func (ctx *Context) GetRequestCtx() *fasthttp.RequestCtx {
return ctx.RequestCtx return ctx.RequestCtx
} }
// Implement the golang.org/x/net/context , as requested by the community, which is used inside app engine
// also this will give me the ability to use appengine's memcache with this context, if this needed.
// Deadline returns the time when this Context will be canceled, if any.
func (ctx *Context) Deadline() (deadline time.Time, ok bool) {
return
}
// Done returns a channel that is closed when this Context is canceled
// or times out.
func (ctx *Context) Done() <-chan struct{} {
return nil
}
// Err indicates why this context was canceled, after the Done channel
// is closed.
func (ctx *Context) Err() error {
return nil
}
// Value returns the value associated with key or nil if none.
func (ctx *Context) Value(key interface{}) interface{} {
if key == 0 {
return ctx.Request
}
if keyAsString, ok := key.(string); ok {
val := ctx.GetString(keyAsString)
return val
}
return nil
}
// Reset resets the Context with a given domain.Response and domain.Request // Reset resets the Context with a given domain.Response and domain.Request
// the context is ready-to-use after that, just like a new Context // the context is ready-to-use after that, just like a new Context
// I use it for zero rellocation memory // I use it for zero rellocation memory

View File

@ -8,13 +8,11 @@ import (
"github.com/kataras/iris/sessions/store" "github.com/kataras/iris/sessions/store"
"github.com/valyala/fasthttp" "github.com/valyala/fasthttp"
"golang.org/x/net/context"
) )
type ( type (
// IContext the interface for the Context // IContext the interface for the Context
IContext interface { IContext interface {
context.Context
IContextRenderer IContextRenderer
IContextStorage IContextStorage
IContextBinder IContextBinder