Documentation ¶
Overview ¶
Package source contains functions that help with Gerrit source control specific logics.
Index ¶
- func CloneURIFromOrgRepo(org, repo string) string
- func CodeURL(reviewURL string) (string, error)
- func EnsureCodeURL(url string) string
- func IsGerritOrg(org string) bool
- func NormalizeCloneURI(cloneURI string) string
- func NormalizeOrg(org string) string
- func OrgRepoFromCloneURI(cloneURI string) (string, string, error)
- func TrimHTTPSPrefix(in string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloneURIFromOrgRepo ¶
CloneURIFromOrgRepo returns normalized cloneURI from org and repo. The returns cloneURI will always have https:// or http:// prefix, and there is no trailing slash at the end.
func CodeURL ¶
CodeURL converts code review URL into source code URL, simply trimming the `-review` suffix from the name of the org.
Gerrit URL for sourcecode looks like https://android.googlesource.com, and the code review URL looks like https://android-review.googlesource.com/c/platform/frameworks/support/+/2260382.
func EnsureCodeURL ¶
EnsureCodeURL works as CodeRootURL, without errors.
func IsGerritOrg ¶
IsGerritOrg tells whether the org is a Gerrit org or not. It returns true when the org string starts with https:// or http://.
func NormalizeCloneURI ¶
NormalizeCloneURI returns normalized cloneURI. It ensures that cloneURI always has https:// or http:// prefix, and there is no trailing slash at the end. This function should be used everywhere that Gerrit cloneURI is referenced.
func NormalizeOrg ¶
NormalizeOrg returns normalized org. It ensures that org always has https:// or http:// prefix, and there is no trailing slash at the end. This function should be used everywhere that Gerrit org is referenced.
func OrgRepoFromCloneURI ¶
OrgRepoFromCloneURI returns org and repo from cloneURI. The returned org always has https:// or http:// prefix even if cloneURI doesn't have it.
func TrimHTTPSPrefix ¶
TrimHTTPSPrefix trims https:// and http:// from input, also removes all trailing slashes from the end.
Types ¶
This section is empty.