github

package
v0.1.0-alpha.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 31, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

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

type GithubAppConf struct {
	oauth2.Config
	// contains filtered or unexported fields
}

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

type GithubBranch struct {
	*githubsdk.Branch
}

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 (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

GetKind returns the kind of VCS provider -- used for downstream integrations

func (*GithubVCSRepository) GetPR

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL