Move registry.SearchResult types to api/types/registry.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: c4472b389dae8e86c8d98872fcbfe0c63d1e15a1
Component: engine
This commit is contained in:
Daniel Nephin
2015-12-15 11:44:20 -05:00
parent cf6e66f989
commit c85ff1af0e
9 changed files with 38 additions and 35 deletions
+1 -1
View File
@@ -9,8 +9,8 @@ import (
"github.com/docker/docker/api/client/lib"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/registry"
"github.com/docker/docker/pkg/parsers/filters"
"github.com/docker/docker/registry"
"github.com/docker/docker/runconfig"
)
@@ -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.
+2 -1
View File
@@ -8,6 +8,7 @@ import (
"text/tabwriter"
"github.com/docker/docker/api/types"
registrytypes "github.com/docker/docker/api/types/registry"
Cli "github.com/docker/docker/cli"
flag "github.com/docker/docker/pkg/mflag"
"github.com/docker/docker/pkg/stringutils"
@@ -83,7 +84,7 @@ func (cli *DockerCli) CmdSearch(args ...string) error {
}
// SearchResultsByStars sorts search results in descending order by number of stars.
type searchResultsByStars []registry.SearchResult
type searchResultsByStars []registrytypes.SearchResult
func (r searchResultsByStars) Len() int { return len(r) }
func (r searchResultsByStars) Swap(i, j int) { r[i], r[j] = r[j], r[i] }
@@ -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"`
}