Documentation
¶
Index ¶
- func Validate(typ string, cfg map[string]interface{}) error
- type File
- type GitHub
- func (gh *GitHub) AddPRComment(pr PullRequest, body string) error
- func (gh *GitHub) ClosePR(pr PullRequest) error
- func (gh *GitHub) DeletePRBranch(prID string) (string, error)
- func (gh *GitHub) FindPR(s string) (PullRequest, error)
- func (gh *GitHub) GetFile(path string) (File, error)
- func (gh *GitHub) RebasePR(pr PullRequest, path string, oldSHA string, newContent []byte, ...) error
- func (gh *GitHub) UpdateFilePR(path string, oldSHA string, newContent []byte, commitMsg string, ...) (prID string, err error)
- type GitHubFile
- type GitHubPR
- type Gitea
- func (g *Gitea) AddPRComment(pr PullRequest, body string) error
- func (g *Gitea) ClosePR(pr PullRequest) error
- func (g *Gitea) DeletePRBranch(prID string) (string, error)
- func (g *Gitea) FindPR(s string) (PullRequest, error)
- func (g *Gitea) GetFile(path string) (File, error)
- func (g *Gitea) RebasePR(pr PullRequest, path string, oldSHA string, newContent []byte, ...) error
- func (g *Gitea) UpdateFilePR(path string, oldSHA string, newContent []byte, commitMsg string, ...) (prID string, err error)
- type GiteaFile
- type GiteaPR
- type PullRequest
- type Repository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type GitHub ¶
type GitHub struct {
githubutil.GitHubOptions `cfg:",squash"`
Owner string `cfg:"owner" validate:"required"`
Repo string `cfg:"repo" validate:"required"`
BaseBranch string `cfg:"base_branch"`
Labels []string `cfg:"labels"`
CommitterName string `cfg:"committer_name"`
CommitterEmail string `cfg:"committer_email" validate:"required_with=CommitterName"`
// contains filtered or unexported fields
}
func (*GitHub) AddPRComment ¶
func (gh *GitHub) AddPRComment(pr PullRequest, body string) error
AddPRComment implements Repository
func (*GitHub) ClosePR ¶
func (gh *GitHub) ClosePR(pr PullRequest) error
ClosePR implements Repository
func (*GitHub) DeletePRBranch ¶
DeletePRBranch implements Repository
func (*GitHub) FindPR ¶
func (gh *GitHub) FindPR(s string) (PullRequest, error)
FindPR implements Repository
type GitHubFile ¶
type GitHubFile struct {
// contains filtered or unexported fields
}
type GitHubPR ¶
type GitHubPR struct {
// contains filtered or unexported fields
}
func (*GitHubPR) IsMergeable ¶
IsMergeable implements PullRequest
type Gitea ¶
type Gitea struct {
giteautil.ClientOptions `cfg:",squash"`
CommitterName string `cfg:"committer_name"`
CommitterEmail string `cfg:"committer_email" validate:"required_with=CommitterName"`
Labels []string `cfg:"labels"`
Owner string `cfg:"owner" validate:"required"`
Repo string `cfg:"repo" validate:"required"`
BaseBranch string `cfg:"base_branch"`
PageSize int `cfg:"page_size"`
// contains filtered or unexported fields
}
func (*Gitea) AddPRComment ¶
func (g *Gitea) AddPRComment(pr PullRequest, body string) error
AddPRComment implements Repository
func (*Gitea) DeletePRBranch ¶
DeletePRBranch implements Repository
func (*Gitea) FindPR ¶
func (g *Gitea) FindPR(s string) (PullRequest, error)
FindPR implements Repository
type GiteaPR ¶
type GiteaPR struct {
// contains filtered or unexported fields
}
func (*GiteaPR) IsMergeable ¶
IsMergeable implements PullRequest
type PullRequest ¶
type Repository ¶
type Repository interface {
GetFile(path string) (File, error)
FindPR(string) (PullRequest, error)
UpdateFilePR(path string, oldSHA string, newContent []byte, commitMsg string, newBranch string, prTitle string, prBody string) (prID string, err error)
// Implementations can assume that pr is their own PR type.
ClosePR(pr PullRequest) error
AddPRComment(pr PullRequest, body string) error
RebasePR(pr PullRequest, path string, oldSHA string, newContent []byte, commitMsg string) error
// Return the name of the deleted branch.
DeletePRBranch(prID string) (string, error)
}
func NewRepository ¶
func NewRepository(typ string, cfg map[string]interface{}) (Repository, error)
Click to show internal directories.
Click to hide internal directories.