integrations

package
v0.1.0-alpha.6 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// GitLab provider's name
	GITLAB_PROVIDER = "Gitlab"
	// GitLab cloud host
	GITLAB_CLOUD_HOST = "gitlab.com"
	// GitLab default protocol
	GITLAB_DEFAULT_PROTOCOL = "https"
)
View Source
const (
	// Jira provider's name
	JIRA_PROVIDER = "Jira"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GitLabProvider

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

func NewGitLabProvider

func NewGitLabProvider(r *git.Repository) (*GitLabProvider, error)

func (GitLabProvider) Search

func (glp GitLabProvider) Search() ([]IssueDescription, error)

Search return a list of issues of a GitLab project

type IssueDescription

type IssueDescription struct {
	// Issue id
	ID string
	// Issue Name
	Name string
	// Issue description
	Description string
	// Issue provider
	Provider string
	// Issue type
	Type string
}

func SelectIssue

func SelectIssue(ids []IssueDescription, color bool) (IssueDescription, error)

SelectIssue prompts a fuzzy finder and returns the selected IssueDescription or an error if something unexpected happened

func (IssueDescription) Format

func (id IssueDescription) Format(color bool) string

Format format an issue description into a colored or raw string.

func (IssueDescription) ShortFormat

func (id IssueDescription) ShortFormat() string

ShortFormat returns the shor representation string of an IssueDescription

func (IssueDescription) ToBranch

func (id IssueDescription) ToBranch(rwtype map[string]string) format.TugBranch

ToBranch create a format.TugBranch from the issue description

type JiraProvider

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

JiraProvider represents the Jira issue provider.

func (JiraProvider) Search

func (jp JiraProvider) Search() ([]IssueDescription, error)

Search returns a list of issues matching the query or an error if the request failed.

type Provider

type Provider interface {
	// Search a list of issue in the provider
	Search() ([]IssueDescription, error)
}

Provider interface abstracts cross-platform providers

func ProvidersFrom

func ProvidersFrom(r *git.Repository) ([]Provider, error)

Jump to

Keyboard shortcuts

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