branchhelper

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2017 License: GPL-3.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GuessEndpointURL added in v1.0.0

func GuessEndpointURL(issueURL *url.URL) string

GuessEndpointURL Guesses the endpoint URL from a issue URL

Types

type EndpointCombinedStrategy

type EndpointCombinedStrategy struct {
}

EndpointCombinedStrategy is used for instances Jira is deployed with other products, so has the "/jira" prefix e.g. "/jira/browse/TST-1"

func (EndpointCombinedStrategy) GetEndpoint

func (c EndpointCombinedStrategy) GetEndpoint(issueURL *url.URL) *url.URL

GetEndpoint Try to get a endpoint URL from a issue url using the EndpointCombinedStrategy

type EndpointSoloStrategy

type EndpointSoloStrategy struct {
}

EndpointSoloStrategy is used for instances Jira is deployed alone, so has no prefix to issues e.g. "/browse/TST-1"

func (EndpointSoloStrategy) GetEndpoint

func (c EndpointSoloStrategy) GetEndpoint(issueURL *url.URL) *url.URL

GetEndpoint Try to get a endpoint URL from a issue url using the EndpointSoloStrategy

type EndpointStrategy

type EndpointStrategy interface {
	GetEndpoint(url *url.URL) *url.URL
}

EndpointStrategy Get an endpoint URL from an issue URL

type GetIssueClient

type GetIssueClient interface {
	Get(
		issueID string,
		options *jira.GetQueryOptions,
	) (
		*jira.Issue,
		*jira.Response,
		error,
	)
}

GetIssueClient allows us to get issues from Jira

type IssueLiteralStrategy

type IssueLiteralStrategy struct {
}

IssueLiteralStrategy take what the user provided verboten

func (IssueLiteralStrategy) GetIssue

func (c IssueLiteralStrategy) GetIssue(rawIssue string) (string, error)

GetIssue extracts the issue number from the issue

type IssueStrategy

type IssueStrategy interface {
	GetIssue(rawIssue string) (string, error)
}

IssueStrategy strategy to use to take a user supplied issue and convert it to a standard Jira issue

func MakeIssueStrategy added in v1.0.0

func MakeIssueStrategy(
	issueURL *url.URL,
) IssueStrategy

MakeIssueStrategy make an issue strategy based on the URL provided

type IssueURLStrategy added in v1.0.0

type IssueURLStrategy struct {
}

IssueURLStrategy take what the user provided, assume it's a URL take the issue number from the end

func (IssueURLStrategy) GetIssue added in v1.0.0

func (c IssueURLStrategy) GetIssue(rawIssue string) (string, error)

GetIssue extracts the issue number from the issue

type Jira added in v1.0.0

type Jira struct {
	Client GetIssueClient
}

Jira will generate branch names from Jira issues

func NewJira added in v1.0.0

func NewJira(
	client *jira.Client,
) *Jira

NewJira from a Jira client build a client helper

func (*Jira) FormatIssue added in v1.0.0

func (helper *Jira) FormatIssue(
	issueID string,
	rawTmpl string,
) (string, error)

FormatIssue generate a branch name from a template and a issue ID

Jump to

Keyboard shortcuts

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