gitproviders

package
v0.0.4-rc0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2021 License: MPL-2.0 Imports: 10 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 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 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 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)
}

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)

Jump to

Keyboard shortcuts

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