Documentation
¶
Overview ¶
Package engine contains interfaces for different git providers.
Index ¶
- type Github
- func (g *Github) Compare(ctx context.Context, fromSHA, toSHA string) (git.CommitsComparison, error)
- func (g *Github) GetLastCommitOfBranch(ctx context.Context, branchName string) (string, error)
- func (g *Github) ListPRsOfCommit(ctx context.Context, sha string) ([]git.PullRequest, error)
- func (g *Github) ListTags(ctx context.Context) ([]git.Tag, error)
- type Gitlab
- func (g *Gitlab) Compare(ctx context.Context, fromSHA, toSHA string) (git.CommitsComparison, error)
- func (g *Gitlab) GetLastCommitOfBranch(ctx context.Context, branchName string) (string, error)
- func (g *Gitlab) ListPRsOfCommit(ctx context.Context, sha string) ([]git.PullRequest, error)
- func (g *Gitlab) ListTags(ctx context.Context) ([]git.Tag, error)
- type Interface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Github ¶
type Github struct {
// contains filtered or unexported fields
}
Github implements Interface with github API below it.
func NewGithub ¶
func NewGithub(owner, name, basicAuthUsername, basicAuthPassword string, httpCl http.Client) (*Github, error)
NewGithub makes new instance of Github.
func (*Github) GetLastCommitOfBranch ¶
GetLastCommitOfBranch returns the SHA or alias of the last commit in the branch.
func (*Github) ListPRsOfCommit ¶
ListPRsOfCommit returns pull requests associated with commit by the given SHA.
type Gitlab ¶
type Gitlab struct {
// contains filtered or unexported fields
}
Gitlab implements Interface with gitlab API below it.
func (*Gitlab) GetLastCommitOfBranch ¶
GetLastCommitOfBranch returns the SHA or alias of the last commit in the branch.
func (*Gitlab) ListPRsOfCommit ¶
ListPRsOfCommit returns pull requests associated with commit by the given SHA.
type Interface ¶
type Interface interface {
// Compare returns comparison between two commits,
// given by their SHA.
Compare(ctx context.Context, fromSHA, toSHA string) (git.CommitsComparison, error)
// ListPRsOfCommit returns pull/merge requests
// associated with the commit, given by its SHA.
ListPRsOfCommit(ctx context.Context, sha string) ([]git.PullRequest, error)
// ListTags returns tags of the repository in descending order of creation.
ListTags(ctx context.Context) ([]git.Tag, error)
// GetLastCommitOfBranch returns the SHA or alias of the last commit in the branch.
GetLastCommitOfBranch(ctx context.Context, branch string) (string, error)
}
Interface defines methods to retrieve information about repository.
Click to show internal directories.
Click to hide internal directories.