Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsGoogleSourceRemote ¶
IsGoogleSourceRemote returns true if the host url is a googlesource remote.
Types ¶
type RepoStatus ¶
type RepoStatus struct { Name string `json:"name"` CloneUrl string `json:"clone_url"` Description string `json:"description"` Branches map[string]string `json:"branches"` }
RepoStatus represents the status of a remote repository on googlesource.
type RepoStatuses ¶
type RepoStatuses map[string]RepoStatus
RepoStatuses is a map of repository name to RepoStatus.
func GetRepoStatuses ¶
GetRepoStatuses returns the RepoStatus of all public projects hosted on the remote host. Host must be a googlesource host.
NOTE(nlacasse): Googlesource uses gitiles as its git repo browser. gitiles has a completely undocumented feature that allows one to query the state of all repositories in a single request. See "doGetJson" method in https://gerrit.googlesource.com/gitiles/+/master/gitiles-servlet/src/main/java/com/google/gitiles/RepositoryIndexServlet.java
It's possible that gitiles will stop responding to this request at some future version, or that googlesource will move away from gitiles entirely. If that happens we can still get all the repo information in one request by using the /projects/ endpoint on Gerrit. See https://review.typo3.org/Documentation/rest-api-projects.html#list-projects