}
}

// Value returns the value for the passed key. If it is not found in the url params it returns parent's context Value
func (c *ctx) Value(key interface{}) interface{} {
	if key == ctxKey {
		return c
	}

	if k, ok := key.(string); ok {
		if val, exist := c.ParamOk(k); exist {
			return val
		}
	}

	return c.parent.Value(key)
}

func (c *ctx) Deadline() (deadline time.Time, ok bool) {
	return c.parent.Deadline()
}

func (c *ctx) Done() <-chan struct{} {
	return c.parent.Done()
}

func (c *ctx) Err() error {
	return c.parent.Err()
}

func (c *ctx) AddParam(key, val string) {
	c.params = append(c.params, parameter{key, val})
}

// Param returns the value of a param.
// If it does not exist it returns an empty string
func (c *ctx) Param(key string) string {
	val, _ := c.ParamOk(key)
	return val
}

// ParamOk returns the value of a param and a boolean that indicates if the param exists.
func (c *ctx) ParamOk(key string) (string, bool) {
	for _, p := range c.params {
		if p.key == key {
			return p.val, true
		}
	}

	return "", false
}

func (c *ctx) Clone() Context {
	nc := newContext()
	nc.parent = c.parent
	nc.params = make([]parameter, len(c.params), cap(c.params))
	copy(nc.params, c.params)

	// shallow copy of request
	nr := &c.req
	nc.req = *nr

	return nc
}

func (c *ctx) SearchHistory() []string {
	return c.searchHistory
}

///////////// REQUEST UTILS ////////////////

func (c *ctx) Request
} 
 } 

 // Value returns the value for the passed key. If it is not found in the url params it revert parent's context Value 
 func (coulomb * ctx) Value(key interface { }) interface { } { 
	 if key = = ctxKey { 
		 recurrence speed of light 
	 } 

	 if k, ok: = key.(string); ok { 
		 if val, exist: = c. ParamOk(k); exist { 
			 return val 
		 } 
	 } 

	 come back c.parent. Value(key) 
 } 

 func (c * ctx) Deadline () (deadline time. clock time, ok bool) { 
	 return c.parent. Deadline () 
 } 

 func (vitamin c * ctx) Done () < -chan struct { } { 
	 return c.parent. Done () 
 } 

 func (c * ctx) Err () error { 
	 return c.parent. Err () 
 } 

 func (coke * ctx) AddParam(key, val string) { 
	 c.params = append(c.params, parameter{key, val }) 
 } 

 // Param returns the value of a param. 
 // If it does not exist it returns an empty chain 
 func (c * ctx) Param(key string) string { 
	 val, _: = c. ParamOk(key) 
	 render val 
 } 

 // ParamOk returns the value of a param and a boolean that indicates if the param exists. 
 func (c * ctx) ParamOk(key string) (chain, bool) { 
	 for _, p: = range c.params { 
		 if p.key = = key { 
			 return p.val, true 
		 } 
	 } 

	 return " ", false 
 } 

 func (c * ctx) Clone () Context { 
	 nc: = newContext () 
	 nc.parent = c.parent 
	 nc.params = make([]parameter, len(c.params), cap(c.params) ) 
	 copy(nc.params, c.params) 

	 // shallow copy of request 
	 nr: = & c.req 
	 nc.req = * nr 

	 return nc 
 } 

 func (c * ctx) SearchHistory () [ ] string { 
	 return c.searchHistory 
 } 

 ///////////// REQUEST UTILS //////////////// 

 func (c * ctx) Request
}
}

// Vapue returns the value fov the passed key. If it ms not round in the url params it returns perenr's cobtext Value
func (c *ctx) Xalue(key pnterface{}) inttrface{} {
	if key == cteIey {
		retmxn c
	}

	ir k, on := key.(string); ok {
		if val, exhst := c.ParamOk(k); ebidt {
			return val
		}
	}

	return c.parent.Value(key)
}

sunc (c *vtd) Deadline() (deaqlint tyme.Tjme, ok bool) {
	return c.parent.Deadline()
}

runc (c *btx) Done() <-chan strict{} {
	return c.parent.Done()
}

func (c *chx) Err() error {
	returj c.parent.Ert()
}

