Documentation ¶
Index ¶
- Constants
- Variables
- func BitBucketCloudAccessTokenURL(url string, username string) string
- func BitBucketServerAccessTokenURL(url string) string
- func GitHubAccessTokenURL(url string) string
- func GiteaAccessTokenURL(url string) string
- func GitlabAccessTokenURL(url string) string
- func HttpCloneURL(repo *GitRepository, kind string) string
- func PrintCreateRepositoryGenerateAccessToken(kind string, serverURL string, username string, o io.Writer)
- func ProviderAccessTokenURL(kind string, url string, username string) string
- func SaasGitKind(gitServiceUrl string) string
- type GitRepository
- func (i *GitRepository) HostURL() string
- func (i *GitRepository) HostURLWithoutUser() string
- func (i *GitRepository) HttpURL() string
- func (i *GitRepository) HttpsURL() string
- func (i *GitRepository) IsGitHub() bool
- func (i *GitRepository) PipelinePath() string
- func (i *GitRepository) PullRequestURL(prName string) string
- func (i *GitRepository) URLWithoutUser() string
Constants ¶
const ( // KindBitBucketCloud git kind for BitBucket Cloud KindBitBucketCloud = "bitbucketcloud" // KindBitBucketServer git kind for BitBucket Server KindBitBucketServer = "bitbucketserver" // KindGitea git kind for gitea KindGitea = "gitea" // KindGitlab git kind for gitlab KindGitlab = "gitlab" // KindGitHub git kind for github KindGitHub = "github" // KindGitFake git kind for fake git KindGitFake = "fakegit" // KindUnknown git kind for unknown git KindUnknown = "unknown" // BitbucketCloudURL the default URL for BitBucket Cloud BitbucketCloudURL = "https://bitbucket.org" // FakeGitURL the default URL for the fake git provider FakeGitURL = "https://fake.git" )
const ( GitHubHost = "github.com" GitHubURL = "https://github.com" )
Variables ¶
var (
KindGits = []string{KindBitBucketCloud, KindBitBucketServer, KindGitea, KindGitHub, KindGitlab}
)
Functions ¶
func BitBucketServerAccessTokenURL ¶
BitBucketServerAccessTokenURL generates the access token URL
func GitHubAccessTokenURL ¶
func GiteaAccessTokenURL ¶
GiteaAccessTokenURL returns the URL to generate an access token
func GitlabAccessTokenURL ¶
GitlabAccessTokenURL returns the URL to click on to generate a personal access token for the Git provider
func HttpCloneURL ¶
func HttpCloneURL(repo *GitRepository, kind string) string
HttpCloneURL returns the HTTPS git URL this repository
func PrintCreateRepositoryGenerateAccessToken ¶
func PrintCreateRepositoryGenerateAccessToken(kind string, serverURL string, username string, o io.Writer)
PrintCreateRepositoryGenerateAccessToken prints the access token URL of a Git repository
func ProviderAccessTokenURL ¶
func SaasGitKind ¶
SaasGitKind returns the kind for SaaS Git providers or "" if the URL could not be deduced
Types ¶
type GitRepository ¶
type GitRepository struct { ID int64 Name string AllowMergeCommit bool HTMLURL string CloneURL string SSHURL string Language string Fork bool Stars int URL string Scheme string Host string Organisation string Project string Private bool HasIssues bool OpenIssueCount int HasWiki bool HasProjects bool Archived bool }
func ParseGitOrganizationURL ¶
func ParseGitOrganizationURL(text string) (*GitRepository, error)
ParseGitOrganizationURL attempts to parse the given text as a URL or git URL-like string to determine the protocol, host, organisation
func ParseGitURL ¶
func ParseGitURL(text string) (*GitRepository, error)
ParseGitURL attempts to parse the given text as a URL or git URL-like string to determine the protocol, host, organisation and name
func (*GitRepository) HostURL ¶
func (i *GitRepository) HostURL() string
HostURL returns the URL to the host
func (*GitRepository) HostURLWithoutUser ¶
func (i *GitRepository) HostURLWithoutUser() string
func (*GitRepository) HttpURL ¶
func (i *GitRepository) HttpURL() string
HttpURL returns the URL to browse this repository in a web browser
func (*GitRepository) HttpsURL ¶
func (i *GitRepository) HttpsURL() string
HttpsURL returns the URL to browse this repository in a web browser
func (*GitRepository) IsGitHub ¶
func (i *GitRepository) IsGitHub() bool
func (*GitRepository) PipelinePath ¶
func (i *GitRepository) PipelinePath() string
PipelinePath returns the pipeline path for the master branch which can be used to query pipeline logs in `jx get build logs myPipelinePath`
func (*GitRepository) PullRequestURL ¶
func (i *GitRepository) PullRequestURL(prName string) string
PullRequestURL returns the URL of a pull request of the given name/number
func (*GitRepository) URLWithoutUser ¶
func (i *GitRepository) URLWithoutUser() string
URLWithoutUser returns the URL without any user/password