github

package
v0.19.11 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GitProviderName    = "github"
	EksaGithubTokenEnv = "EKSA_GITHUB_TOKEN"
	GithubTokenEnv     = "GITHUB_TOKEN"
)

Variables

This section is empty.

Functions

func GetGithubAccessTokenFromEnv

func GetGithubAccessTokenFromEnv() (string, error)

func New

func New(githubProviderClient GithubClient, config *v1alpha1.GithubProviderConfig, auth git.TokenAuth) (*githubProvider, error)

func RepoUrl added in v0.9.0

func RepoUrl(owner string, repo string) string

Types

type GitProviderNotFoundError

type GitProviderNotFoundError struct {
	Provider string
}

func (*GitProviderNotFoundError) Error

func (e *GitProviderNotFoundError) Error() string

type GithubClient added in v0.9.0

type GithubClient interface {
	GetRepo(ctx context.Context, opts git.GetRepoOpts) (repo *git.Repository, err error)
	CreateRepo(ctx context.Context, opts git.CreateRepoOpts) (repo *git.Repository, err error)
	AddDeployKeyToRepo(ctx context.Context, opts git.AddDeployKeyOpts) error
	AuthenticatedUser(ctx context.Context) (*goGithub.User, error)
	Organization(ctx context.Context, org string) (*goGithub.Organization, error)
	GetAccessTokenPermissions(accessToken string) (string, error)
	CheckAccessTokenPermissions(checkPATPermission string, allPermissionScopes string) error
	PathExists(ctx context.Context, owner, repo, branch, path string) (bool, error)
	DeleteRepo(ctx context.Context, opts git.DeleteRepoOpts) error
}

GithubClient represents the attributes that the Github provider requires of a library to directly connect to and interact with the Github API.

type Options

type Options struct {
	Repository string
	Owner      string
	Personal   bool
}

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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