Documentation
¶
Index ¶
- type Github
- func (g Github) ClosePullRequest(ctx context.Context, pullReq git.PullRequest) error
- func (g Github) CreatePullRequest(ctx context.Context, repo git.Repository, prRepo git.Repository, ...) (git.PullRequest, error)
- func (g Github) ForkRepository(ctx context.Context, repo git.Repository, newOwner string) (git.Repository, error)
- func (g Github) GetAutocompleteOrganizations(ctx context.Context, _ string) ([]string, error)
- func (g Github) GetAutocompleteRepositories(ctx context.Context, str string) ([]string, error)
- func (g Github) GetAutocompleteUsers(ctx context.Context, str string) ([]string, error)
- func (g Github) GetPullRequests(ctx context.Context, branchName string) ([]git.PullRequest, error)
- func (g Github) GetRepositories(ctx context.Context) ([]git.Repository, error)
- func (g Github) MergePullRequest(ctx context.Context, pullReq git.PullRequest) error
- type RepositoryListing
- type RepositoryReference
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Github ¶
type Github struct {
RepositoryListing
MergeTypes []git.MergeType
// This determines if forks will be used when creating a prs.
// In this package, it mainly determines which repos are possible to make changes on
Fork bool
// contains filtered or unexported fields
}
Github contain github configuration
func New ¶
func New( token string, baseURL string, transportMiddleware func(http.RoundTripper) http.RoundTripper, repoListing RepositoryListing, mergeTypes []git.MergeType, forkMode bool, ) (*Github, error)
New create a new Github client
func (Github) ClosePullRequest ¶
ClosePullRequest closes a pull request
func (Github) CreatePullRequest ¶
func (g Github) CreatePullRequest(ctx context.Context, repo git.Repository, prRepo git.Repository, newPR git.NewPullRequest) (git.PullRequest, error)
CreatePullRequest creates a pull request
func (Github) ForkRepository ¶ added in v0.27.0
func (g Github) ForkRepository(ctx context.Context, repo git.Repository, newOwner string) (git.Repository, error)
ForkRepository forks a repository. If newOwner is empty, fork on the logged in user
func (Github) GetAutocompleteOrganizations ¶
GetAutocompleteOrganizations gets organizations for autocompletion
func (Github) GetAutocompleteRepositories ¶
GetAutocompleteRepositories gets repositories for autocompletion
func (Github) GetAutocompleteUsers ¶
GetAutocompleteUsers gets users for autocompletion
func (Github) GetPullRequests ¶
GetPullRequests gets all pull requests of with a specific branch
func (Github) GetRepositories ¶
GetRepositories fetches repositories from all sources (orgs/user/specific repo)
func (Github) MergePullRequest ¶
MergePullRequest merges a pull request
type RepositoryListing ¶
type RepositoryListing struct {
Organizations []string
Users []string
Repositories []RepositoryReference
}
RepositoryListing contains information about which repositories that should be fetched
type RepositoryReference ¶
RepositoryReference contains information to be able to reference a repository
func ParseRepositoryReference ¶
func ParseRepositoryReference(val string) (RepositoryReference, error)
ParseRepositoryReference parses a repository reference from the format "ownerName/repoName"
func (RepositoryReference) String ¶ added in v0.27.0
func (rr RepositoryReference) String() string
String returns the string representation of a repo reference