-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
30 lines (24 loc) · 835 Bytes
/
main.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
package main
import (
dc "example-go-component/internal/edgee/protocols/data-collection"
"go.bytecodealliance.org/cm"
)
// you should not need to modify this file
// this is a wrapper around the actual implementation located in component.go
type Result = cm.Result[dc.EdgeeRequestShape, dc.EdgeeRequest, string]
func resultWrapper(request dc.EdgeeRequest) (result Result) {
return cm.OK[Result](request)
}
func init() {
dc.Exports.Page = func(e dc.Event, cred dc.Dict) Result {
return resultWrapper(PageHandler(e, cred))
}
dc.Exports.Track = func(e dc.Event, cred dc.Dict) Result {
return resultWrapper(TrackHandler(e, cred))
}
dc.Exports.User = func(e dc.Event, cred dc.Dict) Result {
return resultWrapper(UserHandler(e, cred))
}
}
// main is required for the `wasi` target, even if it isn't used.
func main() {}