Documentation
¶
Overview ¶
Package engine defines interfaces each supported repository provider should implement. Includes default implementation with github.
Index ¶
- type Github
- func (g *Github) Compare(ctx context.Context, fromSHA, toSHA string) (store.CommitsComparison, error)
- func (g *Github) HeadCommit(_ context.Context) (string, error)
- func (g *Github) ListPRsOfCommit(ctx context.Context, sha string) ([]store.PullRequest, error)
- func (g *Github) ListTags(ctx context.Context) ([]store.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) Compare ¶
func (g *Github) Compare(ctx context.Context, fromSHA, toSHA string) (store.CommitsComparison, error)
Compare two commits by their SHA.
func (*Github) HeadCommit ¶
HeadCommit returns the alias of the oldest commit in the repository
func (*Github) 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) (store.CommitsComparison, error)
// ListPRsOfCommit returns pull/merge requests
// associated with the commit, given by its SHA.
ListPRsOfCommit(ctx context.Context, sha string) ([]store.PullRequest, error)
// ListTags returns tags of the repository in descending order of creation.
ListTags(ctx context.Context) ([]store.Tag, error)
// HeadCommit returns the SHA or alias of the oldest commit in the repository
HeadCommit(ctx context.Context) (string, error)
}
Interface defines methods to retrieve information about repository.
Click to show internal directories.
Click to hide internal directories.