gitproviders

package
v0.1.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2021 License: MPL-2.0 Imports: 11 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreatePullRequestToOrgRepo

func CreatePullRequestToOrgRepo(provider gitprovider.Client, orgRepRef gitprovider.OrgRepositoryRef, targetBranch string, newBranch string, files []gitprovider.CommitFile, commitMessage string, prTitle string, prDescription string) error

func CreatePullRequestToUserRepo

func CreatePullRequestToUserRepo(provider gitprovider.Client, userRepRef gitprovider.UserRepositoryRef, targetBranch string, newBranch string, files []gitprovider.CommitFile, commitMessage string, prTitle string, prDescription string) error

func CreateRepository added in v0.0.4

func CreateRepository(name string, owner string, private bool) error

func DeployKeyExists added in v0.1.0

func DeployKeyExists(owner, repoName string) (bool, error)

func GetGitlabProvider

func GetGitlabProvider() (gitprovider.Client, error)

func GetOrgRepo added in v0.0.4

func GetOrgRepo(provider gitprovider.Client, org string, repoName string) error

func GetRepoInfo added in v0.0.4

func GetRepoInfo(provider gitprovider.Client, accountType ProviderAccountType, owner string, repoName string) error

func GetUserRepo added in v0.0.4

func GetUserRepo(provider gitprovider.Client, user string, repoName string) error

func GithubProvider

func GithubProvider() (gitprovider.Client, error)

func New added in v0.1.0

func New() defaultGitProviderHandler

func NewOrgRepositoryRef

func NewOrgRepositoryRef(domain, org, repoName string) gitprovider.OrgRepositoryRef

func NewRepositoryInfo

func NewRepositoryInfo(description string, visibility gitprovider.RepositoryVisibility) gitprovider.RepositoryInfo

func NewUserRepositoryRef

func NewUserRepositoryRef(domain, user, repoName string) gitprovider.UserRepositoryRef

func Override added in v0.0.4

func Override(handler GitProviderHandler) override.Override

func RepositoryExists added in v0.0.4

func RepositoryExists(name string, owner string) (bool, error)

func SetGithubProvider added in v0.0.4

func SetGithubProvider(githubProviderClient gitprovider.Client)

func UploadDeployKey added in v0.0.4

func UploadDeployKey(owner, repoName string, deployKey []byte) error

func WithGithubProviderHandler added in v0.0.4

func WithGithubProviderHandler(handler GithubProviderHandler, fun func() error) error

Types

type GitProviderHandler added in v0.0.4

type GitProviderHandler interface {
	CreateRepository(name string, owner string, private bool) error
	RepositoryExists(name string, owner string) (bool, error)
	DeployKeyExists(owner, repoName string) (bool, error)
	UploadDeployKey(owner, repoName string, deployKey []byte) error
}

GitProvider Handler

type GithubProviderHandler added in v0.0.4

type GithubProviderHandler interface {
	GithubProvider() (gitprovider.Client, error)
	SetGithubProvider(githubProviderClient gitprovider.Client)
}

GithubProvider shim

type ProviderAccountType added in v0.0.4

type ProviderAccountType string
const (
	AccountTypeUser ProviderAccountType = "user"
	AccountTypeOrg  ProviderAccountType = "organization"
)

func GetAccountType added in v0.0.4

func GetAccountType(provider gitprovider.Client, owner string) (ProviderAccountType, error)

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