Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Unified Diff: go/src/infra/tools/cipd/client.go

Issue 1194803002: Add a package listing API to cipd. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: go/src/infra/tools/cipd/client.go
diff --git a/go/src/infra/tools/cipd/client.go b/go/src/infra/tools/cipd/client.go
index e6e0c8906082fe1047ef43e2245f4b5598e4e87d..b67ee869e1bb740ace15dcabceeb5f8369efaf65 100644
--- a/go/src/infra/tools/cipd/client.go
+++ b/go/src/infra/tools/cipd/client.go
@@ -167,6 +167,9 @@ type Client interface {
// the site root. It doesn't check whether the instance is already deployed.
FetchAndDeployInstance(pin common.Pin) error
+ // ListPackages returns a list of strings of package names.
+ ListPackages(prefix string) ([]string, error)
+
// ProcessEnsureFile parses text file that describes what should be installed
// by EnsurePackages function. It is a text file where each line has a form:
// <package name> <desired version>. Whitespaces are ignored. Lines that start
@@ -278,6 +281,10 @@ func (client *clientImpl) ModifyACL(packagePath string, changes []PackageACLChan
return client.remote.modifyACL(packagePath, changes)
}
+func (client *clientImpl) ListPackages(prefix string) ([]string, error) {
+ return client.remote.listPackages(prefix)
+}
+
func (client *clientImpl) UploadToCAS(sha1 string, data io.ReadSeeker, session *UploadSession) error {
// Open new upload session if an existing is not provided.
var err error
@@ -596,6 +603,8 @@ type remote interface {
attachTags(pin common.Pin, tags []string) error
fetchInstance(pin common.Pin) (*fetchInstanceResponse, error)
+
+ listPackages(prefix string) ([]string, error)
}
type storage interface {

Powered by Google App Engine
This is Rietveld 408576698