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: add WithServer option #25

Merged
merged 1 commit into from
Nov 14, 2024
Merged

feat: add WithServer option #25

merged 1 commit into from
Nov 14, 2024

Conversation

haysons
Copy link
Contributor

@haysons haysons commented Nov 2, 2024

  • Add WithServer function in options.go
  • Add appendExistHTTPServer function to Graceful struct in graceful.go
  • Add tests for TestWithServer functions in graceful_test.go

I hope for a more convenient and comprehensive way to customize http.Server.
Configuring each property of http.Server individually can be quite cumbersome,
and passing both gin.Engine and http.Server into Graceful aligns well with Graceful's intended purpose.

Copy link
Contributor

@cedric-appdirect cedric-appdirect left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, should have been an option from the beginning. Good catch.

@codecov-commenter
Copy link

codecov-commenter commented Nov 14, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 83.33333% with 3 lines in your changes missing coverage. Please review.

Project coverage is 76.98%. Comparing base (00fab28) to head (0b897ff).
Report is 19 commits behind head on master.

Files with missing lines Patch % Lines
options.go 75.00% 2 Missing and 1 partial ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #25      +/-   ##
==========================================
+ Coverage   76.49%   76.98%   +0.48%     
==========================================
  Files           2        2              
  Lines         234      252      +18     
==========================================
+ Hits          179      194      +15     
- Misses         37       39       +2     
- Partials       18       19       +1     
Flag Coverage Δ
go- ?
go-1.20 76.98% <83.33%> (+0.48%) ⬆️
go-1.21 76.98% <83.33%> (+0.48%) ⬆️
go-1.22 76.98% <83.33%> (?)
go-1.23 76.98% <83.33%> (?)
macos-latest ?
ubuntu-latest 76.98% <83.33%> (+0.48%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@appleboy appleboy merged commit fff4bf9 into gin-contrib:master Nov 14, 2024
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants