Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: zipper support middleware #660

Merged
merged 13 commits into from
Oct 30, 2023
Merged

feat: zipper support middleware #660

merged 13 commits into from
Oct 30, 2023

Conversation

woorui
Copy link
Collaborator

@woorui woorui commented Oct 26, 2023

Description

Adding WithConnMiddleware() and WithFrameMiddleware() zipper option, their type is below:

type (
	// FrameHandler handles a frame.
	FrameHandler func(*Context)
	// FrameMiddleware is a middleware for frame handler.
	FrameMiddleware func(FrameHandler) FrameHandler
)

type (
	// ConnHandler handles a connection and route.
	ConnHandler func(*Connection, router.Route)
	// ConnMiddleware is a middleware for connection handler.
	ConnMiddleware func(ConnHandler) ConnHandler
)

@woorui woorui self-assigned this Oct 26, 2023
@vercel
Copy link

vercel bot commented Oct 26, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
yomo ⬜️ Ignored (Inspect) Visit Preview Oct 30, 2023 7:00am

@codecov
Copy link

codecov bot commented Oct 26, 2023

Codecov Report

Merging #660 (7805bf5) into master (92b21e7) will decrease coverage by 0.88%.
The diff coverage is 75.37%.

@@            Coverage Diff             @@
##           master     #660      +/-   ##
==========================================
- Coverage   59.93%   59.05%   -0.88%     
==========================================
  Files          36       36              
  Lines        2673     2672       -1     
==========================================
- Hits         1602     1578      -24     
- Misses        972      999      +27     
+ Partials       99       95       -4     
Files Coverage Δ
core/connector.go 100.00% <100.00%> (ø)
core/server_options.go 83.33% <100.00%> (+3.92%) ⬆️
zipper.go 74.28% <100.00%> (-0.72%) ⬇️
core/connection.go 94.44% <94.44%> (+1.11%) ⬆️
core/context.go 39.72% <64.28%> (-26.13%) ⬇️
options.go 67.44% <0.00%> (-15.42%) ⬇️
core/server.go 69.85% <73.97%> (-0.01%) ⬇️

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

core/server_options.go Outdated Show resolved Hide resolved
core/server_options.go Outdated Show resolved Hide resolved
options.go Outdated Show resolved Hide resolved
options.go Outdated Show resolved Hide resolved
core/server_options.go Outdated Show resolved Hide resolved
@woorui woorui requested a review from venjiang October 30, 2023 03:09
@woorui woorui merged commit 1754f26 into master Oct 30, 2023
3 of 5 checks passed
@woorui woorui deleted the feat/middleware branch October 30, 2023 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants