Skip to content

Instantly share code, notes, and snippets.

@avivl
Created March 25, 2018 08:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save avivl/14add746bec42ba786a560d1038666d1 to your computer and use it in GitHub Desktop.
Save avivl/14add746bec42ba786a560d1038666d1 to your computer and use it in GitHub Desktop.
// Payload is the event's actual data inserted into data stores.
type Payload map[string]interface{}
// Type is an Event's metadata.
type Type struct {
EventVersionField string `json:"event_version" valid:"notempty,required"`
EventNameField string `json:"event_name" valid:"notempty,required"`
}
type Event struct {
TypeField Type `json:"type"`
PayloadField Payload `json:"payload" valid:"-"`
}
type TrackRequest struct {
SenderID string `json:"sender_id" valid:"notempty,required"`
Events []Event `json:"events"`
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment