-
Notifications
You must be signed in to change notification settings - Fork 15
/
cluster.platform.event.go
45 lines (38 loc) · 1.12 KB
/
cluster.platform.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
45
/*
Copyright 2022 Chainguard, Inc.
SPDX-License-Identifier: Apache-2.0
*/
package v1
import (
"chainguard.dev/sdk/uidp"
)
// CloudEventsExtension implements chainguard.dev/sdk/events/Extendable.CloudEventsExtension
func (x *Cluster) CloudEventsExtension(key string) (string, bool) {
switch key {
case "group":
return uidp.Parent(x.GetId()), true
default:
return "", false
}
}
// CloudEventsSubject implements chainguard.dev/sdk/events/Eventable.CloudEventsSubject.
func (x *Cluster) CloudEventsSubject() string {
return x.GetId()
}
// CloudEventsExtension implements chainguard.dev/sdk/events/Extendable.CloudEventsExtension
func (x *DeleteClusterRequest) CloudEventsExtension(key string) (string, bool) {
switch key {
case "group":
return uidp.Parent(x.GetId()), true
default:
return "", false
}
}
// CloudEventsSubject implements chainguard.dev/sdk/events/Eventable.CloudEventsSubject.
func (x *DeleteClusterRequest) CloudEventsSubject() string {
return x.GetId()
}
// CloudEventsRedact implements chainguard.dev/sdk/events/Redactable.Redact.
func (x *DeleteClusterRequest) CloudEventsRedact() interface{} {
return nil
}