client/image: Wrap result and options in structs#51227
client/image: Wrap result and options in structs#51227austinvazquez merged 6 commits intomoby:masterfrom
Conversation
e24ef59 to
b39c5cf
Compare
| type ImageSearchResult struct { | ||
| Results []registry.SearchResult | ||
| } | ||
|
|
There was a problem hiding this comment.
This one is a bit awkward with Result -> Results -> Result, but I guess it's better to keep it consistent
There was a problem hiding this comment.
We should also consider making this RegistrySearch or ... something something registry, because we only search remote, not local images.
There was a problem hiding this comment.
Hmm, Registry sounds good for this one
There was a problem hiding this comment.
Perhaps for these we should use Items ; also see
b39c5cf to
2572f12
Compare
8ca6d1b to
373f2cd
Compare
| type ImageTagOptions struct { | ||
| Source string | ||
| Target string | ||
| } | ||
|
|
||
| type ImageTagResult struct{} | ||
|
|
||
| // ImageTag tags an image in the docker host | ||
| func (cli *Client) ImageTag(ctx context.Context, source, target string) error { | ||
| func (cli *Client) ImageTag(ctx context.Context, options ImageTagOptions) (ImageTagResult, error) { |
There was a problem hiding this comment.
For this one I ended up extracting both Source and Target to the options struct to make it easier to distinguish between source vs target image.
f36ab73 to
ee54c64
Compare
| // ImageListResult holds the result from ImageList. | ||
| type ImageListResult struct { | ||
| Images []image.Summary | ||
| } |
There was a problem hiding this comment.
Perhaps here as well; Items could work as something we can apply to all the list functions;
@austinvazquez WDYT?
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com> Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
ee54c64 to
6819a9f
Compare
Uh oh!
There was an error while loading. Please reload this page.