Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func IsPermanentError ¶
Types ¶
type Commit ¶
type Commit struct {
SHA string
Author *CommitAuthor
Committer *CommitAuthor
}
type CommitAuthor ¶
type CommitAuthor struct {
Email string
}
type CommitStatus ¶
type Hook ¶
type Hook struct {
ID int
HookConfig
}
type HookConfig ¶
type ListOrgsConfig ¶
type ListReposConfig ¶
type OrgMembership ¶
type Provider ¶
type Provider interface {
Name() string
LinkToPullRequest(repo *models.Repo, num int) string
SetBaseURL(url string) error
GetBranch(ctx context.Context, owner, repo, branch string) (*Branch, error)
GetRepoByName(ctx context.Context, owner, repo string) (*Repo, error)
GetPullRequest(ctx context.Context, owner, repo string, number int) (*PullRequest, error)
GetOrgMembershipByName(ctx context.Context, org string) (*OrgMembership, error)
ListRepoHooks(ctx context.Context, owner, repo string) ([]Hook, error)
CreateRepoHook(ctx context.Context, owner, repo string, hook *HookConfig) (*Hook, error)
DeleteRepoHook(ctx context.Context, owner, repo string, hookID int) error
ListRepos(ctx context.Context, cfg *ListReposConfig) ([]Repo, error)
ListOrgMemberships(ctx context.Context, cfg *ListOrgsConfig) ([]OrgMembership, error)
ListPullRequestCommits(ctx context.Context, owner, repo string, number int) ([]*Commit, error)
SetCommitStatus(ctx context.Context, owner, repo, ref string, status *CommitStatus) error
ParsePullRequestEvent(ctx context.Context, payload []byte) (*PullRequestEvent, error)
AddCollaborator(ctx context.Context, owner, repo, username string) (*RepoInvitation, error)
RemoveCollaborator(ctx context.Context, owner, repo, username string) error
AcceptRepoInvitation(ctx context.Context, invitationID int) error
}
type PullRequest ¶
type PullRequestAction ¶
type PullRequestAction string
const ( Opened PullRequestAction = "opened" Synchronized PullRequestAction = "synchronize" )
type PullRequestEvent ¶
type PullRequestEvent struct {
Repo *Repo
Head *Branch
PullRequestNumber int
Action PullRequestAction
}
type Repo ¶
type Repo struct {
ID int
FullName string
IsAdmin bool
IsPrivate bool
DefaultBranch string
// The parent and source objects are present when the repository is a fork.
// parent is the repository this repository was forked from,
// source is the ultimate source for the network.
Source *Repo
StargazersCount int
Language string
Organization string
OwnerID int
}
Repo represents provider repository. On any incompatible change don't forget to bump cache version in fetchProviderReposCached
type RepoInvitation ¶
Click to show internal directories.
Click to hide internal directories.