googlesource

package
v0.0.0-...-abfb8b1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 15, 2016 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsGoogleSourceRemote

func IsGoogleSourceRemote(host string) bool

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

func GetRepoStatuses(jirix *jiri.X, host string, branches []string) (RepoStatuses, error)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL