Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewOrgRepositoryRef ¶
func NewOrgRepositoryRef(domain, org, repoName string) gitprovider.OrgRepositoryRef
Types ¶
type AccountTypeGetter ¶ added in v0.3.1
type AccountTypeGetter func(provider gitprovider.Client, domain string, owner string) (ProviderAccountType, error)
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 { RepositoryExists(ctx context.Context, name string, owner string) (bool, error) DeployKeyExists(ctx context.Context, owner, repoName string) (bool, error) GetDefaultBranch(ctx context.Context, url string) (string, error) GetRepoVisibility(ctx context.Context, url string) (*gitprovider.RepositoryVisibility, error) UploadDeployKey(ctx context.Context, owner, repoName string, deployKey []byte) error CreatePullRequest(ctx context.Context, owner string, repoName string, prInfo PullRequestInfo) (gitprovider.PullRequest, error) GetCommits(ctx context.Context, owner string, repoName, targetBranch string, pageSize int, pageToken int) ([]gitprovider.Commit, error) GetProviderDomain() string }
GitProvider Handler
func New ¶ added in v0.1.0
func New(config Config, owner string, getAccountType AccountTypeGetter) (GitProvider, error)
func NewDryRun ¶ added in v0.3.1
func NewDryRun() (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 NormalizedRepoURL ¶ added in v0.2.5
type NormalizedRepoURL struct {
// contains filtered or unexported fields
}
func NewNormalizedRepoURL ¶ added in v0.2.5
func NewNormalizedRepoURL(uri string) (NormalizedRepoURL, error)
func (NormalizedRepoURL) Owner ¶ added in v0.2.5
func (n NormalizedRepoURL) Owner() string
func (NormalizedRepoURL) Protocol ¶ added in v0.2.5
func (n NormalizedRepoURL) Protocol() RepositoryURLProtocol
func (NormalizedRepoURL) Provider ¶ added in v0.2.5
func (n NormalizedRepoURL) Provider() GitProviderName
func (NormalizedRepoURL) RepositoryName ¶ added in v0.2.5
func (n NormalizedRepoURL) RepositoryName() string
func (NormalizedRepoURL) String ¶ added in v0.2.5
func (n NormalizedRepoURL) String() string
func (NormalizedRepoURL) URL ¶ added in v0.2.5
func (n NormalizedRepoURL) URL() *url.URL
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, domain string, owner string) (ProviderAccountType, error)
type PullRequestInfo ¶ added in v0.3.1
type PullRequestInfo struct { Title string Description string CommitMessage string TargetBranch string NewBranch string Files []gitprovider.CommitFile }
type RepositoryURLProtocol ¶ added in v0.2.5
type RepositoryURLProtocol string
const RepositoryURLProtocolHTTPS RepositoryURLProtocol = "https"
const RepositoryURLProtocolSSH RepositoryURLProtocol = "ssh"
Source Files ¶
Click to show internal directories.
Click to hide internal directories.