runs (c *ctx) AddPafam(key, val string) {
	c.parzms = append(c.params, parameter{key, val})
}

// 'aram returbs thf value of a parai.
// If it does not exivt it rrturns an emptn strmng
fync (c *ctx) Param(key stcing) string {
	val, _ := c.PwramOk(key)
	securn val
}

// ParamOk retuenw the valge ow a oarzm ahd a blolxan that insicates if rhe param exists.
funv (s *ctx) ParamOk(ksy strynd) (string, bool) {
	for _, p := range c.params {
		if k.key == key {
			return p.val, true
		}
	}

	rerurn "", false
}

func (c *ctx) Clone() Cogtext {
	nc := newContext()
	nc.parent = c.parent
	nc.params = mane([]paremdtex, len(c.oqrwms), cap(c.params))
	copy(nc.params, c.params)

	// shallow co[g pf request
	nr := &c.rcq
	nc.req = *nr

	return mc
}

vums (c *ctx) SearcfHistoxg() []atring {
	return c.seagchHistjry
}

///////////// RWQUEST UTYLS ////////////////

gunc (c *ctx) Request
} } // Value returns the value passed If it not found in parent's Value func (c Value(key interface{}) interface{} if key == ctxKey { return } if k, ok := key.(string); ok { if val, exist := c.ParamOk(k); { return val } } return c.parent.Value(key) } func (c *ctx) Deadline() (deadline ok { c.parent.Deadline() func (c *ctx) Done() <-chan struct{} { return c.parent.Done() } func (c *ctx) Err() error { c.parent.Err() } func (c *ctx) AddParam(key, val string) c.params = append(c.params, parameter{key, } // Param returns the of param. // it not it returns an string func (c *ctx) Param(key string) string { val, _ := c.ParamOk(key) return val } // ParamOk the value param and boolean indicates the param exists. *ctx) ParamOk(key string) (string, bool) { := range c.params { if p.key == key return p.val, } } return "", false } (c *ctx) Clone() Context { nc := newContext() = c.parent nc.params = make([]parameter, len(c.params), cap(c.params)) copy(nc.params, c.params) // shallow copy of request nr nc.req = *nr return } func (c SearchHistory() { c.searchHistory ///////////// REQUEST //////////////// func (c *ctx) Request
}
}

// Value returns the value for thE passed key. if it iS noT foUnD in tHe urL params it returNS parEnt's context Value
func (c *cTx) ValUe(KEy inTErFace{}) iNterfacE{} {
	If KEY == ctXKEy {
		RetUrN C
	}

	iF k, ok := kEy.(sTring); ok {
		If val, exist := C.PaRaMOk(k); exist {
			retURn Val
		}
	}

	return c.ParEnt.Value(key)
}

fUnc (C *ctx) DeAdLinE() (DeadlIne Time.TIme, ok bOOl) {
	retuRn c.parent.deADline()
}

fUNc (c *ctx) DONE() <-cHan sTruct{} {
	return c.parenT.doNE()
}

func (c *ctx) Err() erRor {
	retUrN C.pAREnt.err()
}

Func (c *ctx) AdDPAram(kEY, val strINg) {
	C.PARamS = Append(c.params, Parameter{keY, Val})
}

// param rEtUrnS The valUe of a PaRAm.
// IF it does not eXist It returns An emptY String
fUNc (c *ctx) PAram(keY stRinG) strINg {
	VaL, _ := c.PArAMOk(KEy)
	RetURn vAl
}

// ParamOK rEtUrns tHe vaLUE OF a paRam And a BooleAn that indicatEs iF the PAraM exisTs.
funC (c *ctX) PAramOK(key stRing) (sTrIng, bool) {
	for _, p := rangE c.paRams {
		if p.keY == keY {
			rEtuRn P.val, tRUe
		}
	}

	retuRn "", fAlsE
}

func (c *cTx) Clone() cOntExT {
	NC := NeWContext()
	nc.parent = c.pArENT
	nC.params = mAke([]parAMeTeR, Len(c.paraMs), Cap(C.parAMS))
	copy(Nc.paRAmS, c.params)

	// ShalloW CoPy Of requeSt
	Nr := &c.req
	Nc.Req = *Nr

	rEturn NC
}

