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: [#504] Route supports configure timeout #97

Merged
merged 32 commits into from
Oct 28, 2024
Merged
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
8bd8af2
Update context.go
KlassnayaAfrodita Oct 9, 2024
6e09e22
Update context_test.go
KlassnayaAfrodita Oct 10, 2024
25ba222
Update route.go
KlassnayaAfrodita Oct 11, 2024
c7f81ea
Create timeoutMiddleware.go
KlassnayaAfrodita Oct 13, 2024
4963969
Update route.go
KlassnayaAfrodita Oct 13, 2024
c0c1222
Update timeoutMiddleware.go
KlassnayaAfrodita Oct 13, 2024
d890362
Update timeoutMiddleware.go
KlassnayaAfrodita Oct 13, 2024
b3a3267
Update route.go
KlassnayaAfrodita Oct 13, 2024
11475d3
Update route.go
KlassnayaAfrodita Oct 13, 2024
94b45f0
Update timeoutMiddleware.go
KlassnayaAfrodita Oct 13, 2024
4ec125d
Update timeoutMiddleware.go
KlassnayaAfrodita Oct 15, 2024
02287ab
Rename timeoutMiddleware.go to timeout_middleware.go
KlassnayaAfrodita Oct 15, 2024
e920b4a
Rename tls.go to tls_middleware.go
KlassnayaAfrodita Oct 15, 2024
c07c05d
Update timeout_middleware.go
KlassnayaAfrodita Oct 15, 2024
9a463c5
Update timeout_middleware.go
KlassnayaAfrodita Oct 16, 2024
3e30263
Update timeout_middleware.go
KlassnayaAfrodita Oct 17, 2024
0fa7a3c
Update route.go
KlassnayaAfrodita Oct 17, 2024
53e56ac
Update route_test.go
KlassnayaAfrodita Oct 17, 2024
f3c2a10
Update route_test.go
KlassnayaAfrodita Oct 18, 2024
ec3ded3
Update route_test.go
KlassnayaAfrodita Oct 18, 2024
22e1c33
Update route_test.go
KlassnayaAfrodita Oct 19, 2024
087bf1b
Update timeout_middleware.go
KlassnayaAfrodita Oct 24, 2024
86f5d3b
Update route.go
KlassnayaAfrodita Oct 24, 2024
18ee0ea
Update route_test.go
KlassnayaAfrodita Oct 24, 2024
ec70760
Update route_test.go
KlassnayaAfrodita Oct 24, 2024
c67ff88
Update timeout_middleware.go
KlassnayaAfrodita Oct 24, 2024
051970a
Update timeout_middleware.go
KlassnayaAfrodita Oct 24, 2024
66aa240
Update route_test.go
KlassnayaAfrodita Oct 25, 2024
7a0668e
optimize timeout middleware
hwbrzzl Oct 25, 2024
b4c16c6
Merge pull request #1 from KlassnayaAfrodita/bowen/timeout-middleware
KlassnayaAfrodita Oct 26, 2024
8fd8b39
Merge branch 'master' into patch-1
KlassnayaAfrodita Oct 26, 2024
49bbdd6
Update middleware_timeout_test.go
KlassnayaAfrodita Oct 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions context.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ func (c *Context) WithValue(key any, value any) {
c.instance.Set(goravelContextKey, goravelCtx)
}

func (c *Context) WithContext(ctx context.Context) {
// Changing the request context to a new context
c.instance.Request = c.instance.Request.WithContext(ctx)
}

func (c *Context) Context() context.Context { return c }

func (c *Context) Deadline() (deadline time.Time, ok bool) {
Expand Down
Loading