Documentation ¶
Index ¶
Constants ¶
View Source
const ( GitProviderName = "github" EksaGithubTokenEnv = "EKSA_GITHUB_TOKEN" GithubTokenEnv = "GITHUB_TOKEN" )
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(gitProviderClient GitProviderClient, githubProviderClient GithubProviderClient, opts Options, auth git.TokenAuth) (git.Provider, error)
Types ¶
type GitProviderClient ¶
type GitProviderClient interface { Add(filename string) error Remove(filename string) error Clone(ctx context.Context, repourl string) error Commit(message string) error Push(ctx context.Context) error Pull(ctx context.Context, branch string) error Init(url string) error Branch(name string) error SetTokenAuth(token string, username string) }
GitProviderClient represents the attributes that the GitHub provider requires of a low-level git implementation (e.g. gogit) in order to function. Any basic git implementation (gogit, an executable wrapper, etc) which supports these methods can be used by the GitHub specific provider.
type GitProviderNotFoundError ¶
type GitProviderNotFoundError struct {
Provider string
}
func (*GitProviderNotFoundError) Error ¶
func (e *GitProviderNotFoundError) Error() string
type GithubProviderClient ¶
type GithubProviderClient 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) 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 }
GithubProviderClient represents the attributes that the Github provider requires of a library to directly connect to and interact with the Github API.
Click to show internal directories.
Click to hide internal directories.