full diff: - https://github.com/docker/docker/compare/api/v1.52.0-alpha.1...7145e7666b8f - https://github.com/docker/docker/compare/client/v0.1.0-alpha.0...7145e7666b8f Signed-off-by: Sebastiaan van Stijn <github@gone.nl> WIP latest Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
29 lines
819 B
Go
29 lines
819 B
Go
package task
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/moby/moby/api/types/swarm"
|
|
"github.com/moby/moby/client"
|
|
)
|
|
|
|
type fakeClient struct {
|
|
client.APIClient
|
|
nodeInspectWithRaw func(ref string) (swarm.Node, []byte, error)
|
|
serviceInspectWithRaw func(ref string, options client.ServiceInspectOptions) (swarm.Service, []byte, error)
|
|
}
|
|
|
|
func (cli *fakeClient) NodeInspectWithRaw(_ context.Context, ref string) (swarm.Node, []byte, error) {
|
|
if cli.nodeInspectWithRaw != nil {
|
|
return cli.nodeInspectWithRaw(ref)
|
|
}
|
|
return swarm.Node{}, nil, nil
|
|
}
|
|
|
|
func (cli *fakeClient) ServiceInspectWithRaw(_ context.Context, ref string, options client.ServiceInspectOptions) (swarm.Service, []byte, error) {
|
|
if cli.serviceInspectWithRaw != nil {
|
|
return cli.serviceInspectWithRaw(ref, options)
|
|
}
|
|
return swarm.Service{}, nil, nil
|
|
}
|