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

Commit 575927e

Browse files
committed
Initial
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
0 parents  commit 575927e

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

handler.go

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package handler
2+
3+
import (
4+
"net/http"
5+
)
6+
7+
// Response of function call
8+
type Response struct {
9+
10+
// Body the body will be written back
11+
Body []byte
12+
13+
// StatusCode needs to be populated with value such as http.StatusOK
14+
StatusCode int
15+
16+
// Header is optional and contains any additional headers the function response should set
17+
Header http.Header
18+
}
19+
20+
// Request of function call
21+
type Request struct {
22+
Body []byte
23+
Header http.Header
24+
QueryString string
25+
}
26+
27+
// Handler used for a serverless Go method invocation
28+
type Handler interface {
29+
Handle(req Request) (Response, error)
30+
}
31+
32+
func init() {
33+
34+
}

0 commit comments

Comments
 (0)