mirror of
https://github.com/kataras/iris.git
synced 2025-02-02 15:30:36 +01:00
Remove the golang.org/x/net/context
This commit is contained in:
parent
1a9102706b
commit
7f5fd1904b
|
@ -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).
|
||||
|
||||
- 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
|
||||
|
||||
|
|
33
context.go
33
context.go
|
@ -8,7 +8,6 @@ package iris
|
|||
import (
|
||||
"reflect"
|
||||
"runtime"
|
||||
"time"
|
||||
|
||||
"github.com/kataras/iris/context"
|
||||
"github.com/kataras/iris/sessions/store"
|
||||
|
@ -65,38 +64,6 @@ func (ctx *Context) GetRequestCtx() *fasthttp.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
|
||||
// the context is ready-to-use after that, just like a new Context
|
||||
// I use it for zero rellocation memory
|
||||
|
|
|
@ -8,13 +8,11 @@ import (
|
|||
|
||||
"github.com/kataras/iris/sessions/store"
|
||||
"github.com/valyala/fasthttp"
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
|
||||
type (
|
||||
// IContext the interface for the Context
|
||||
IContext interface {
|
||||
context.Context
|
||||
IContextRenderer
|
||||
IContextStorage
|
||||
IContextBinder
|
||||
|
|
Loading…
Reference in New Issue
Block a user