func (c *Context) Deadline() (deadline time.Time, ok bool) {
	return c.Request.Context().Deadline()
}
Deadline returns the time when work done on behalf of this context
should be canceled. Deadline returns ok==false when no deadline is
set. Successive calls to Deadline return the same results.
package context
import (
	"context"
	"net/http"
	"net/url"
	"time"
	"gopkg.in/h2non/gentleman.v2/utils"
)
var Key interface{} = "$gentleman"
type Store map[interface{}]interface{}
type Context struct {
	Error error
	Stopped bool
	Parent *Context
	Client *http.Client
	Request *http.Request
	Response *http.Response
}
func New() *Context {
	req := createRequest()
	res := createResponse(req)
	cli := &http.Client{Transport: http.DefaultTransport}
	return &Context{Request: req, Response: res, Client: cli}
}
func (c *Context) getStore() Store {
	store, ok := c.Request.Context().Value(Key).(Store)
	if !ok {
		panic("invalid request context")
	}
	return store
}
func (c *Context) Set(key interface{}, value interface{}) {
	store := c.getStore()
	store[key] = value
}
func (c *Context) Get(key interface{}) interface{} {
	store := c.getStore()
	if store == nil {
		return store
	}
	if value, ok := store[key]; ok {
		return value
	}
	if c.Parent != nil {
		return c.Parent.Get(key)
	}
	return nil
}
func (c *Context) GetOk(key interface{}) (interface{}, bool) {
	store := c.getStore()
	val, ok := store[key]
	if !ok {
		if c.Parent != nil {
			return c.Parent.GetOk(key)
		}
	}
	return val, ok
}
func (c *Context) GetInt(key interface{}) (int, bool) {
	value, ok := c.GetOk(key)
	if !ok {
		if c.Parent != nil {
			return c.Parent.GetInt(key)
		}
	}
	if num, ok := value.(int); ok {
		return num, ok
	}
	return 0, false
}
func (c *Context) GetString(key interface{}) string {
	store := c.getStore()
	if value, ok := store[key]; ok {
		if typed, ok := value.(string); ok {
			return typed
		}
	}
	if c.Parent != nil {
		return c.Parent.GetString(key)
	}
	return ""
}
func (c *Context) GetAll() Store {
	buf := Store{}
	for key, value := range c.getStore() {
		buf[key] = value
	}
	if c.Parent != nil {
		for key, value := range c.Parent.GetAll() {
			buf[key] = value
		}
	}
	return buf
}
func (c *Context) Delete(key interface{}) {
	delete(c.getStore(), key)
}
func (c *Context) Clear() {
	store := c.getStore()
	for key := range store {
		delete(store, key)
	}
}
func (c *Context) UseParent(ctx *Context) {
	c.Parent = ctx
}
func (c *Context) Root() *Context {
	if c.Parent != nil {
		return c.Parent.Root()
	}
	return c
}
func (c *Context) SetRequest(req *http.Request) {
	c.Request = req.WithContext(c.Request.Context())
}
func (c *Context) Clone() *Context {
	ctx := new(Context)
	*ctx = *c
	req := new(http.Request)
	*req = *c.Request
	ctx.Request = req
	c.CopyTo(ctx)
	res := new(http.Response)
	*res = *c.Response
	ctx.Response = res
	return ctx
}
func (c *Context) CopyTo(newCtx *Context) {
	store := Store{}
	for key, value := range c.getStore() {
		store[key] = value
	}
	ctx := context.WithValue(context.Background(), Key, store)
	newCtx.Request = newCtx.Request.WithContext(ctx)
}