Documentation ¶
Index ¶
- Variables
- func AssignUser(URL, key, user, pass string) error
- func AuthenticateGitHub(githubBaseURL string, user, token string) (bool, error)
- func AuthenticateJIRA(url, user, pass string) (bool, error)
- func AuthorizeGitHub(githubBaseURL, user, pass string) (token string, err error)
- func AuthorizeJIRA(URL, user, pass string) (token string, err error)
- func BranchNameFromIssue(issue string, name string) string
- func DefaultBranchGitHub(URL, org, repo, token string) (defaultBranch string, err error)
- func DoTransition(URL, key, user, pass, transitionID string) error
- func GroupID(name string) int
- func IssueFromBranchName(branch string) (string, error)
- func KeyFromBranchName(branch string) (string, error)
- func NewPWRequest() *pluginWebRequest
- func SetAssigneeGitHub(URL, org, repo, token, issue, assignee string) (err error)
- type AssignBody
- type Assignee
- type AssigneeIssue
- type Auth
- type Authentication
- type Authorization
- type DefaultBranch
- type GhPermissions
- type Issue
- type IssueExtractor
- type JiraIssue
- type Label
- type Milestone
- type PhlowLabel
- type QueryResult
- type Repo
- type Stringer
- type Transition
- type TransitionBody
- type Transitions
Constants ¶
This section is empty.
Variables ¶
var PhlowLabels map[string]*PhlowLabel
PhlowLabels ... Map of labels in the phlow
Functions ¶
func AuthenticateGitHub ¶
AuthenticateGitHub ... Checks personal access token validity by requesting private repositories and checking status code
func AuthenticateJIRA ¶
AuthenticateJIRA ...
func AuthorizeGitHub ¶
AuthorizeGitHub ... Retrieve token from github for authorization
func AuthorizeJIRA ¶
AuthorizeJIRA ... JIRA basic auth do not require authorization, so we just validate the user have giving right credentials with AuthenticateJIRA
func BranchNameFromIssue ¶
BranchNameFromIssue ... Converts issues to branch names nby removing illegal characters and inserting hyphens
func DefaultBranchGitHub ¶
DefaultBranchGitHub ... return the default branch of the repository
func DoTransition ¶
DoTransition ...
func IssueFromBranchName ¶ added in v1.1.0
IssueFromBranchName ... Extracts github issue from the branch name. Will error if no issue ID is identified
func KeyFromBranchName ¶
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 ¶
SetAssigneeGitHub ... Assigns a user to a github issue
Types ¶
type AssigneeIssue ¶ added in v1.1.0
type AssigneeIssue struct {
Login string `json:"login"`
}
AssigneeIssue ...
type Authentication ¶
Authentication ... interface for authentication with external service
type Authorization ¶
Authorization ... interface for authorization with external service
type DefaultBranch ¶
DefaultBranch ... interface for getting the default branch of the external service
type GhPermissions ¶ added in v1.1.5
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 ¶
GetIssueGitHub ... get a single issue from github
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 ¶
GetJiraIssue ...
type Label ¶
type Label struct { ID int `json:"id"` URL string `json:"url"` Name string `json:"name"` Color string `json:"color"` }
Label ...
func SetLabelGitHub ¶
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
PhlowLabel ... label struct for storing GitHub labels
type Stringer ¶
type Stringer interface {
ToString() string
}
Stringer ... interface for github formats
func GetIssuesGitHub ¶
GetIssuesGitHub ... return an issue with from the number of the issue
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