File tree 1 file changed +20
-0
lines changed
1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -528,6 +528,26 @@ func (ctx *Context) Status(status int) {
528
528
ctx .Resp .WriteHeader (status )
529
529
}
530
530
531
+ // Deadline is part of the interface for context.Context and we pass this to the request context
532
+ func (ctx * Context ) Deadline () (deadline time.Time , ok bool ) {
533
+ return ctx .Req .Context ().Deadline ()
534
+ }
535
+
536
+ // Done is part of the interface for context.Context and we pass this to the request context
537
+ func (ctx * Context ) Done () <- chan struct {} {
538
+ return ctx .Req .Context ().Done ()
539
+ }
540
+
541
+ // Err is part of the interface for context.Context and we pass this to the request context
542
+ func (ctx * Context ) Err () error {
543
+ return ctx .Req .Context ().Err ()
544
+ }
545
+
546
+ // Value is part of the interface for context.Context and we pass this to the request context
547
+ func (ctx * Context ) Value (key interface {}) interface {} {
548
+ return ctx .Req .Context ().Value (key )
549
+ }
550
+
531
551
// Handler represents a custom handler
532
552
type Handler func (* Context )
533
553
You can’t perform that action at this time.
0 commit comments