Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding proper types for Links and Images #182

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 21 additions & 8 deletions event_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,27 @@ import (

// Event includes the incident/alert details
type V2Event struct {
RoutingKey string `json:"routing_key"`
Action string `json:"event_action"`
DedupKey string `json:"dedup_key,omitempty"`
Images []interface{} `json:"images,omitempty"`
Links []interface{} `json:"links,omitempty"`
Client string `json:"client,omitempty"`
ClientURL string `json:"client_url,omitempty"`
Payload *V2Payload `json:"payload,omitempty"`
RoutingKey string `json:"routing_key"`
Action string `json:"event_action"`
DedupKey string `json:"dedup_key,omitempty"`
Images []V2EventImage `json:"images,omitempty"`
Links []V2EventLink `json:"links,omitempty"`
Client string `json:"client,omitempty"`
ClientURL string `json:"client_url,omitempty"`
Payload *V2Payload `json:"payload,omitempty"`
}

// EventLink is a link to be included on an event
type V2EventLink struct {
Href string `json:"href"`
Text string `json:"text"`
}

// EventImage is an image to be included, with an optional link and alt text
type V2EventImage struct {
Src string `json:"src"`
Href string `json:"href,omitempty"`
Alt string `json:"alt,omitempty"`
}

// Payload represents the individual event details for an event
Expand Down