atlassian

package
v0.0.0-...-b3e6612 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetIssue

func GetIssue(jiraClient *jira.Client, issue string) (*jira.Issue, error)

GetIssue checks if issue exists in the JIRA instance. If not an error will be returned.

func GetJIRAClient

func GetJIRAClient(config *Config) *jira.Client

func JiraMarkupToGithubMarkdown

func JiraMarkupToGithubMarkdown(jiraClient *jira.Client, str string) string

func JiraToMD

func JiraToMD(str string) string

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

func ReadConfigFromFile() (*Config, error)

ReadConfigFromFile returns an error if file does not exist

type JiraResolver

type JiraResolver struct {
	JiraClient *jira.Client
}

func (*JiraResolver) JiraMarkupMentionToEmail

func (j *JiraResolver) JiraMarkupMentionToEmail(str string) string

JiraMarkupMentionToEmail will replace JiraMarkup account mentions with Display Name followed by parenthetical email addresses

type Jiration

type Jiration struct {
	// contains filtered or unexported fields
}

Jiration - convenience for Jira Markup to Github Markdown translation rule

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL