Skip to content

Latest commit

 

History

History
688 lines (348 loc) · 30.3 KB

fasthttp_to_hertz.md

File metadata and controls

688 lines (348 loc) · 30.3 KB

FastHTTP -> Hertz conversion table

  • All the pseudocode below assumes ctx have these types:
func handler(ctx *fasthttp.RequestCtx){..}
->
func handler(
    c context.Context
    ctx *app.RequestContext
){..}

No Changed Function

context.Context Interface

  • ctx.Deadline -> c.Deadline

  • ctx.Done -> c.Done

  • ctx.Err -> c.Err

  • ctx.Value -> c.Value

Need Change Function

Need Another Library

Unimplemented function

  • 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

No Changed Function

Need Change Function

Need Another Library

  • req.BodyGunzip -> gzip

Unimplement Function

  • 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 ->

No Changed Function

Need Change Function

Unimplement Function

  • 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

No Changed Function

Unimplement Function

  • 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 ->

No Changed Function

Need Change Function

Unimplement Function

  • 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