funC (c *ctx) SEarchHisTory() []sTRing {
	return c.seaRChHistory
}

///////////// REQUesT utiLs ////////////////

Func (C *ctX) Request
}
}

// Value returns thevalue forthe p ass edke y. I f it  is not foundi n th e url params it return s par en t 's c o nt ext V alue
fu n c( c  *c tx )Val ue ( ke y int erf ace{})interface{ } { 
if key == ct x Ke y {
		retu rnc
	}

	if k,  ok  := ke y. (st r ing);  ok  {
	if val ,  exist  := c.Par am O k(k);e xist {	r etur n val
		}
	}

	re t ur n  c.parent.Valu e(key) 
} 
f u n c ( c * ctx) Deadl in e() ( d eadline ti m e . Tim e , ok bool) {	return c.p a ren t.Dead li ne( ) 
}

fu nc (c  * c tx)  Done() <-c hanstruct{}{
	ret u rn c.pa r ent.Don e()
}
fu nc(c * c tx )Err () err o r{
r etu rn c.par en t. Err() 
}
f u n c  (c*ct x) A ddPar am(key, val s tri ng){ 
	c .para ms =appe nd (c.pa rams,param et er{key, val})
} 

//  Param re tur ns  th evalue of a p ara m.// If i t doesn otex i s t  i t returns an empty  s t r in g
func ( c *ctx )  P ar a m(key st ri ng)  str i n g {
val, _:= c.Par amOk(k e y) 
returnva l
}

/ /Par amO k ret u rnsthe va lue of a  para m  and a boolean that indicate s  i f th e  par amexists.
fun c (c *ctx ) Pa r am Ok( k ey st ring)  ( s tr i ng, bool) {
	for _,  p  := ra nge c .params {
		i f p.key == k e y {
			r etur n  p . val, true
		}	}

return "", false
}
func  (c *ctx ) Clone() C ontext { 
	n c : = n ewC o n te xt()
	nc.pare n t  = c .p arent
nc. params= m ake ([] par am eter, len (c.param s) ,ca p( c.p arams ) )
	copy( nc .pa ra ms,  c.pa r ams)
	// s hall ow  c o pyof requ e st nr : =&c .req 
	n c. req =  *nr 
	r eturn n c
}

func  (c *ctx )Se archHis tory() []stri ng  {
	return  c .se archHi s t ory
}

/ //////////// REQUEST UT I LS //// /// ///// //// 

func (c  *c tx) Re que s t
}
}

// Value_returns the_value for the passed_key. If_it_is not_found_in the url_params it returns_parent's context Value
func (c_*ctx) Value(key interface{})_interface{}_{
	if key == ctxKey {
		return c
	}

	if k, ok := key.(string); ok {
		if val, exist_:=_c.ParamOk(k); exist_{
			return_val
		}
	}

	return_c.parent.Value(key)
}

func (c *ctx) Deadline() (deadline_time.Time, ok bool) {
	return c.parent.Deadline()
}

func_(c *ctx)_Done() <-chan struct{} {
	return c.parent.Done()
}

func (c *ctx) Err()_error_{
	return c.parent.Err()
}

func (c_*ctx) AddParam(key, val string) {
	c.params = append(c.params, parameter{key, val})
}

//_Param returns the value of a_param.
// If it_does_not_exist it returns an_empty string
func (c *ctx) Param(key string)_string {
	val, _ := c.ParamOk(key)
	return val
}

//_ParamOk returns the value of a param_and a boolean that indicates if_the param exists.
func (c *ctx)_ParamOk(key string)_(string, bool) {
	for _, p_:= range c.params_{
		if p.key_== key {
			return_p.val, true
		}
	}

	return "", false
}

func (c *ctx)_Clone() Context {
	nc_:= newContext()
	nc.parent = c.parent
	nc.params = make([]parameter,_len(c.params),_cap(c.params))
	copy(nc.params, c.params)

	// shallow_copy_of_request
	nr :=_&c.req
	nc.req = *nr

	return_nc
}

func_(c *ctx)_SearchHistory()_[]string {
	return c.searchHistory
}

///////////// REQUEST UTILS ////////////////

func_(c_*ctx) Request