api/types: move ImageSearchOptions to api/types/registry

Note that RequestPrivilegeFunc could not be referenced, as it would
introduce a circular import, so copying the definition instead.

Also combining the other search-related types in the package to be in
the same file.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2024-06-09 12:56:03 +02:00
parent b5f15bc0aa
commit f6cc76ceb9
7 changed files with 61 additions and 44 deletions

View File

@@ -7,7 +7,6 @@ import (
"net/url"
"strconv"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/filters"
"github.com/docker/docker/api/types/registry"
"github.com/docker/docker/errdefs"
@@ -15,7 +14,7 @@ import (
// ImageSearch makes the docker host search by a term in a remote registry.
// The list of results is not sorted in any fashion.
func (cli *Client) ImageSearch(ctx context.Context, term string, options types.ImageSearchOptions) ([]registry.SearchResult, error) {
func (cli *Client) ImageSearch(ctx context.Context, term string, options registry.SearchOptions) ([]registry.SearchResult, error) {
var results []registry.SearchResult
query := url.Values{}
query.Set("term", term)