mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
client: Move opts to separate files
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
@@ -10,16 +10,6 @@ import (
|
||||
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
)
|
||||
|
||||
// ImageHistoryOption is a type representing functional options for the image history operation.
|
||||
type ImageHistoryOption interface {
|
||||
Apply(*imageHistoryOpts) error
|
||||
}
|
||||
type imageHistoryOptionFunc func(opt *imageHistoryOpts) error
|
||||
|
||||
func (f imageHistoryOptionFunc) Apply(o *imageHistoryOpts) error {
|
||||
return f(o)
|
||||
}
|
||||
|
||||
// ImageHistoryWithPlatform sets the platform for the image history operation.
|
||||
func ImageHistoryWithPlatform(platform ocispec.Platform) ImageHistoryOption {
|
||||
return imageHistoryOptionFunc(func(opt *imageHistoryOpts) error {
|
||||
@@ -31,10 +21,6 @@ func ImageHistoryWithPlatform(platform ocispec.Platform) ImageHistoryOption {
|
||||
})
|
||||
}
|
||||
|
||||
type imageHistoryOpts struct {
|
||||
apiOptions image.HistoryOptions
|
||||
}
|
||||
|
||||
// ImageHistory returns the changes in an image in history format.
|
||||
func (cli *Client) ImageHistory(ctx context.Context, imageID string, historyOpts ...ImageHistoryOption) ([]image.HistoryResponseItem, error) {
|
||||
query := url.Values{}
|
||||
|
||||
Reference in New Issue
Block a user