Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Commit

Permalink
feat: Added convenience functions for determining event types
Browse files Browse the repository at this point in the history
Signed-off-by: Florian Bacher <[email protected]>
  • Loading branch information
bacherfl authored and mowies committed Jul 22, 2021
1 parent f7037e4 commit 87adc38
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pkg/lib/v0_2_0/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,18 @@ func GetEventTypeForTriggeredEvent(baseTriggeredEventType, newEventTypeSuffix st
return trimmed + newEventTypeSuffix, nil
}

func IsFinishedEventType(eventType string) bool {
return strings.HasSuffix(eventType, keptnFinishedEventSuffix)
}

func IsStartedEventType(eventType string) bool {
return strings.HasSuffix(eventType, keptnStartedEventSuffix)
}

func IsTriggeredEventType(eventType string) bool {
return strings.HasSuffix(eventType, keptnTriggeredEventSuffix)
}

// EventData contains mandatory fields of all Keptn CloudEvents
type EventData struct {
Project string `json:"project,omitempty"`
Expand Down

0 comments on commit 87adc38

Please sign in to comment.