-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhandle.go
39 lines (32 loc) · 844 Bytes
/
handle.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package function
import (
"context"
"fmt"
"github.com/cloudevents/sdk-go/v2/event"
)
// Handle an event.
func Handle(ctx context.Context, e event.Event) (*event.Event, error) {
/*
* YOUR CODE HERE
*
* Try running `go test`. Add more test as you code in `handle_test.go`.
*/
fmt.Println("Received event")
fmt.Println(e) // echo to local output
return &e, nil // echo to caller
}
/*
Other supported function signatures:
Handle()
Handle() error
Handle(context.Context)
Handle(context.Context) error
Handle(event.Event)
Handle(event.Event) error
Handle(context.Context, event.Event)
Handle(context.Context, event.Event) error
Handle(event.Event) *event.Event
Handle(event.Event) (*event.Event, error)
Handle(context.Context, event.Event) *event.Event
Handle(context.Context, event.Event) (*event.Event, error)
*/