-
Notifications
You must be signed in to change notification settings - Fork 96
/
system.go
47 lines (38 loc) · 1.64 KB
/
system.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
40
41
42
43
44
45
46
47
package event
import (
"github.com/serverless/event-gateway/function"
)
// SystemEventReceivedType is a system event emitted when the Event Gateway receives an event.
const SystemEventReceivedType = TypeName("eventgateway.event.received")
// SystemEventReceivedData struct.
type SystemEventReceivedData struct {
Path string `json:"path"`
Event Event `json:"event"`
Headers map[string]string `json:"headers"`
}
// SystemFunctionInvokingType is a system event emitted before invoking a function.
const SystemFunctionInvokingType = TypeName("eventgateway.function.invoking")
// SystemFunctionInvokingData struct.
type SystemFunctionInvokingData struct {
Space string `json:"space"`
FunctionID function.ID `json:"functionId"`
Event Event `json:"event"`
}
// SystemFunctionInvokedType is a system event emitted after successful function invocation.
const SystemFunctionInvokedType = TypeName("eventgateway.function.invoked")
// SystemFunctionInvokedData struct.
type SystemFunctionInvokedData struct {
Space string `json:"space"`
FunctionID function.ID `json:"functionId"`
Event Event `json:"event"`
Result []byte `json:"result"`
}
// SystemFunctionInvocationFailedType is a system event emitted after successful function invocation.
const SystemFunctionInvocationFailedType = TypeName("eventgateway.function.invocationFailed")
// SystemFunctionInvocationFailedData struct.
type SystemFunctionInvocationFailedData struct {
Space string `json:"space"`
FunctionID function.ID `json:"functionId"`
Event Event `json:"event"`
Error error `json:"error"`
}