Skip to content

Commit 70eab64

Browse files
committed
Added util for event Identification
1 parent a6aa81c commit 70eab64

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

utils/event_identifier.go

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package utils
2+
3+
import (
4+
"fmt"
5+
)
6+
7+
// IdentifyEventTypeGithub This will identify the exact key with which we have stored in DB
8+
func IdentifyEventTypeGithub(event string) string {
9+
fmt.Print("In the IdentifyEventTypeGithub")
10+
switch event {
11+
case "checkRun":
12+
return "check_run"
13+
case "issueComment":
14+
return "issue_comment"
15+
case "pullRequest":
16+
return "pull_request"
17+
case "pullRequestReview":
18+
return "pull_request_review"
19+
case "pullRequestReviewComment":
20+
return "pull_request_review_comment"
21+
case "projectCard":
22+
return "project_card"
23+
case "projectColumn":
24+
return "project_column"
25+
default:
26+
return event
27+
}
28+
}
29+
30+
// IdentifyEventTypeHeroku This will identify the exact key with which we have stored in DB
31+
func IdentifyEventTypeHeroku(event string) string {
32+
fmt.Print("In the IdentifyEventTypeHeroku")
33+
switch event {
34+
case "addonAttachment":
35+
return "addon-attachment"
36+
default:
37+
return event
38+
}
39+
}

0 commit comments

Comments
 (0)