|
17 | 17 | package fftypes |
18 | 18 |
|
19 | 19 | // EventType indicates what the event means, as well as what the Reference in the event refers to |
20 | | -type EventType = LowerCasedType |
| 20 | +type EventType = FFEnum |
21 | 21 |
|
22 | | -const ( |
| 22 | +var ( |
23 | 23 | // EventTypeMessageConfirmed is the most important event type in the system. This means a message and all of its data |
24 | 24 | // is available for processing by an application. Most applications only need to listen to this event type |
25 | | - EventTypeMessageConfirmed EventType = "message_confirmed" |
| 25 | + EventTypeMessageConfirmed EventType = ffEnum("eventtype", "message_confirmed") |
26 | 26 | // EventTypeMessageRejected occurs if a message is received and confirmed from a sequencing perspective, but is rejected as invalid (mismatch to schema, or duplicate system broadcast) |
27 | | - EventTypeMessageRejected EventType = "message_rejected" |
| 27 | + EventTypeMessageRejected EventType = ffEnum("eventtype", "message_rejected") |
28 | 28 | // EventTypeNamespaceConfirmed occurs when a new namespace is ready for use (on the namespace itself) |
29 | | - EventTypeNamespaceConfirmed EventType = "namespace_confirmed" |
| 29 | + EventTypeNamespaceConfirmed EventType = ffEnum("eventtype", "namespace_confirmed") |
30 | 30 | // EventTypeDatatypeConfirmed occurs when a new datatype is ready for use (on the namespace of the datatype) |
31 | | - EventTypeDatatypeConfirmed EventType = "datatype_confirmed" |
| 31 | + EventTypeDatatypeConfirmed EventType = ffEnum("eventtype", "datatype_confirmed") |
32 | 32 | // EventTypeGroupConfirmed occurs when a new group is ready to use (on the namespace of the group, on all group participants) |
33 | | - EventTypeGroupConfirmed EventType = "group_confirmed" |
| 33 | + EventTypeGroupConfirmed EventType = ffEnum("eventtype", "group_confirmed") |
34 | 34 | // EventTypePoolConfirmed occurs when a new token pool is ready for use |
35 | | - EventTypePoolConfirmed EventType = "token_pool_confirmed" |
| 35 | + EventTypePoolConfirmed EventType = ffEnum("eventtype", "token_pool_confirmed") |
36 | 36 | // EventTypePoolRejected occurs when a new token pool is rejected (due to validation errors, duplicates, etc) |
37 | | - EventTypePoolRejected EventType = "token_pool_rejected" |
| 37 | + EventTypePoolRejected EventType = ffEnum("eventtype", "token_pool_rejected") |
38 | 38 | ) |
39 | 39 |
|
40 | 40 | // Event is an activity in the system, delivered reliably to applications, that indicates something has happened in the network |
41 | 41 | type Event struct { |
42 | 42 | ID *UUID `json:"id"` |
43 | 43 | Sequence int64 `json:"sequence"` |
44 | | - Type EventType `json:"type"` |
| 44 | + Type EventType `json:"type" ffenum:"eventtype"` |
45 | 45 | Namespace string `json:"namespace"` |
46 | 46 | Reference *UUID `json:"reference"` |
47 | 47 | Created *FFTime `json:"created"` |
|
0 commit comments