-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathevent.go
35 lines (30 loc) · 1012 Bytes
/
event.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
package statful
type Amount struct {
Value int `json:"value"`
Currency string `json:"currency"`
}
type Attribute struct {
Attribute string `json:"attribute"`
Value interface{} `json:"value"`
}
type Event struct {
EventId string `json:"eventId"`
UserId string `json:"userId"`
ExtUserId string `json:"extUserId"`
GameId string `json:"gameId"`
OperatorId string `json:"operatorId"`
AggregatorId string `json:"aggregatorId"`
PublisherId string `json:"publisherId"`
EventType string `json:"eventType"`
Amount Amount `json:"amount"`
VariableAttributes []Attribute `json:"variableAttributes"`
Timestamp int `json:"timestamp"`
}
// Add an event to event buffer.
func (c *Client) Event(event Event) {
c.eventBuffer.Event(event)
}
// Send all events in event buffer.
func (c *Client) FlushEvents() error {
return c.eventBuffer.Flush()
}