Conversation
# Conflicts: # _examples/basic/main.go # _examples/go.mod # _examples/go.sum # chirouter/wrapper.go # go.sum # request/decoder.go # web/service.go
# Conflicts: # _examples/go.mod # _examples/go.sum # go.mod # go.sum # response/gzip/middleware.go
Lines Of Code
|
Go API Changes# github.com/swaggest/rest/chirouter
## incompatible changes
(*Wrapper).Connect: changed from func(string, net/http.HandlerFunc) to func(string, github.com/swaggest/fchi.Handler)
(*Wrapper).Delete: changed from func(string, net/http.HandlerFunc) to func(string, github.com/swaggest/fchi.Handler)
(*Wrapper).Get: changed from func(string, net/http.HandlerFunc) to func(string, github.com/swaggest/fchi.Handler)
(*Wrapper).Head: changed from func(string, net/http.HandlerFunc) to func(string, github.com/swaggest/fchi.Handler)
(*Wrapper).MethodFunc: removed
(*Wrapper).Options: changed from func(string, net/http.HandlerFunc) to func(string, github.com/swaggest/fchi.Handler)
(*Wrapper).Patch: changed from func(string, net/http.HandlerFunc) to func(string, github.com/swaggest/fchi.Handler)
(*Wrapper).Post: changed from func(string, net/http.HandlerFunc) to func(string, github.com/swaggest/fchi.Handler)
(*Wrapper).Put: changed from func(string, net/http.HandlerFunc) to func(string, github.com/swaggest/fchi.Handler)
(*Wrapper).Trace: changed from func(string, net/http.HandlerFunc) to func(string, github.com/swaggest/fchi.Handler)
Handler.ServeHTTP: changed from func(net/http.ResponseWriter, *net/http.Request) to func(context.Context, *github.com/valyala/fasthttp.RequestCtx)
PathToURLValues: changed from func(*net/http.Request) (net/url.Values, error) to func(*github.com/valyala/fasthttp.RequestCtx, net/url.Values) error
Router.HandleFunc, method set of *Wrapper: removed
Router.HandleFunc, method set of Wrapper: removed
Router.MethodNotAllowed: changed from func(net/http.HandlerFunc) to func(github.com/swaggest/fchi.Handler)
Router.NotFound: changed from func(net/http.HandlerFunc) to func(github.com/swaggest/fchi.Handler)
# github.com/swaggest/rest/nethttp
## incompatible changes
(*Handler).ServeHTTP: changed from func(net/http.ResponseWriter, *net/http.Request) to func(context.Context, *github.com/valyala/fasthttp.RequestCtx)
Handler.HandleErrResponse: changed from func(net/http.ResponseWriter, *net/http.Request, error) to func(context.Context, *github.com/valyala/fasthttp.RequestCtx, error)
RequestDecoder.Decode: changed from func(*net/http.Request, interface{}, github.com/swaggest/rest.Validator) error to func(*github.com/valyala/fasthttp.RequestCtx, interface{}, github.com/swaggest/rest.Validator) error
ResponseEncoder.MakeOutput: changed from func(net/http.ResponseWriter, github.com/swaggest/rest.HandlerTrait) interface{} to func(*github.com/valyala/fasthttp.RequestCtx, github.com/swaggest/rest.HandlerTrait) interface{}
ResponseEncoder.WriteErrResponse: changed from func(net/http.ResponseWriter, *net/http.Request, int, interface{}) to func(*github.com/valyala/fasthttp.RequestCtx, int, interface{})
ResponseEncoder.WriteSuccessfulResponse: changed from func(net/http.ResponseWriter, *net/http.Request, interface{}, github.com/swaggest/rest.HandlerTrait) to func(*github.com/valyala/fasthttp.RequestCtx, interface{}, github.com/swaggest/rest.HandlerTrait)
# github.com/swaggest/rest/openapi
## incompatible changes
(*Collector).ServeHTTP: changed from func(net/http.ResponseWriter, *net/http.Request) to func(context.Context, *github.com/valyala/fasthttp.RequestCtx)
# github.com/swaggest/rest/request
## incompatible changes
(*DecoderFactory).SetDecoderFunc: changed from func(github.com/swaggest/rest.ParamIn, func(r *net/http.Request) (net/url.Values, error)) to func(github.com/swaggest/rest.ParamIn, func(rc *github.com/valyala/fasthttp.RequestCtx, v net/url.Values) error)
DecoderFunc.Decode: changed from func(*net/http.Request, interface{}, github.com/swaggest/rest.Validator) error to func(*github.com/valyala/fasthttp.RequestCtx, interface{}, github.com/swaggest/rest.Validator) error
DecoderFunc: changed from func(*net/http.Request, interface{}, github.com/swaggest/rest.Validator) error to func(*github.com/valyala/fasthttp.RequestCtx, interface{}, github.com/swaggest/rest.Validator) error
Loader.LoadFromFastHTTPRequest: added
Loader.LoadFromHTTPRequest: removed
# github.com/swaggest/rest/response
## incompatible changes
(*Encoder).MakeOutput: changed from func(net/http.ResponseWriter, github.com/swaggest/rest.HandlerTrait) interface{} to func(*github.com/valyala/fasthttp.RequestCtx, github.com/swaggest/rest.HandlerTrait) interface{}
(*Encoder).WriteErrResponse: changed from func(net/http.ResponseWriter, *net/http.Request, int, interface{}) to func(*github.com/valyala/fasthttp.RequestCtx, int, interface{})
(*Encoder).WriteSuccessfulResponse: changed from func(net/http.ResponseWriter, *net/http.Request, interface{}, github.com/swaggest/rest.HandlerTrait) to func(*github.com/valyala/fasthttp.RequestCtx, interface{}, github.com/swaggest/rest.HandlerTrait)
# github.com/swaggest/rest/resttest
## incompatible changes
package removed
# github.com/swaggest/rest/web
## incompatible changes
(*Wrapper).Connect: changed from func(string, net/http.HandlerFunc) to func(string, github.com/swaggest/fchi.Handler)
(*Wrapper).MethodFunc, method set of *Service: removed
(*Wrapper).MethodFunc, method set of Service: removed
Handler.ServeHTTP: changed from func(net/http.ResponseWriter, *net/http.Request) to func(context.Context, *github.com/valyala/fasthttp.RequestCtx)
Router.HandleFunc, method set of *Service: removed
Router.HandleFunc, method set of Service: removed
Router.MethodNotAllowed: changed from func(net/http.HandlerFunc) to func(github.com/swaggest/fchi.Handler)
Router.NotFound: changed from func(net/http.HandlerFunc) to func(github.com/swaggest/fchi.Handler)
# summary
Inferred base version: v0.2.28
Suggested version: v0.3.0
|
Unit Test Coveragetotal: (statements) 83.5% Coverage of changed lines
Coverage diff with base branch
|
Codecov Report
@@ Coverage Diff @@
## master #78 +/- ##
==========================================
+ Coverage 76.96% 77.81% +0.84%
==========================================
Files 27 26 -1
Lines 1385 1325 -60
==========================================
- Hits 1066 1031 -35
+ Misses 206 189 -17
+ Partials 113 105 -8
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
Benchmark ResultBenchmark diff with base branchBenchmark result |
Examples Benchmark ResultBenchmark diff with base branch |
# Conflicts: # .github/workflows/test-unit.yml # _examples/advanced-generic/router.go # _examples/go.mod # _examples/go.sum # chirouter/path_decoder.go # go.mod # go.sum # gzip/container_test.go # request/file_test.go
# Conflicts: # .github/workflows/test-unit.yml # _examples/advanced-generic/gzip_pass_through_test.go # _examples/advanced-generic/router.go # go.mod # go.sum
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR changes
net/httptogithub.com/valyala/fasthttpto serve as a base for a maintable separate fork once it is ready.Additional goal of this PR is to measure performance difference and keep feature parity with original implementation.
It is not intended to be merged.