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: refactor and improve HTTP server handling #9

Merged
merged 3 commits into from
Nov 25, 2023
Merged

feat: refactor and improve HTTP server handling #9

merged 3 commits into from
Nov 25, 2023

Conversation

appleboy
Copy link
Member

  • Add type definitions for listenAndServe and cleanup in graceful.go
  • Add appendHTTPServer function to Graceful struct in graceful.go
  • Change appendHttpServer function to appendHTTPServer in graceful.go
  • Add ReadHeaderTimeout field to http.Server struct in appendHTTPServer function in graceful.go
  • Add tests for TestCycle, TestWithFd, TestWithContext, and TestRunFd functions in graceful_test.go
  • Change variable names and function calls in TestCycle, TestWithFd, TestWithContext, and TestRunFd functions in graceful_test.go
  • Add code for loading PEM file and creating certificate pool in testRequest function in graceful_test.go
  • Change InsecureSkipVerify field to RootCAs and add MinVersion field in testRequest function in graceful_test.go
  • Change variable names and function calls in testRequest function in graceful_test.go
  • Change variable names and function calls in WithAddr and WithTLS functions in options.go
  • Change variable names and function calls in listen function in options.go
  • Modify cert.pem and key.pem files in testdata/certificate directory

- Add type definitions for `listenAndServe` and `cleanup` in `graceful.go`
- Add `appendHTTPServer` function to `Graceful` struct in `graceful.go`
- Change `appendHttpServer` function to `appendHTTPServer` in `graceful.go`
- Add `ReadHeaderTimeout` field to `http.Server` struct in `appendHTTPServer` function in `graceful.go`
- Add tests for `TestCycle`, `TestWithFd`, `TestWithContext`, and `TestRunFd` functions in `graceful_test.go`
- Change variable names and function calls in `TestCycle`, `TestWithFd`, `TestWithContext`, and `TestRunFd` functions in `graceful_test.go`
- Add code for loading PEM file and creating certificate pool in `testRequest` function in `graceful_test.go`
- Change `InsecureSkipVerify` field to `RootCAs` and add `MinVersion` field in `testRequest` function in `graceful_test.go`
- Change variable names and function calls in `testRequest` function in `graceful_test.go`
- Change variable names and function calls in `WithAddr` and `WithTLS` functions in `options.go`
- Change variable names and function calls in `listen` function in `options.go`
- Modify `cert.pem` and `key.pem` files in `testdata/certificate` directory

Signed-off-by: Bo-Yi Wu <[email protected]>
- Update the Go version in the go.mod file from 1.20 to 1.18

Signed-off-by: Bo-Yi Wu <[email protected]>
- Update the `go-version` in the GitHub workflow from `^1.16` to `^1.21`
- Update the `go` version in the GitHub workflow from `[1.18, 1.19, "1.20", 1.21]` to `["1.20", 1.21]`
- Update the `go` version in the `go.mod` file from `go 1.18` to `go 1.20`

Signed-off-by: Bo-Yi Wu <[email protected]>
@codecov-commenter
Copy link

codecov-commenter commented Nov 25, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

❗ No coverage uploaded for pull request base (master@4a6271f). Click here to learn what that means.

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

Additional details and impacted files
@@            Coverage Diff            @@
##             master       #9   +/-   ##
=========================================
  Coverage          ?   77.83%           
=========================================
  Files             ?        2           
  Lines             ?      212           
  Branches          ?        0           
=========================================
  Hits              ?      165           
  Misses            ?       32           
  Partials          ?       15           
Flag Coverage Δ
go- 77.83% <0.00%> (?)
go-1.20 77.83% <0.00%> (?)
go-1.21 77.83% <0.00%> (?)
macos-latest 77.83% <0.00%> (?)
ubuntu-latest 77.83% <0.00%> (?)

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 2119bdc into master Nov 25, 2023
6 checks passed
@appleboy appleboy deleted the lint branch November 25, 2023 14:32
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.

2 participants