Documentation
¶
Index ¶
- func NewOrgRepositoryRef(domain, org, repoName string) gitprovider.OrgRepositoryRef
- func NewRepositoryInfo(description string, visibility gitprovider.RepositoryVisibility) gitprovider.RepositoryInfo
- func NewUserRepositoryRef(domain, user, repoName string) gitprovider.UserRepositoryRef
- type Config
- type GitProvider
- type GitProviderName
- type ProviderAccountType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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
Types ¶
type Config ¶ added in v0.2.2
type Config struct {
// Provider defines the GitProvider.
Provider GitProviderName
// Hostname is the HTTP/S hostname of the Provider,
// e.g. github.example.com.
Hostname string
// Token contains the token used to authenticate with the
// Provider.
Token string
}
Config defines the configuration for connecting to a GitProvider.
type GitProvider ¶ added in v0.2.2
type GitProvider 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
CreatePullRequestToUserRepo(userRepRef gitprovider.UserRepositoryRef, targetBranch string, newBranch string, files []gitprovider.CommitFile, commitMessage string, prTitle string, prDescription string) (gitprovider.PullRequest, error)
CreatePullRequestToOrgRepo(orgRepRef gitprovider.OrgRepositoryRef, targetBranch string, newBranch string, files []gitprovider.CommitFile, commitMessage string, prTitle string, prDescription string) (gitprovider.PullRequest, error)
GetAccountType(owner string) (ProviderAccountType, error)
}
GitProvider Handler
func New ¶ added in v0.1.0
func New(config Config) (GitProvider, error)
type GitProviderName ¶ added in v0.2.2
type GitProviderName string
GitProviderName holds a Git provider definition.
const ( GitProviderGitHub GitProviderName = "github" GitProviderGitLab GitProviderName = "gitlab" )
type ProviderAccountType ¶ added in v0.0.4
type ProviderAccountType string
const ( AccountTypeUser ProviderAccountType = "user" AccountTypeOrg ProviderAccountType = "organization" )
Click to show internal directories.
Click to hide internal directories.