Skip to content
This repository has been archived by the owner on Jul 23, 2020. It is now read-only.

Commit

Permalink
Add Context
Browse files Browse the repository at this point in the history
Requested by @spawn2kill in PR #6, however there was no issue
and no instructions for testing. This is being put through in
a separate commit to speed up the feedback cycle given all the
comments and two commits which need to be squashed, this seems
faster.

Closes: #6

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
  • Loading branch information
alexellis committed Apr 4, 2020
1 parent 70701da commit d9259e3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions handler.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package handler

import (
"context"
"net/http"
)

Expand All @@ -24,6 +25,12 @@ type Request struct {
QueryString string
Method string
Host string
ctx context.Context
}

// Context is set for optional cancellation inflight requests.
func (r *Request) Context() context.Context {
return r.ctx
}

// FunctionHandler used for a serverless Go method invocation
Expand Down

0 comments on commit d9259e3

Please sign in to comment.