-
Notifications
You must be signed in to change notification settings - Fork 0
/
events.go
33 lines (24 loc) · 1.11 KB
/
events.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
//go:generate go run ./internal/generate.go
package events
// Event represents a single event payload. It is generated by parsing the
// cue definitions for each event within this repo.
type Event struct {
// Name is the unique full name of the event.
Name string `json:"name"`
// Service represents the service that generates this event. For example,
// if this event documents an event from Stripe, this field is "stripe".
Service string `json:"integration"`
// Description is a short human description of the event.
Description string `json:"description"`
// Version represents the version of this event. This allows for changing
// event schemas over time.
Version string `json:"version"`
// Cue is the cue type definition of the event, without annotations.
Cue string `json:"cue"`
// Schema is the JSON schema definition of the event.
Schema map[string]interface{} `json:"schema"`
// TypeScript is the TypeScript definition of the event.
TypeScript string `json:"typescript"`
// Example are canonical example events to display in the UI.
Examples []map[string]interface{} `json:"examples,omitempty"`
}