github

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2024 License: MIT Imports: 16 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" // #nosec G101
)

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, appWebhookURL, 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

func (*GithubAppConf) GetWebhookURL

func (g *GithubAppConf) GetWebhookURL() 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, enc encryption.EncryptionService) GithubVCSProvider

func ToGithubVCSProvider

func ToGithubVCSProvider(provider vcs.VCSProvider) (res GithubVCSProvider, err error)

func (GithubVCSProvider) GetGithubAppConfig

func (g GithubVCSProvider) GetGithubAppConfig() *GithubAppConf

func (GithubVCSProvider) GetVCSRepositoryFromWorkflow

func (g GithubVCSProvider) GetVCSRepositoryFromWorkflow(workflow *db.WorkflowModel) (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) CreateOrUpdatePullRequest

func (g *GithubVCSRepository) CreateOrUpdatePullRequest(tenantId, workflowRunId string, opts *vcs.CreatePullRequestOpts) (*db.GithubPullRequestModel, error)
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) GetRepoName

func (g *GithubVCSRepository) GetRepoName() string

func (*GithubVCSRepository) GetRepoOwner

func (g *GithubVCSRepository) GetRepoOwner() string

func (*GithubVCSRepository) ReadDirectory

func (g *GithubVCSRepository) ReadDirectory(ref, path string) ([]vcs.DirectoryItem, error)

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(tenantId string) error

SetupRepository sets up a VCS repository on Hatchet.

Jump to

Keyboard shortcuts

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