@@ -41,6 +41,13 @@ const (
41
41
Extension EventType = "extension"
42
42
)
43
43
44
+ type SubEventType string
45
+
46
+ const (
47
+ // RuntimeDone event is sent when lambda function is finished it's execution
48
+ RuntimeDone SubEventType = "platform.runtimeDone"
49
+ )
50
+
44
51
// BufferingCfg is the configuration set for receiving logs from Logs API. Whichever of the conditions below is met first, the logs will be sent
45
52
type BufferingCfg struct {
46
53
// MaxItems is the maximum number of events to be buffered in memory. (default: 10000, minimum: 1000, maximum: 10000)
@@ -86,11 +93,19 @@ type Destination struct {
86
93
Encoding HttpEncoding `json:"encoding"`
87
94
}
88
95
96
+ type SchemaVersion string
97
+
98
+ const (
99
+ SchemaVersion20210318 = "2021-03-18"
100
+ SchemaVersionLatest = SchemaVersion20210318
101
+ )
102
+
89
103
// SubscribeRequest is the request body that is sent to Logs API on subscribe
90
104
type SubscribeRequest struct {
91
- EventTypes []EventType `json:"types"`
92
- BufferingCfg BufferingCfg `json:"buffering"`
93
- Destination Destination `json:"destination"`
105
+ SchemaVersion SchemaVersion `json:"schemaVersion"`
106
+ EventTypes []EventType `json:"types"`
107
+ BufferingCfg BufferingCfg `json:"buffering"`
108
+ Destination Destination `json:"destination"`
94
109
}
95
110
96
111
// SubscribeResponse is the response body that is received from Logs API on subscribe
@@ -103,9 +118,10 @@ func (c *Client) Subscribe(types []EventType, bufferingCfg BufferingCfg, destina
103
118
104
119
data , err := json .Marshal (
105
120
& SubscribeRequest {
106
- EventTypes : types ,
107
- BufferingCfg : bufferingCfg ,
108
- Destination : destination ,
121
+ SchemaVersion : SchemaVersionLatest ,
122
+ EventTypes : types ,
123
+ BufferingCfg : bufferingCfg ,
124
+ Destination : destination ,
109
125
})
110
126
if err != nil {
111
127
return nil , errors .WithMessage (err , "failed to marshal SubscribeRequest" )
0 commit comments