Documentation
¶
Index ¶
- func GetIssue(jiraClient *jira.Client, issue string) (*jira.Issue, error)
- func GetJIRAClient(config *Config) *jira.Client
- func JiraMarkupToGithubMarkdown(jiraClient *jira.Client, str string) string
- func JiraToMD(str string) string
- func ReplaceAllStringSubmatchFunc(re *regexp.Regexp, str string, repl func([]string) string) string
- type Config
- type JiraResolver
- type Jiration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetIssue ¶
GetIssue checks if issue exists in the JIRA instance. If not an error will be returned.
func GetJIRAClient ¶
func JiraToMD ¶
JiraToMD - This uses some regular expressions to make a reasonable translation from Jira Markup to Github Markdown. It is not a complete PEG so it will break down especially for more complicated nested formatting (lists inside of lists)
func ReplaceAllStringSubmatchFunc ¶
func ReplaceAllStringSubmatchFunc( re *regexp.Regexp, str string, repl func([]string) string, ) string
ReplaceAllStringSubmatchFunc - Invokes Callback for Regex Replacement The repl function takes an unusual string slice argument: - The 0th element is the complete match - The following slice elements are the nth string found by a parenthesized capture group (including named capturing groups)
This is a Go implementation to match other languages: PHP: preg_replace_callback($pattern, $callback, $subject) Ruby: subject.gsub(pattern) {|match| callback} Python: re.sub(pattern, callback, subject) JavaScript: subject.replace(pattern, callback) See https://gist.github.com/elliotchance/d419395aa776d632d897
Types ¶
type Config ¶
type Config struct {
Host string `json:"host"`
User string `json:"user"`
Token string `json:"token"`
}
Config struct
func ConfigureJira ¶
func ConfigureJira() *Config
func ReadConfigFromEnv ¶
func ReadConfigFromEnv() *Config
func ReadConfigFromFile ¶
ReadConfigFromFile returns an error if file does not exist
type JiraResolver ¶
func (*JiraResolver) JiraMarkupMentionToEmail ¶
func (j *JiraResolver) JiraMarkupMentionToEmail(str string) string
JiraMarkupMentionToEmail will replace JiraMarkup account mentions with Display Name followed by parenthetical email addresses