git

package
v0.0.0-...-cdba371 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BranchName

func BranchName(issue *pm.Issue, message string) string

func CurrentBranch

func CurrentBranch() (string, error)

func DefaultBranch

func DefaultBranch(ctx context.Context) (string, error)

func FindBranch

func FindBranch(issueID string) (string, error)

func GetIssueID

func GetIssueID() (string, error)

func Output

func Output(options ...string) (string, string, error)

func PrepBranchName

func PrepBranchName(str string) string

func Root

func Root() (string, error)

func Run

func Run(options ...string) error

Types

type Bitbucket

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

func NewBitbucket

func NewBitbucket(ctx context.Context) *Bitbucket

func (*Bitbucket) CreatePR

func (bb *Bitbucket) CreatePR(ctx context.Context, opt *PullRequestOptions) (PullRequest, error)

func (*Bitbucket) DiffURL

func (bb *Bitbucket) DiffURL(ctx context.Context) (string, error)

func (*Bitbucket) ListPRs

func (bb *Bitbucket) ListPRs(ctx context.Context) ([]PullRequest, error)

func (*Bitbucket) MainBranchName

func (bb *Bitbucket) MainBranchName(ctx context.Context) (string, error)

type GitUrl

type GitUrl struct {
	Host  string
	Owner string
	Repo  string
	SSH   bool
}

func UrlParts

func UrlParts() (*GitUrl, error)

func (*GitUrl) String

func (u *GitUrl) String() string

type Github

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

func NewGithub

func NewGithub(ctx context.Context) *Github

func (*Github) CreatePR

func (gh *Github) CreatePR(ctx context.Context, opt *PullRequestOptions) (PullRequest, error)

func (*Github) DiffURL

func (gh *Github) DiffURL(ctx context.Context) (string, error)

func (*Github) ListPRs

func (gh *Github) ListPRs(ctx context.Context) ([]PullRequest, error)

func (*Github) MainBranchName

func (gh *Github) MainBranchName(ctx context.Context) (string, error)

type Provider

type Provider interface {
	MainBranchName(context.Context) (string, error)
	CreatePR(context.Context, *PullRequestOptions) (PullRequest, error)
	DiffURL(ctx context.Context) (string, error)
	ListPRs(ctx context.Context) ([]PullRequest, error)
}

func GetProvider

func GetProvider(ctx context.Context) (Provider, error)

type PullRequest

type PullRequest interface {
	GetURL() string
	GetCommentCount() int
}

func CreatePR

func CreatePR(ctx context.Context, opt *PullRequestOptions) (PullRequest, error)

type PullRequestOptions

type PullRequestOptions struct {
	Title        string
	Description  string
	SourceBranch string
	BaseBranch   string
}

type SimplePullRequest

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

func (*SimplePullRequest) GetCommentCount

func (pr *SimplePullRequest) GetCommentCount() int

func (*SimplePullRequest) GetURL

func (pr *SimplePullRequest) GetURL() string

Jump to

Keyboard shortcuts

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