- All the pseudocode below assumes ctx have these types:
func handler(ctx *fasthttp.RequestCtx){..}
->
func handler(
c context.Context
ctx *app.RequestContext
){..}
-
ctx.FormFile -> ctx.FormFile
-
ctx.FormValue -> ctx.FormValue
-
ctx.Hijack -> ctx.Hijack
-
ctx.Hijacked -> ctx.Hijacked
-
ctx.Host -> ctx.Host
-
ctx.IfModifiedSince -> ctx.IfModifiedSince
-
ctx.IsGet -> ctx.IsGet
-
ctx.IsHead -> ctx.IsHead
-
ctx.IsPost -> ctx.IsPost
-
ctx.Method -> ctx.Method
-
ctx.MultipartForm -> ctx.MultipartForm
-
ctx.NotFound -> ctx.NotFound
-
ctx.NotModified -> ctx.NotModified
-
ctx.Path -> ctx.Path
-
ctx.PostArgs -> ctx.PostArgs
-
ctx.PostBody -> ctx.Request.Body
-
ctx.QueryArgs -> ctx.QueryArgs
-
ctx.RequestBodyStream -> ctx.RequestBodyStream
-
ctx.RemoteAddr -> ctx.RemoteAddr
-
ctx.SetBodyStream -> ctx.SetBodyStream
-
ctx.SetBodyString -> ctx.SetBodyString
-
ctx.SetConnectionClose -> ctx.SetConnectionClose
-
ctx.SetContentType -> ctx.SetContentType
-
ctx.SetContentTypeBytes -> ctx.SetContentTypeBytes
-
ctx.SetStatusCode -> ctx.SetStatusCode
-
ctx.URI -> ctx.URI
-
ctx.UserAgent -> ctx.UserAgent
-
ctx.Write -> ctx.Write
-
ctx.WriteString -> ctx.WriteString
-
ctx.Deadline -> c.Deadline
-
ctx.Done -> c.Done
-
ctx.Err -> c.Err
-
ctx.Value -> c.Value
-
ctx.Conn -> ctx.GetConn()
-
ctx.Error -> ctx.AboutWithMsg
-
ctx.IsBodyStream -> ctx.Request.IsBodyStream
-
ctx.IsConnect -> ctx.Request.Header.IsConnect
-
ctx.IsDelete -> ctx.Request.Header.IsDelete
-
ctx.IsOptions -> ctx.Request.Header.IsOptions
-
ctx.IsPatch -> ctx.Method() == "patch"
-
ctx.IsPut -> ctx.Request.Header.IsPut
-
ctx.IsTrace -> ctx.Request.Header.IsTrace
-
ctx.LocalAddr -> ctx.GetConn().LocalAddr
-
ctx.LocalIP -> ctx.GetConn().LocalAddr
-
ctx.Redirect -> ctx.Redirect
-
ctx.RedirectBytes -> ctx.Redirect
-
ctx.Referer -> ctx.Request.Header.Get("referer")
-
ctx.RemoteIP -> ctx.ClientIP
-
ctx.RemoveUserValue -> use ctx.Keys directly
-
ctx.RemoveUserValueBytes -> use ctx.Keys directly
-
ctx.RequestURI -> ctx.Request.Header.RequestURI
-
ctx.ResetBody -> ctx.Response.ResetBody
-
ctx.ResetUserValues -> use ctx.Keys directly
-
ctx.SendFile -> app.ServeFile(c, path)
-
ctx.SendFileBytes -> app.ServeFile(c, path)
-
ctx.SetBody -> ctx.Response.SetBody
-
ctx.SetUserValue -> ctx.Set
-
ctx.SetUserValueBytes -> ctx.Set
-
ctx.Success -> ctx.SetContentType + ctx.SetBodyString
-
ctx.SuccessString -> ctx.SetContentType + ctx.SetBodyString
-
ctx.UserValue -> ctx.Value
-
ctx.UserValueBytes -> ctx.Value
-
ctx.VisitUserValues -> use ctx.Keys directly
-
ctx.VisitUserValuesAll -> use ctx.Keys directly
-
ctx.Logger -> pkg/common/hlog
-
ctx.ID -> RequestID
-
ctx.ConnID
-
ctx.ConnRequestNum
-
ctx.ConnTime
-
ctx.HijackSetNoResponse
-
ctx.Init
-
ctx.Init2
-
ctx.LastTimeoutErrorResponse
-
ctx.IsTLS
-
ctx.SetBodyStreamWriter
-
ctx.SetRemoteAddr
-
ctx.TLSConnectionState
-
ctx.Time
-
ctx.TimeoutError
-
ctx.TimeoutErrorWithCode
-
ctx.TimeoutErrorWithResponse
-
req.AppendBody -> req.AppendBody
-
req.AppendBodyString -> req.AppendBodyString
-
req.Body -> req.Body
-
req.BodyWriteTo -> req.BodyWriteTo
-
req.BodyWriter -> req.BodyWriter
-
req.ConnectionClose -> req.ConnectionClose
-
req.CopyTo -> req.CopyTo
-
req.Host -> req.Host
-
req.IsBodyStream -> req.IsBodyStream
-
req.MayContinue -> req.MayContinue
-
req.MultipartForm -> req.MultipartForm
-
req.PostArgs -> req.PostArgs
-
req.RemoveMultipartFormFiles -> req.RemoveMultipartFormFiles
-
req.RequestURI -> req.RequestURI
-
req.Reset -> req.Reset
-
req.ResetBody -> req.ResetBody
-
req.SetBody -> req.SetBody
-
req.SetBodyRaw -> req.SetBodyRaw
-
req.SetBodyStream -> req.SetBodyStream
-
req.SetBodyString -> req.SetBodyString
-
req.SetHost -> req.SetHost
-
req.SetRequestURI -> req.SetRequestURI
-
req.SwapBody -> req.SwapBody
-
req.URI -> req.URI
-
req.SetTimeout -> use DoTimeout directly
-
req.SetHostBytes -> req.SetHost
-
req.SetRequestURIBytes -> req.SetRequestURI
- req.BodyGunzip -> gzip
-
req.BodyInflate ->
-
req.BodyUnbrotli ->
-
req.BodyUncompressed ->
-
req.ContinueReadBody ->
-
req.ContinueReadBodyStream ->
-
req.Read ->
-
req.ReadBody ->
-
req.ReadLimitBody ->
-
req.ReleaseBody ->
-
req.SetBodyStreamWriter ->
-
req.SetURI ->
-
req.Write ->
-
req.WriteTo ->
-
h.Add -> h.Add
-
h.AppendBytes -> h.AppendBytes
-
h.ConnectionClose -> h.ConnectionClose
-
h.ContentLength -> h.ContentLength
-
h.ContentType -> h.ContentType
-
h.Cookie -> h.Cookie
-
h.CopyTo -> h.CopyTo
-
h.DelAllCookies -> h.DelAllCookies
-
h.DelBytes -> h.DelBytes
-
h.DelCookie -> h.DelCookie
-
h.DisableNormalizing -> h.DisableNormalizing
-
h.HasAcceptEncoding -> h.HasAcceptEncodingBytes
-
h.HasAcceptEncodingBytes -> h.HasAcceptEncodingBytes
-
h.Header -> h.Header
-
h.Host -> h.Host
-
h.IsConnect -> h.IsConnect
-
h.IsDelete -> h.IsDelete
-
h.IsGet -> h.IsGet
-
h.IsHTTP11 -> h.IsHTTP11
-
h.IsHead -> h.IsHead
-
h.IsOptions -> h.IsOptions
-
h.IsPost -> h.IsPost
-
h.IsPut -> h.IsPut
-
h.IsTrace -> h.IsTrace
-
h.Len -> h.Len
-
h.Method -> h.Method
-
h.MultipartFormBoundary -> h.MultipartFormBoundary
-
h.Peek -> h.Peek
-
h.RawHeaders -> h.RawHeaders
-
h.RequestURI -> h.RequestURI
-
h.Reset -> h.Reset
-
h.ResetConnectionClose -> h.ResetConnectionClose
-
h.Set -> h.Set
-
h.SetByteRange -> h.SetByteRange
-
h.SetBytesKV -> h.SetBytesKV
-
h.SetCanonical -> h.SetCanonical
-
h.SetConnectionClose -> h.SetConnectionClose
-
h.SetContentLength -> h.SetContentLength
-
h.SetContentTypeBytes -> h.SetContentTypeBytes
-
h.SetCookie -> h.SetCookie
-
h.SetHost -> h.SetHost
-
h.SetHostBytes -> h.SetHostBytes
-
h.SetMethod -> h.SetMethod
-
h.SetMethodBytes -> h.SetMethodBytes
-
h.SetMultipartFormBoundary -> h.SetMultipartFormBoundary
-
h.SetMultipartFormBoundaryBytes -> h.SetMultipartFormBoundary
-
h.SetNoDefaultContentType -> h.SetNoDefaultContentType
-
h.SetProtocol -> h.SetProtocol
-
h.SetRequestURI -> h.SetRequestURI
-
h.SetRequestURIBytes -> h.SetRequestURIBytes
-
h.SetUserAgentBytes -> h.SetUserAgentBytes
-
h.UserAgent -> h.UserAgent
-
h.VisitAll -> h.VisitAll
-
h.VisitAllCookie -> h.VisitAllCookie
-
h.AddBytesK -> h.Add
-
h.AddBytesKV -> h.Add
-
h.AddBytesV -> h.Add
-
h.CookieBytes -> h.Cookie
-
h.Del -> h.DelBytes
-
h.DelCookieBytes -> h.DelCookie
-
h.IsPatch -> h.Method() == "patch"
-
h.PeekBytes -> h.Peek
-
h.Protocol -> h.GetProtocol
-
h.SetBytesK -> h.Set
-
h.SetBytesV -> h.Set
-
h.SetContentType -> h.SetContentTypeBytes
-
h.SetCookieBytesK -> h.SetCookie
-
h.SetCookieBytesKV -> h.SetCookie
-
h.SetProtocolBytes -> h.SetProtocol
-
h.SetUserAgent -> h.SetUserAgentBytes
-
h.AddTrailer
-
h.AddTrailerBytes
-
h.ConnectionUpgrade
-
h.ContentEncoding
-
h.EnableNormalizing
-
h.PeekAll
-
h.PeekKeys
-
h.PeekTrailerKeys
-
h.Read
-
h.ReadTrailer
-
h.Referer
-
h.SetContentEncoding
-
h.SetContentEncodingBytes
-
h.SetRefererBytes
-
h.SetTrailer
-
h.SetTrailerBytes
-
h.TrailerHeader
-
h.VisitAllInOrder
-
h.VisitAllTrailer
-
h.Write
-
h.WriteTo
-
resp.AppendBody -> resp.AppendBody
-
resp.AppendBodyString -> resp.AppendBodyString
-
resp.Body -> resp.Body
-
resp.BodyGunzip -> resp.BodyGunzip
-
resp.BodyWriteTo -> resp.BodyWriteTo
-
resp.BodyWriter -> resp.BodyWriter
-
resp.ConnectionClose -> resp.ConnectionClose
-
resp.CopyTo -> resp.CopyTo
-
resp.IsBodyStream -> resp.IsBodyStream
-
resp.LocalAddr -> resp.LocalAddr
-
resp.RemoteAddr -> resp.RemoteAddr
-
resp.Reset -> resp.Reset
-
resp.ResetBody -> resp.ResetBody
-
resp.SetBody -> resp.SetBody
-
resp.SetBodyRaw -> resp.SetBodyRaw
-
resp.SetBodyStream -> resp.SetBodyStream
-
resp.SetBodyString -> resp.SetBodyString
-
resp.SetConnectionClose -> resp.SetConnectionClose
-
resp.SetStatusCode -> resp.SetStatusCode
-
resp.StatusCode -> resp.StatusCode
-
resp.BodyInflate ->
-
resp.BodyUnbrotli ->
-
resp.BodyUncompressed ->
-
resp.Read ->
-
resp.ReadBody ->
-
resp.ReadLimitBody ->
-
resp.ReleaseBody ->
-
resp.SendFile ->
-
resp.SetBodyStreamWriter ->
-
resp.SwapBody ->
-
resp.Write ->
-
resp.WriteDeflate ->
-
resp.WriteDeflateLevel ->
-
resp.WriteGzip ->
-
resp.WriteGzipLevel ->
-
resp.WriteTo ->
-
h.Add -> h.Add
-
h.AppendBytes -> h.AppendBytes
-
h.ConnectionClose -> h.ConnectionClose
-
h.ContentLength -> h.ContentLength
-
h.ContentType -> h.ContentType
-
h.Cookie -> h.Cookie
-
h.CopyTo -> h.CopyTo
-
h.Del -> h.Del
-
h.DelAllCookies -> h.DelAllCookies
-
h.DelBytes -> h.DelBytes
-
h.DelClientCookie -> h.DelClientCookie
-
h.DelClientCookieBytes -> h.DelClientCookieBytes
-
h.DelCookie -> h.DelCookie
-
h.DelCookieBytes -> h.DelCookieBytes
-
h.DisableNormalizing -> h.DisableNormalizing
-
h.Header -> h.Header
-
h.IsHTTP11 -> h.IsHTTP11
-
h.Len -> h.Len
-
h.Peek -> h.Peek
-
h.Reset -> h.Reset
-
h.ResetConnectionClose -> h.ResetConnectionClose
-
h.Server -> h.Server
-
h.Set -> h.Set
-
h.SetBytesV -> h.SetBytesV
-
h.SetCanonical -> h.SetCanonical
-
h.SetConnectionClose -> h.SetConnectionClose
-
h.SetContentEncoding
-
h.SetContentEncodingBytes
-
h.SetContentLength -> h.SetContentLength
-
h.SetContentRange -> h.SetContentRange
-
h.SetContentType -> h.SetContentType
-
h.SetContentTypeBytes -> h.SetContentTypeBytes
-
h.SetCookie -> h.SetCookie
-
h.SetNoDefaultContentType -> h.SetNoDefaultContentType
-
h.SetServerBytes -> h.SetServerBytes
-
h.SetStatusCode -> h.SetStatusCode
-
h.StatusCode -> h.StatusCode
-
h.VisitAll -> h.VisitAll
-
h.VisitAllCookie -> h.VisitAllCookie
-
h.AddBytesK -> h.Add
-
h.AddBytesKV -> h.Add
-
h.addBytesV -> h.Add
-
h.PeekBytes -> h.Peek
-
h.SetBytesK -> h.Set
-
h.SetBytesKV -> h.Set
-
h.SetServer -> h.SetServerBytes
-
h.SetLastModified -> h.Set
-
h.SetProtocol -> h.Set
-
h.AddTrailer
-
h.AddTrailerBytes
-
h.ConnectionUpgrade
-
h.ContentEncoding
-
h.EnableNormalizing
-
h.PeekAll
-
h.PeekKeys
-
h.PeekTrailerKeys
-
h.Protocol
-
h.Read
-
h.ReadTrailer
-
h.SetStatusMessage
-
h.SetTrailer
-
h.SetTrailerBytes
-
h.StatusMessage
-
h.TrailerHeader
-
h.VisitAllTrailer
-
h.Write
-
h.WriteTo