Files
docker-cli/cli/command/checkpoint/client_test.go
Sebastiaan van Stijn 4b450f113b vendor: github.com/moby/moby/api, moby/client master
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-10 16:32:05 +01:00

36 lines
1.3 KiB
Go

package checkpoint
import (
"context"
"github.com/moby/moby/client"
)
type fakeClient struct {
client.Client
checkpointCreateFunc func(container string, options client.CheckpointCreateOptions) (client.CheckpointCreateResult, error)
checkpointDeleteFunc func(container string, options client.CheckpointRemoveOptions) (client.CheckpointRemoveResult, error)
checkpointListFunc func(container string, options client.CheckpointListOptions) (client.CheckpointListResult, error)
}
func (cli *fakeClient) CheckpointCreate(_ context.Context, container string, options client.CheckpointCreateOptions) (client.CheckpointCreateResult, error) {
if cli.checkpointCreateFunc != nil {
return cli.checkpointCreateFunc(container, options)
}
return client.CheckpointCreateResult{}, nil
}
func (cli *fakeClient) CheckpointRemove(_ context.Context, container string, options client.CheckpointRemoveOptions) (client.CheckpointRemoveResult, error) {
if cli.checkpointDeleteFunc != nil {
return cli.checkpointDeleteFunc(container, options)
}
return client.CheckpointRemoveResult{}, nil
}
func (cli *fakeClient) CheckpointList(_ context.Context, container string, options client.CheckpointListOptions) (client.CheckpointListResult, error) {
if cli.checkpointListFunc != nil {
return cli.checkpointListFunc(container, options)
}
return client.CheckpointListResult{}, nil
}