gitGithub

package
v0.0.0-...-785ad02 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2025 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGithubClient

func NewGithubClient(queries *queries.Queries) (gitShared.Client, error)

Types

type BadTokenTripper

type BadTokenTripper struct {
	Transport      http.RoundTripper
	GetRedirectURL func() (string, error)
}

func (*BadTokenTripper) RoundTrip

func (crt *BadTokenTripper) RoundTrip(req *http.Request) (*http.Response, error)

Catches any 401 requets back from github so we can attempt to get the user to reauthenticate

type GithubAppClient

type GithubAppClient struct {
	// contains filtered or unexported fields
}

func (*GithubAppClient) GetInstallation

func (c *GithubAppClient) GetInstallation(ctx context.Context, installationID string) (*typesHTTP.GitInstallation, error)

type GithubClient

type GithubClient struct {
	Queries *queries.Queries
}

func (*GithubClient) NewAppClient

func (c *GithubClient) NewAppClient(ctx context.Context) (gitShared.AppClient, error)

func (*GithubClient) NewGithubInstallationClient

func (c *GithubClient) NewGithubInstallationClient(ctx context.Context, installationID string) (*GithubInstallationClient, error)

TODO - We should cache these clients to avoid having to regenerate access tokens

func (*GithubClient) NewInstallationClient

func (c *GithubClient) NewInstallationClient(ctx context.Context, installationID string) (gitShared.InstallationClient, error)

func (*GithubClient) NewUserClient

func (c *GithubClient) NewUserClient(ctx context.Context, user types.User) (gitShared.UserClient, error)

func (*GithubClient) RefreshOAuthTokens

func (c *GithubClient) RefreshOAuthTokens(ctx context.Context, user types.User, account *typesDB.UserAccount, refreshToken *string, code *string) error

type GithubInstallationClient

type GithubInstallationClient struct {
	Client *github.Client
	// contains filtered or unexported fields
}

func (*GithubInstallationClient) GetProjectGitRepoData

func (c *GithubInstallationClient) GetProjectGitRepoData(ctx context.Context, project typesDB.Project) (*types.GitRepoData, error)

func (*GithubInstallationClient) GetUserIDFromUsername

func (c *GithubInstallationClient) GetUserIDFromUsername(ctx context.Context, username string) (int64, error)

func (*GithubInstallationClient) GetWorkflowFiles

func (c *GithubInstallationClient) GetWorkflowFiles(ctx context.Context, project typesDB.Project, event types.TriggerEvent) ([]types.WorkflowFile, error)

func (*GithubInstallationClient) RepoExists

func (c *GithubInstallationClient) RepoExists(ctx context.Context, repoID string) (bool, error)

func (*GithubInstallationClient) UpdateRunInRepo

func (c *GithubInstallationClient) UpdateRunInRepo(ctx context.Context, org typesDB.OrgDB, project typesDB.Project, run typesDB.WorkflowRun) error

type GithubUserClient

type GithubUserClient struct {
	// contains filtered or unexported fields
}

func (*GithubUserClient) GetInstallations

func (*GithubUserClient) GetRepositories

func (c *GithubUserClient) GetRepositories(ctx context.Context, installationID string, options gitShared.GetRepositoriesOptions) (*typesHTTP.GitRepositories, error)

Jump to

Keyboard shortcuts

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