-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
94 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,4 +51,5 @@ type Client interface { | |
|
||
Username() string | ||
Email() string | ||
ToEmoji(pkg.CommitState) string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package github_client | ||
|
||
import "github.com/zapier/kubechecks/pkg" | ||
|
||
var stateEmoji = map[pkg.CommitState]string{ | ||
pkg.StateNone: "", | ||
pkg.StateSuccess: ":white_check_mark:", | ||
pkg.StateRunning: ":runner:", | ||
pkg.StateWarning: ":warning:", | ||
pkg.StateFailure: ":red_circle:", | ||
pkg.StateError: ":exclamation:", | ||
pkg.StatePanic: ":skull:", | ||
} | ||
|
||
const defaultEmoji = ":interrobang:" | ||
|
||
// ToEmoji returns a string representation of this state for use in the request | ||
func (c *Client) ToEmoji(s pkg.CommitState) string { | ||
if emoji, ok := stateEmoji[s]; ok { | ||
return emoji | ||
} else { | ||
return defaultEmoji | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package gitlab_client | ||
|
||
import "github.com/zapier/kubechecks/pkg" | ||
|
||
var stateEmoji = map[pkg.CommitState]string{ | ||
pkg.StateNone: "", | ||
pkg.StateSuccess: ":white_check_mark:", | ||
pkg.StateRunning: ":runner:", | ||
pkg.StateWarning: ":warning:", | ||
pkg.StateFailure: ":red_circle:", | ||
pkg.StateError: ":exclamation:", | ||
pkg.StatePanic: ":skull:", | ||
} | ||
|
||
const defaultEmoji = ":interrobang:" | ||
|
||
// ToEmoji returns a string representation of this state for use in the request | ||
func (c *Client) ToEmoji(s pkg.CommitState) string { | ||
if emoji, ok := stateEmoji[s]; ok { | ||
return emoji | ||
} else { | ||
return defaultEmoji | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters