diff --git a/client/image_search.go b/client/image_search.go index 9d4a9ce..4e6bc7d 100644 --- a/client/image_search.go +++ b/client/image_search.go @@ -6,7 +6,7 @@ import ( "net/url" "github.com/docker/docker/api/types" - "github.com/docker/docker/registry" + "github.com/docker/docker/api/types/registry" ) // ImageSearch makes the docker host to search by a term in a remote registry. diff --git a/types/registry/registry.go b/types/registry/registry.go index af57ae6..4fcf986 100644 --- a/types/registry/registry.go +++ b/types/registry/registry.go @@ -73,3 +73,29 @@ type IndexInfo struct { // Official indicates whether this is an official registry Official bool } + +// SearchResult describes a search result returned from a registry +type SearchResult struct { + // StarCount indicates the number of stars this repository has + StarCount int `json:"star_count"` + // IsOfficial indicates whether the result is an official repository or not + IsOfficial bool `json:"is_official"` + // Name is the name of the repository + Name string `json:"name"` + // IsOfficial indicates whether the result is trusted + IsTrusted bool `json:"is_trusted"` + // IsAutomated indicates whether the result is automated + IsAutomated bool `json:"is_automated"` + // Description is a textual description of the repository + Description string `json:"description"` +} + +// SearchResults lists a collection search results returned from a registry +type SearchResults struct { + // Query contains the query string that generated the search results + Query string `json:"query"` + // NumResults indicates the number of results the query returned + NumResults int `json:"num_results"` + // Results is a slice containing the actual results for the search + Results []SearchResult `json:"results"` +}