plugins

package
v3.8.20+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2017 License: MIT Imports: 13 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PhlowLabels map[string]*PhlowLabel

PhlowLabels ... Map of labels in the phlow

Functions

func AssignUser

func AssignUser(URL, key, user, pass string) error

AssignUser ...

func AuthenticateGitHub

func AuthenticateGitHub(githubBaseURL string, user, token string) (bool, error)

AuthenticateGitHub ... Checks personal access token validity by requesting private repositories and checking status code

func AuthenticateJIRA

func AuthenticateJIRA(url, user, pass string) (bool, error)

AuthenticateJIRA ...

func AuthorizeGitHub

func AuthorizeGitHub(githubBaseURL, user, pass string) (token string, err error)

AuthorizeGitHub ... Retrieve token from github for authorization

func AuthorizeJIRA

func AuthorizeJIRA(URL, user, pass string) (token string, err error)

AuthorizeJIRA ... JIRA basic auth do not require authorization, so we just validate the user have giving right credentials with AuthenticateJIRA

func BranchNameFromIssue

func BranchNameFromIssue(issue string, name string) string

BranchNameFromIssue ... Converts issues to branch names nby removing illegal characters and inserting hyphens

func DefaultBranchGitHub

func DefaultBranchGitHub(URL, org, repo, token string) (defaultBranch string, err error)

DefaultBranchGitHub ... return the default branch of the repository

func DoTransition

func DoTransition(URL, key, user, pass, transitionID string) error

DoTransition ...

func GroupID added in v1.1.5

func GroupID(name string) int

GroupID ...

func IssueFromBranchName added in v1.1.0

func IssueFromBranchName(branch string) (string, error)

IssueFromBranchName ... Extracts github issue from the branch name. Will error if no issue ID is identified

func KeyFromBranchName

func KeyFromBranchName(branch string) (string, error)

KeyFromBranchName ... Extracts a Jira key from a branch name. Will error if no key is identified

func NewPWRequest added in v1.1.5

func NewPWRequest() *pluginWebRequest

NewPWRequest ... Creates a new pluginWebRequest

func SetAssigneeGitHub

func SetAssigneeGitHub(URL, org, repo, token, issue, assignee string) (err error)

SetAssigneeGitHub ... Assigns a user to a github issue

Types

type AssignBody

type AssignBody struct {
	Name string `json:"name"`
}

AssignBody ...

type Assignee

type Assignee struct {
	Assignees []string `json:"assignees"`
}

Assignee ...

type AssigneeIssue added in v1.1.0

type AssigneeIssue struct {
	Login string `json:"login"`
}

AssigneeIssue ...

type Auth

type Auth struct {
	Token string `json:"token"`
}

Auth ...

type Authentication

type Authentication func(URL, user, pass string) (authenticated bool, err error)

Authentication ... interface for authentication with external service

type Authorization

type Authorization func(URL, user, pass string) (token string, err error)

Authorization ... interface for authorization with external service

type DefaultBranch

type DefaultBranch func(URL, org, repo, token string) (defaultBranch string, err error)

DefaultBranch ... interface for getting the default branch of the external service

type GhPermissions added in v1.1.5

type GhPermissions struct {
	Scopes []string `json:"scopes"`
	Note   string   `json:"note"`
}

GhPermissions ... data struct for permissions

type Issue

type Issue struct {
	Assignees []AssigneeIssue `json:"assignees"`
	Title     string          `json:"title"`
	Number    int             `json:"number"`
	Body      string          `json:"body"`
	Labels    []Label         `json:"labels"`
	Milestone Milestone       `json:"milestone"`
}

Issue ...

func GetIssueGitHub

func GetIssueGitHub(URL, org, repo, key, token string) (*Issue, error)

GetIssueGitHub ... get a single issue from github

func (Issue) ToString

func (issue Issue) ToString() string

ToString ... Formats issue

type IssueExtractor

type IssueExtractor func(branch string) (string, error)

IssueExtractor ...

type JiraIssue

type JiraIssue struct {
	Key    string `json:"key"`
	Fields struct {
		Summary string `json:"summary"`
		Status  struct {
			Name string `json:"name"`
		} `json:"status"`
	} `json:"fields"`
}

JiraIssue ...

func GetJiraIssue

func GetJiraIssue(URL, key, user, pass string) (*JiraIssue, error)

GetJiraIssue ...

func (JiraIssue) ToString

func (issue JiraIssue) ToString() string

ToString ... Formats issue

type Label

type Label struct {
	ID    int    `json:"id"`
	URL   string `json:"url"`
	Name  string `json:"name"`
	Color string `json:"color"`
}

Label ...

func SetLabelGitHub

func SetLabelGitHub(URL, org, repo, token, label, issue string) (labels []Label, err error)

SetLabelGitHub ... Sets a label on a github repository with

type Milestone added in v1.1.0

type Milestone struct {
	Title string `json:"title"`
}

Milestone ...

type PhlowLabel added in v1.1.0

type PhlowLabel struct {
	Title string
	Group int
	ID    int
}

PhlowLabel ... label struct for storing GitHub labels

type QueryResult

type QueryResult struct {
	Issues []JiraIssue `json:"issues"`
}

QueryResult ...

type Repo

type Repo struct {
	DefaultBranch string `json:"default_branch"`
}

Repo ...

type Stringer

type Stringer interface {
	ToString() string
}

Stringer ... interface for github formats

func GetIssuesGitHub

func GetIssuesGitHub(URL, org, repo, token string) ([]Stringer, error)

GetIssuesGitHub ... return an issue with from the number of the issue

func QueryIssues

func QueryIssues(URL, user, pass string) ([]Stringer, error)

QueryIssues ...

type Transition

type Transition struct {
	ID string `json:"id"`
	To struct {
		StatusCategory struct {
			Name string `json:"name"`
		} `json:"statusCategory"`
	} `json:"to"`
}

Transition ...

type TransitionBody

type TransitionBody struct {
	Transition struct {
		ID string `json:"id"`
	} `json:"transition"`
}

TransitionBody ...

type Transitions

type Transitions struct {
	Transitions []Transition `json:"transitions"`
}

Transitions ...

func GetTransitions

func GetTransitions(URL, key, user, pass string) (*Transitions, error)

GetTransitions ... Retrieve transitions for a specific issue

Jump to

Keyboard shortcuts

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