Documentation
¶
Index ¶
- Variables
- func BitbucketToSlack(ctx workflow.Context, text, prURL string) string
- func BitbucketToSlackEmoji(text string) string
- func GitHubToSlack(ctx workflow.Context, text, prURL string) string
- func GitHubToSlackEmoji(text string) string
- func LinkifyTitle(ctx workflow.Context, cfg map[string]string, prURL, title string) string
- func ShortenSlackURLs(commentURL, text string) string
- func SlackToBitbucket(ctx workflow.Context, text string) string
- func SlackToBitbucketEmoji(text string) string
- func SlackToGitHub(_ workflow.Context, text string) string
- func SlackToGitHubEmoji(text string) string
Constants ¶
This section is empty.
Variables ¶
var ( BitbucketToSlackEmojiTwoWay = map[string]string{ ":frame_photo:": ":frame_with_picture:", ":robot:": ":robot_face:", ":rofl:": ":rolling_on_the_floor_laughing:", ":slight_frown:": ":slightly_frowning_face:", ":slight_smile:": ":slightly_smiling_face:", ":upside_down:": ":upside_down_face:", ":man_facepalming:": ":man-facepalming:", ":man_gesturing_no:": ":man-gesturing-no:", ":man_gesturing_ok:": ":man-gesturing-ok:", ":man_shrugging:": ":man-shrugging:", ":woman_facepalming:": ":woman-facepalming:", ":woman_gesturing_no:": ":woman-gesturing-no:", ":woman_gesturing_ok:": ":woman-gesturing-ok:", ":woman_shrugging:": ":woman-shrugging:", ":person_bald:": ":bald_person:", } SlackToBitbucketEmojiOneWay = map[string]string{ ":face_palm:": ":man_facepalming:", ":memo:": ":pencil:", ":no_good:": ":man_gesturing_no:", ":ok_woman:": ":woman_gesturing_ok:", ":shrug:": ":man_shrugging:", ":thanks:": ":pray:", } // GitHubToSlackEmojiTwoWay is based on: https://api.github.com/emojis GitHubToSlackEmojiTwoWay = map[string]string{ ":framed_picture:": ":frame_with_picture:", ":robot:": ":robot_face:", ":rofl:": ":rolling_on_the_floor_laughing:", ":man_facepalming:": ":man-facepalming:", ":no_good_man:": ":man-gesturing-no:", ":ok_man:": ":man-gesturing-ok:", ":man_shrugging:": ":man-shrugging:", ":woman_facepalming:": ":woman-facepalming:", ":no_good_woman:": ":woman-gesturing-no:", ":woman_shrugging:": ":woman-shrugging:", ":person_bald:": ":bald_person:", ":facepalm:": ":face_palm:", } // SlackToGitHubEmojiOneWay is based on: https://api.github.com/emojis SlackToGitHubEmojiOneWay = map[string]string{ ":thanks:": ":pray:", } SlackSkinTonePattern = regexp.MustCompile(`:skin-tone-\d:`) )
Functions ¶
func BitbucketToSlack ¶
BitbucketToSlack converts Bitbucket markdown text into Slack markdown text.
Based on:
func BitbucketToSlackEmoji ¶ added in v1.7.2
BitbucketToSlackEmoji fixes small inconsistencies in emoji names between Bitbucket and Slack. It doesn't address all of them yet, but eventually it should. It is idempotent, and the inverse of SlackToBitbucketEmoji.
func GitHubToSlackEmoji ¶ added in v1.7.2
GitHubToSlackEmoji fixes small inconsistencies in emoji names between GitHub and Slack. It doesn't address all of them yet, but eventually it should. It is idempotent, and the inverse of SlackToGitHubEmoji.
func LinkifyTitle ¶ added in v1.1.0
LinkifyTitle finds IDs in the given title of a pull/merge request and tries to replace them with Slack links: in the same repository, a nearby one, or based on RevChat's configuration of issue trackers. If no IDs are found, or none are recognized, it returns the input text unchanged.
func ShortenSlackURLs ¶ added in v1.7.2
ShortenSlackURLs ensures that updates of Slack messages won't fail due to a "msg_too_long" error (API limit: text length <= 4000 characters). When the text approaches this limit, we look for long URLs (512+ characters) that are masked by a label, and replace them with the PR comment's URL, so they're still accessible with an extra click but don't take up so much space in the message itself.
func SlackToBitbucket ¶ added in v0.4.0
SlackToBitbucket converts Slack markdown text into Bitbucket markdown text.
Based on:
func SlackToBitbucketEmoji ¶ added in v1.7.2
SlackToBitbucketEmoji fixes small inconsistencies in emoji names between Bitbucket and Slack. It doesn't address all of them yet, but eventually it should. It is idempotent, and the inverse of BitbucketToSlackEmoji. Note that some emojis are supported in Slack but not in Bitbucket, so we adjust them to the closest equivalent.
func SlackToGitHub ¶ added in v1.2.0
SlackToGitHub converts Slack markdown text into GitHub markdown text.
Based on:
func SlackToGitHubEmoji ¶ added in v1.7.2
SlackToGitHubEmoji fixes small inconsistencies in emoji names between GitHub and Slack. It doesn't address all of them yet, but eventually it should. It is idempotent, and the inverse of GitHubToSlackEmoji. Note that some emojis are supported in Slack but not in GitHub, so we adjust them to the closest equivalent.
Types ¶
This section is empty.