Repository navigation
feat(echo)!: support Echo v5 as module github.com/rennf93/echo-guard/v2 - #52
Merged
Merged
Conversation
Port the adapter, tests, examples, docs and CI to github.com/labstack/echo/v5 v5.4.0. The module path gains the /v2 suffix because the public types change (echo.MiddlewareFunc, echo.HandlerFunc and *echo.Context). Echo v4 users stay on v1.x. The guard-core-go/v4 v4.4.0 floor is unchanged.
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.
Closes #51
master moves to Echo v5 as module
github.com/rennf93/echo-guard/v2. Echo v4 users stay on v1.x. Branchv1is at v1.5.0 plus CI bumps (5070976).Forced signature changes. Every other exported identifier is unchanged.
New(engine, opts...)returns Echo v5'secho.MiddlewareFunc.GuardWebSocket(engine, c)takes*echo.Context.NewStatusHandler(engine)returns Echo v5'secho.HandlerFunc.AddStatusRoute(app, engine, path)takes Echo v5's*echo.Echo.Behavior notes:
c.Error, so a handler error goes throughc.Echo().HTTPErrorHandlerbefore the status is read, the same order v1.5.0 used.*echo.Responsewithecho.UnwrapResponse(echo v5.4.0response.go:121) and swaps the capture and held writers underneath it.*echo.Response, or a handler error on a context without an Echo instance, fails closed with the 500Security check failedresponse. Two new tests cover these paths.Verified locally:
gofmt -l .prints nothing, andgo vet ./...andstaticcheck ./...pass.REDIS_HOST=127.0.0.1 go test -tags integration -coverprofile=cover.out .givesok ... coverage: 100.0% of statements, andcheck_coverage.shgivescoverage 100%.make lintexits 0.govulncheck ./...on Go 1.27.2:No vulnerabilities found.