88type handlerFunc func (ctx * Context ) error
99
1010type Context struct {
11- ctx * fasthttp.RequestCtx
11+ Ctx * fasthttp.RequestCtx
1212 params map [string ]string
1313 paramValues []string
1414 handlers []handlerFunc
@@ -18,7 +18,7 @@ type Context struct {
1818// NewContext returns a new Context.
1919func NewContext (ctx * fasthttp.RequestCtx , params map [string ]string ) * Context {
2020 return & Context {
21- ctx : ctx ,
21+ Ctx : ctx ,
2222 params : params ,
2323 paramValues : make ([]string , 0 , 10 ),
2424 handlers : nil ,
@@ -28,7 +28,7 @@ func NewContext(ctx *fasthttp.RequestCtx, params map[string]string) *Context {
2828
2929// Context returns the fasthttp.RequestCtx
3030func (c * Context ) Context () * fasthttp.RequestCtx {
31- return c .ctx
31+ return c .Ctx
3232}
3333
3434// WithParams sets the params for the context.
@@ -44,23 +44,23 @@ func (c *Context) Param(key string) string {
4444
4545// String sets the response body to the given string.
4646func (c * Context ) String (value string ) {
47- if c .ctx .Response .Body () == nil {
48- c .ctx .Response .SetBodyString (value )
47+ if c .Ctx .Response .Body () == nil {
48+ c .Ctx .Response .SetBodyString (value )
4949 } else {
50- buf := bytes .NewBuffer (c .ctx .Response .Body ())
50+ buf := bytes .NewBuffer (c .Ctx .Response .Body ())
5151 buf .WriteString (value )
52- c .ctx .Response .SetBody (buf .Bytes ())
52+ c .Ctx .Response .SetBody (buf .Bytes ())
5353 }
5454}
5555
5656// SetData sets the http header value to the given key.
5757func (c * Context ) SetData (key string , value interface {}) {
58- c .ctx .Response .Header .Set (key , value .(string ))
58+ c .Ctx .Response .Header .Set (key , value .(string ))
5959}
6060
6161// GetData returns the http header value for the given key.
6262func (c * Context ) GetData (key string ) string {
63- return string (c .ctx .Response .Header .Peek (key ))
63+ return string (c .Ctx .Response .Header .Peek (key ))
6464}
6565
6666// Next calls the next handler in the chain.
0 commit comments