We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 387ac89 commit fb4cb6fCopy full SHA for fb4cb6f
lambda/entry.go
@@ -53,9 +53,7 @@ func StartHandler(handler Handler) {
53
if err != nil {
54
log.Fatal(err)
55
}
56
- function := new(Function)
57
- function.handler = handler
58
- err = rpc.Register(function)
+ err = rpc.Register(NewFunction(handler))
59
60
log.Fatal("failed to register handler function")
61
lambda/function.go
@@ -16,6 +16,10 @@ type Function struct {
16
handler Handler
17
18
19
+func NewFunction(handler Handler) *Function {
20
+ return &Function{handler: handler}
21
+}
22
+
23
func (fn *Function) Ping(req *messages.PingRequest, response *messages.PingResponse) error {
24
*response = messages.PingResponse{}
25
return nil
0 commit comments