-
Notifications
You must be signed in to change notification settings - Fork 98
/
event.go
44 lines (37 loc) · 1.22 KB
/
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
36
37
38
39
40
41
42
43
44
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-present Datadog, Inc.
package datadog
import "fmt"
// Event contains the rquired information to send Datadog events
type Event struct {
Title string
Type EventType
}
// EventType enumerates the possible event types to be sent
type EventType string
const (
// CreationEvent should be used for resource creation events
CreationEvent EventType = "Create"
// DetectionEvent should be used for resource detection events
DetectionEvent EventType = "Detect"
// UpdateEvent should be used for resource update events
UpdateEvent EventType = "Update"
// DeletionEvent should be used for resource deletion events
DeletionEvent EventType = "Delete"
)
// crDetected returns the detection event of a CR
func crDetected(id string) Event {
return Event{
Title: fmt.Sprintf("Detect Custom Resource %s", id),
Type: DetectionEvent,
}
}
// crDeleted returns the delete event of a CR
func crDeleted(id string) Event {
return Event{
Title: fmt.Sprintf("Delete Custom Resource %s", id),
Type: DeletionEvent,
}
}