Documentation
¶
Index ¶
- Constants
- func ToVCSRepositoryPullRequest(repoOwner, repoName string, pr *githubsdk.PullRequest) vcs.VCSRepositoryPullRequest
- type GithubAppConf
- type GithubBranch
- type GithubCommitsComparison
- type GithubVCSProvider
- type GithubVCSRepository
- func (g *GithubVCSRepository) CompareCommits(base, head string) (vcs.VCSCommitsComparison, error)
- func (g *GithubVCSRepository) CreateCheckRun(pr vcs.VCSRepositoryPullRequest, mod *models.Module, checkRun vcs.VCSCheckRun) (vcs.VCSObjectID, error)
- func (g *GithubVCSRepository) CreateOrUpdateComment(pr vcs.VCSRepositoryPullRequest, mod *models.Module, run *models.ModuleRun, ...) (vcs.VCSObjectID, error)
- func (g *GithubVCSRepository) CreateOrUpdatePRInDatabase(teamID string, pr vcs.VCSRepositoryPullRequest) error
- func (g *GithubVCSRepository) GetArchiveLink(ref string) (*url.URL, error)
- func (g *GithubVCSRepository) GetBranch(name string) (vcs.VCSBranch, error)
- func (g *GithubVCSRepository) GetKind() vcs.VCSRepositoryKind
- func (g *GithubVCSRepository) GetPR(mod *models.Module, run *models.ModuleRun) (vcs.VCSRepositoryPullRequest, error)
- func (g *GithubVCSRepository) GetRepoName() string
- func (g *GithubVCSRepository) GetRepoOwner() string
- func (g *GithubVCSRepository) PopulateModuleRun(run *models.ModuleRun, prID, checkRunID, commentID vcs.VCSObjectID)
- func (g *GithubVCSRepository) ReadFile(ref, path string) (io.ReadCloser, error)
- func (g *GithubVCSRepository) SetupRepository(teamID string) error
- func (g *GithubVCSRepository) UpdateCheckRun(pr vcs.VCSRepositoryPullRequest, mod *models.Module, run *models.ModuleRun, ...) (vcs.VCSObjectID, error)
Constants ¶
View Source
const ( GithubAuthURL string = "https://github.com/login/oauth/authorize" GithubTokenURL string = "https://github.com/login/oauth/access_token" )
Variables ¶
This section is empty.
Functions ¶
func ToVCSRepositoryPullRequest ¶
func ToVCSRepositoryPullRequest(repoOwner, repoName string, pr *githubsdk.PullRequest) vcs.VCSRepositoryPullRequest
Types ¶
type GithubAppConf ¶
func NewGithubAppConf ¶
func NewGithubAppConf(cfg *oauth.Config, appName, appSecretPath, appWebhookSecret, appID string) (*GithubAppConf, error)
func (*GithubAppConf) GetAppName ¶
func (g *GithubAppConf) GetAppName() string
func (*GithubAppConf) GetGithubClient ¶
func (g *GithubAppConf) GetGithubClient(installationID int64) (*githubsdk.Client, error)
func (*GithubAppConf) GetWebhookSecret ¶
func (g *GithubAppConf) GetWebhookSecret() string
type GithubBranch ¶
func (*GithubBranch) GetLatestRef ¶
func (g *GithubBranch) GetLatestRef() string
func (*GithubBranch) GetName ¶
func (g *GithubBranch) GetName() string
type GithubCommitsComparison ¶
type GithubCommitsComparison struct {
*githubsdk.CommitsComparison
}
func (*GithubCommitsComparison) GetFiles ¶
func (g *GithubCommitsComparison) GetFiles() []vcs.CommitFile
type GithubVCSProvider ¶
type GithubVCSProvider struct {
// contains filtered or unexported fields
}
func NewGithubVCSProvider ¶
func NewGithubVCSProvider(appConf *GithubAppConf, repo repository.Repository, serverURL string) GithubVCSProvider
func ToGithubVCSProvider ¶
func ToGithubVCSProvider(provider vcs.VCSProvider) (res GithubVCSProvider, err error)
func (GithubVCSProvider) GetGithubAppConfig ¶
func (g GithubVCSProvider) GetGithubAppConfig() *GithubAppConf
func (GithubVCSProvider) GetVCSRepositoryFromModule ¶
func (g GithubVCSProvider) GetVCSRepositoryFromModule(depl *models.ModuleDeploymentConfig) (vcs.VCSRepository, error)
type GithubVCSRepository ¶
type GithubVCSRepository struct {
// contains filtered or unexported fields
}
func (*GithubVCSRepository) CompareCommits ¶
func (g *GithubVCSRepository) CompareCommits(base, head string) (vcs.VCSCommitsComparison, error)
CompareCommits compares a base commit with a head commit
func (*GithubVCSRepository) CreateCheckRun ¶
func (g *GithubVCSRepository) CreateCheckRun( pr vcs.VCSRepositoryPullRequest, mod *models.Module, checkRun vcs.VCSCheckRun, ) (vcs.VCSObjectID, error)
func (*GithubVCSRepository) CreateOrUpdateComment ¶
func (g *GithubVCSRepository) CreateOrUpdateComment(pr vcs.VCSRepositoryPullRequest, mod *models.Module, run *models.ModuleRun, body string) (vcs.VCSObjectID, error)
CreateOrUpdateComment creates a comment on a pull/merge request
func (*GithubVCSRepository) CreateOrUpdatePRInDatabase ¶
func (g *GithubVCSRepository) CreateOrUpdatePRInDatabase(teamID string, pr vcs.VCSRepositoryPullRequest) error
CreateOrUpdatePRInDatabase stores pull request information using this VCS provider
func (*GithubVCSRepository) GetArchiveLink ¶
func (g *GithubVCSRepository) GetArchiveLink(ref string) (*url.URL, error)
GetArchiveLink returns an archive link for a specific repo SHA
func (*GithubVCSRepository) GetBranch ¶
func (g *GithubVCSRepository) GetBranch(name string) (vcs.VCSBranch, error)
GetBranch gets a full branch (name and sha)
func (*GithubVCSRepository) GetKind ¶
func (g *GithubVCSRepository) GetKind() vcs.VCSRepositoryKind
GetKind returns the kind of VCS provider -- used for downstream integrations
func (*GithubVCSRepository) GetPR ¶
func (g *GithubVCSRepository) GetPR(mod *models.Module, run *models.ModuleRun) (vcs.VCSRepositoryPullRequest, error)
func (*GithubVCSRepository) GetRepoName ¶
func (g *GithubVCSRepository) GetRepoName() string
func (*GithubVCSRepository) GetRepoOwner ¶
func (g *GithubVCSRepository) GetRepoOwner() string
func (*GithubVCSRepository) PopulateModuleRun ¶
func (g *GithubVCSRepository) PopulateModuleRun(run *models.ModuleRun, prID, checkRunID, commentID vcs.VCSObjectID)
PopulateModuleRun adds additional fields to the module run config. Should be called before creating the module run.
func (*GithubVCSRepository) ReadFile ¶
func (g *GithubVCSRepository) ReadFile(ref, path string) (io.ReadCloser, error)
ReadFile returns a file by a SHA reference or path
func (*GithubVCSRepository) SetupRepository ¶
func (g *GithubVCSRepository) SetupRepository(teamID string) error
SetupRepository sets up a VCS repository on Hatchet.
func (*GithubVCSRepository) UpdateCheckRun ¶
func (g *GithubVCSRepository) UpdateCheckRun(pr vcs.VCSRepositoryPullRequest, mod *models.Module, run *models.ModuleRun, checkRun vcs.VCSCheckRun) (vcs.VCSObjectID, error)
Click to show internal directories.
Click to hide internal directories.