Browse code

client: deprecate CommonAPIClient interface

The CommonAPIClient was used to define all the stable interfaces,
and combined with the experimental ones through APIClient. In theory,
this would allow someone to make sure they only depended on non-experimental
methods or to implement an alternative client that only implements the
stable methods.

While there are users currently using this interface, all those uses
depend on the actual client implementation, not a custom one, so they
should be able to switch to use APIClient instead. In the meantime,
start with deprecating, but keeping the interface the same for now,
scheduling it to become an alias, and removed in a future release.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Sebastiaan van Stijn authored on 2025/02/04 23:56:10
Showing 6 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,18 @@
0
+package client // import "github.com/docker/docker/client"
1
+
2
+import (
3
+	"context"
4
+
5
+	"github.com/docker/docker/api/types/checkpoint"
6
+)
7
+
8
+// CheckpointAPIClient defines API client methods for the checkpoints.
9
+//
10
+// Experimental: checkpoint and restore is still an experimental feature,
11
+// and only available if the daemon is running with experimental features
12
+// enabled.
13
+type CheckpointAPIClient interface {
14
+	CheckpointCreate(ctx context.Context, container string, options checkpoint.CreateOptions) error
15
+	CheckpointDelete(ctx context.Context, container string, options checkpoint.DeleteOptions) error
16
+	CheckpointList(ctx context.Context, container string, options checkpoint.ListOptions) ([]checkpoint.Summary, error)
17
+}
... ...
@@ -99,6 +99,9 @@ const DummyHost = "api.moby.localhost"
99 99
 // recent version before negotiation was introduced.
100 100
 const fallbackAPIVersion = "1.24"
101 101
 
102
+// Ensure that Client always implements APIClient.
103
+var _ APIClient = &Client{}
104
+
102 105
 // Client is the API client that performs all operations
103 106
 // against a docker server.
104 107
 type Client struct {
105 108
new file mode 100644
... ...
@@ -0,0 +1,224 @@
0
+package client // import "github.com/docker/docker/client"
1
+
2
+import (
3
+	"context"
4
+	"io"
5
+	"net"
6
+	"net/http"
7
+
8
+	"github.com/docker/docker/api/types"
9
+	"github.com/docker/docker/api/types/container"
10
+	"github.com/docker/docker/api/types/events"
11
+	"github.com/docker/docker/api/types/filters"
12
+	"github.com/docker/docker/api/types/image"
13
+	"github.com/docker/docker/api/types/network"
14
+	"github.com/docker/docker/api/types/registry"
15
+	"github.com/docker/docker/api/types/swarm"
16
+	"github.com/docker/docker/api/types/system"
17
+	"github.com/docker/docker/api/types/volume"
18
+	ocispec "github.com/opencontainers/image-spec/specs-go/v1"
19
+)
20
+
21
+// CommonAPIClient is the common methods between stable and experimental versions of APIClient.
22
+//
23
+// Deprecated: use [APIClient] instead. This type will be an alias for [APIClient] in the next release, and removed after.
24
+type CommonAPIClient = stableAPIClient
25
+
26
+// APIClient is an interface that clients that talk with a docker server must implement.
27
+type APIClient interface {
28
+	stableAPIClient
29
+	CheckpointAPIClient // CheckpointAPIClient is still experimental.
30
+}
31
+
32
+type stableAPIClient interface {
33
+	ConfigAPIClient
34
+	ContainerAPIClient
35
+	DistributionAPIClient
36
+	ImageAPIClient
37
+	NetworkAPIClient
38
+	PluginAPIClient
39
+	SystemAPIClient
40
+	VolumeAPIClient
41
+	ClientVersion() string
42
+	DaemonHost() string
43
+	HTTPClient() *http.Client
44
+	ServerVersion(ctx context.Context) (types.Version, error)
45
+	NegotiateAPIVersion(ctx context.Context)
46
+	NegotiateAPIVersionPing(types.Ping)
47
+	HijackDialer
48
+	Dialer() func(context.Context) (net.Conn, error)
49
+	Close() error
50
+	SwarmManagementAPIClient
51
+}
52
+
53
+// SwarmManagementAPIClient defines all methods for managing Swarm-specific
54
+// objects.
55
+type SwarmManagementAPIClient interface {
56
+	SwarmAPIClient
57
+	NodeAPIClient
58
+	ServiceAPIClient
59
+	SecretAPIClient
60
+	ConfigAPIClient
61
+}
62
+
63
+// HijackDialer defines methods for a hijack dialer.
64
+type HijackDialer interface {
65
+	DialHijack(ctx context.Context, url, proto string, meta map[string][]string) (net.Conn, error)
66
+}
67
+
68
+// ContainerAPIClient defines API client methods for the containers
69
+type ContainerAPIClient interface {
70
+	ContainerAttach(ctx context.Context, container string, options container.AttachOptions) (types.HijackedResponse, error)
71
+	ContainerCommit(ctx context.Context, container string, options container.CommitOptions) (types.IDResponse, error)
72
+	ContainerCreate(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, platform *ocispec.Platform, containerName string) (container.CreateResponse, error)
73
+	ContainerDiff(ctx context.Context, container string) ([]container.FilesystemChange, error)
74
+	ContainerExecAttach(ctx context.Context, execID string, options container.ExecAttachOptions) (types.HijackedResponse, error)
75
+	ContainerExecCreate(ctx context.Context, container string, options container.ExecOptions) (types.IDResponse, error)
76
+	ContainerExecInspect(ctx context.Context, execID string) (container.ExecInspect, error)
77
+	ContainerExecResize(ctx context.Context, execID string, options container.ResizeOptions) error
78
+	ContainerExecStart(ctx context.Context, execID string, options container.ExecStartOptions) error
79
+	ContainerExport(ctx context.Context, container string) (io.ReadCloser, error)
80
+	ContainerInspect(ctx context.Context, container string) (container.InspectResponse, error)
81
+	ContainerInspectWithRaw(ctx context.Context, container string, getSize bool) (container.InspectResponse, []byte, error)
82
+	ContainerKill(ctx context.Context, container, signal string) error
83
+	ContainerList(ctx context.Context, options container.ListOptions) ([]container.Summary, error)
84
+	ContainerLogs(ctx context.Context, container string, options container.LogsOptions) (io.ReadCloser, error)
85
+	ContainerPause(ctx context.Context, container string) error
86
+	ContainerRemove(ctx context.Context, container string, options container.RemoveOptions) error
87
+	ContainerRename(ctx context.Context, container, newContainerName string) error
88
+	ContainerResize(ctx context.Context, container string, options container.ResizeOptions) error
89
+	ContainerRestart(ctx context.Context, container string, options container.StopOptions) error
90
+	ContainerStatPath(ctx context.Context, container, path string) (container.PathStat, error)
91
+	ContainerStats(ctx context.Context, container string, stream bool) (container.StatsResponseReader, error)
92
+	ContainerStatsOneShot(ctx context.Context, container string) (container.StatsResponseReader, error)
93
+	ContainerStart(ctx context.Context, container string, options container.StartOptions) error
94
+	ContainerStop(ctx context.Context, container string, options container.StopOptions) error
95
+	ContainerTop(ctx context.Context, container string, arguments []string) (container.ContainerTopOKBody, error)
96
+	ContainerUnpause(ctx context.Context, container string) error
97
+	ContainerUpdate(ctx context.Context, container string, updateConfig container.UpdateConfig) (container.ContainerUpdateOKBody, error)
98
+	ContainerWait(ctx context.Context, container string, condition container.WaitCondition) (<-chan container.WaitResponse, <-chan error)
99
+	CopyFromContainer(ctx context.Context, container, srcPath string) (io.ReadCloser, container.PathStat, error)
100
+	CopyToContainer(ctx context.Context, container, path string, content io.Reader, options container.CopyToContainerOptions) error
101
+	ContainersPrune(ctx context.Context, pruneFilters filters.Args) (container.PruneReport, error)
102
+}
103
+
104
+// DistributionAPIClient defines API client methods for the registry
105
+type DistributionAPIClient interface {
106
+	DistributionInspect(ctx context.Context, image, encodedRegistryAuth string) (registry.DistributionInspect, error)
107
+}
108
+
109
+// ImageAPIClient defines API client methods for the images
110
+type ImageAPIClient interface {
111
+	ImageBuild(ctx context.Context, context io.Reader, options types.ImageBuildOptions) (types.ImageBuildResponse, error)
112
+	BuildCachePrune(ctx context.Context, opts types.BuildCachePruneOptions) (*types.BuildCachePruneReport, error)
113
+	BuildCancel(ctx context.Context, id string) error
114
+	ImageCreate(ctx context.Context, parentReference string, options image.CreateOptions) (io.ReadCloser, error)
115
+	ImageHistory(ctx context.Context, image string, opts image.HistoryOptions) ([]image.HistoryResponseItem, error)
116
+	ImageImport(ctx context.Context, source image.ImportSource, ref string, options image.ImportOptions) (io.ReadCloser, error)
117
+	ImageInspectWithRaw(ctx context.Context, image string) (image.InspectResponse, []byte, error)
118
+	ImageList(ctx context.Context, options image.ListOptions) ([]image.Summary, error)
119
+	ImageLoad(ctx context.Context, input io.Reader, opts image.LoadOptions) (image.LoadResponse, error)
120
+	ImagePull(ctx context.Context, ref string, options image.PullOptions) (io.ReadCloser, error)
121
+	ImagePush(ctx context.Context, ref string, options image.PushOptions) (io.ReadCloser, error)
122
+	ImageRemove(ctx context.Context, image string, options image.RemoveOptions) ([]image.DeleteResponse, error)
123
+	ImageSave(ctx context.Context, images []string, opts image.SaveOptions) (io.ReadCloser, error)
124
+	ImageSearch(ctx context.Context, term string, options registry.SearchOptions) ([]registry.SearchResult, error)
125
+	ImageTag(ctx context.Context, image, ref string) error
126
+	ImagesPrune(ctx context.Context, pruneFilter filters.Args) (image.PruneReport, error)
127
+}
128
+
129
+// NetworkAPIClient defines API client methods for the networks
130
+type NetworkAPIClient interface {
131
+	NetworkConnect(ctx context.Context, network, container string, config *network.EndpointSettings) error
132
+	NetworkCreate(ctx context.Context, name string, options network.CreateOptions) (network.CreateResponse, error)
133
+	NetworkDisconnect(ctx context.Context, network, container string, force bool) error
134
+	NetworkInspect(ctx context.Context, network string, options network.InspectOptions) (network.Inspect, error)
135
+	NetworkInspectWithRaw(ctx context.Context, network string, options network.InspectOptions) (network.Inspect, []byte, error)
136
+	NetworkList(ctx context.Context, options network.ListOptions) ([]network.Summary, error)
137
+	NetworkRemove(ctx context.Context, network string) error
138
+	NetworksPrune(ctx context.Context, pruneFilter filters.Args) (network.PruneReport, error)
139
+}
140
+
141
+// NodeAPIClient defines API client methods for the nodes
142
+type NodeAPIClient interface {
143
+	NodeInspectWithRaw(ctx context.Context, nodeID string) (swarm.Node, []byte, error)
144
+	NodeList(ctx context.Context, options types.NodeListOptions) ([]swarm.Node, error)
145
+	NodeRemove(ctx context.Context, nodeID string, options types.NodeRemoveOptions) error
146
+	NodeUpdate(ctx context.Context, nodeID string, version swarm.Version, node swarm.NodeSpec) error
147
+}
148
+
149
+// PluginAPIClient defines API client methods for the plugins
150
+type PluginAPIClient interface {
151
+	PluginList(ctx context.Context, filter filters.Args) (types.PluginsListResponse, error)
152
+	PluginRemove(ctx context.Context, name string, options types.PluginRemoveOptions) error
153
+	PluginEnable(ctx context.Context, name string, options types.PluginEnableOptions) error
154
+	PluginDisable(ctx context.Context, name string, options types.PluginDisableOptions) error
155
+	PluginInstall(ctx context.Context, name string, options types.PluginInstallOptions) (io.ReadCloser, error)
156
+	PluginUpgrade(ctx context.Context, name string, options types.PluginInstallOptions) (io.ReadCloser, error)
157
+	PluginPush(ctx context.Context, name string, registryAuth string) (io.ReadCloser, error)
158
+	PluginSet(ctx context.Context, name string, args []string) error
159
+	PluginInspectWithRaw(ctx context.Context, name string) (*types.Plugin, []byte, error)
160
+	PluginCreate(ctx context.Context, createContext io.Reader, options types.PluginCreateOptions) error
161
+}
162
+
163
+// ServiceAPIClient defines API client methods for the services
164
+type ServiceAPIClient interface {
165
+	ServiceCreate(ctx context.Context, service swarm.ServiceSpec, options types.ServiceCreateOptions) (swarm.ServiceCreateResponse, error)
166
+	ServiceInspectWithRaw(ctx context.Context, serviceID string, options types.ServiceInspectOptions) (swarm.Service, []byte, error)
167
+	ServiceList(ctx context.Context, options types.ServiceListOptions) ([]swarm.Service, error)
168
+	ServiceRemove(ctx context.Context, serviceID string) error
169
+	ServiceUpdate(ctx context.Context, serviceID string, version swarm.Version, service swarm.ServiceSpec, options types.ServiceUpdateOptions) (swarm.ServiceUpdateResponse, error)
170
+	ServiceLogs(ctx context.Context, serviceID string, options container.LogsOptions) (io.ReadCloser, error)
171
+	TaskLogs(ctx context.Context, taskID string, options container.LogsOptions) (io.ReadCloser, error)
172
+	TaskInspectWithRaw(ctx context.Context, taskID string) (swarm.Task, []byte, error)
173
+	TaskList(ctx context.Context, options types.TaskListOptions) ([]swarm.Task, error)
174
+}
175
+
176
+// SwarmAPIClient defines API client methods for the swarm
177
+type SwarmAPIClient interface {
178
+	SwarmInit(ctx context.Context, req swarm.InitRequest) (string, error)
179
+	SwarmJoin(ctx context.Context, req swarm.JoinRequest) error
180
+	SwarmGetUnlockKey(ctx context.Context) (types.SwarmUnlockKeyResponse, error)
181
+	SwarmUnlock(ctx context.Context, req swarm.UnlockRequest) error
182
+	SwarmLeave(ctx context.Context, force bool) error
183
+	SwarmInspect(ctx context.Context) (swarm.Swarm, error)
184
+	SwarmUpdate(ctx context.Context, version swarm.Version, swarm swarm.Spec, flags swarm.UpdateFlags) error
185
+}
186
+
187
+// SystemAPIClient defines API client methods for the system
188
+type SystemAPIClient interface {
189
+	Events(ctx context.Context, options events.ListOptions) (<-chan events.Message, <-chan error)
190
+	Info(ctx context.Context) (system.Info, error)
191
+	RegistryLogin(ctx context.Context, auth registry.AuthConfig) (registry.AuthenticateOKBody, error)
192
+	DiskUsage(ctx context.Context, options types.DiskUsageOptions) (types.DiskUsage, error)
193
+	Ping(ctx context.Context) (types.Ping, error)
194
+}
195
+
196
+// VolumeAPIClient defines API client methods for the volumes
197
+type VolumeAPIClient interface {
198
+	VolumeCreate(ctx context.Context, options volume.CreateOptions) (volume.Volume, error)
199
+	VolumeInspect(ctx context.Context, volumeID string) (volume.Volume, error)
200
+	VolumeInspectWithRaw(ctx context.Context, volumeID string) (volume.Volume, []byte, error)
201
+	VolumeList(ctx context.Context, options volume.ListOptions) (volume.ListResponse, error)
202
+	VolumeRemove(ctx context.Context, volumeID string, force bool) error
203
+	VolumesPrune(ctx context.Context, pruneFilter filters.Args) (volume.PruneReport, error)
204
+	VolumeUpdate(ctx context.Context, volumeID string, version swarm.Version, options volume.UpdateOptions) error
205
+}
206
+
207
+// SecretAPIClient defines API client methods for secrets
208
+type SecretAPIClient interface {
209
+	SecretList(ctx context.Context, options types.SecretListOptions) ([]swarm.Secret, error)
210
+	SecretCreate(ctx context.Context, secret swarm.SecretSpec) (types.SecretCreateResponse, error)
211
+	SecretRemove(ctx context.Context, id string) error
212
+	SecretInspectWithRaw(ctx context.Context, name string) (swarm.Secret, []byte, error)
213
+	SecretUpdate(ctx context.Context, id string, version swarm.Version, secret swarm.SecretSpec) error
214
+}
215
+
216
+// ConfigAPIClient defines API client methods for configs
217
+type ConfigAPIClient interface {
218
+	ConfigList(ctx context.Context, options types.ConfigListOptions) ([]swarm.Config, error)
219
+	ConfigCreate(ctx context.Context, config swarm.ConfigSpec) (types.ConfigCreateResponse, error)
220
+	ConfigRemove(ctx context.Context, id string) error
221
+	ConfigInspectWithRaw(ctx context.Context, name string) (swarm.Config, []byte, error)
222
+	ConfigUpdate(ctx context.Context, id string, version swarm.Version, config swarm.ConfigSpec) error
223
+}
0 224
deleted file mode 100644
... ...
@@ -1,214 +0,0 @@
1
-package client // import "github.com/docker/docker/client"
2
-
3
-import (
4
-	"context"
5
-	"io"
6
-	"net"
7
-	"net/http"
8
-
9
-	"github.com/docker/docker/api/types"
10
-	"github.com/docker/docker/api/types/container"
11
-	"github.com/docker/docker/api/types/events"
12
-	"github.com/docker/docker/api/types/filters"
13
-	"github.com/docker/docker/api/types/image"
14
-	"github.com/docker/docker/api/types/network"
15
-	"github.com/docker/docker/api/types/registry"
16
-	"github.com/docker/docker/api/types/swarm"
17
-	"github.com/docker/docker/api/types/system"
18
-	"github.com/docker/docker/api/types/volume"
19
-	ocispec "github.com/opencontainers/image-spec/specs-go/v1"
20
-)
21
-
22
-// CommonAPIClient is the common methods between stable and experimental versions of APIClient.
23
-type CommonAPIClient interface {
24
-	ConfigAPIClient
25
-	ContainerAPIClient
26
-	DistributionAPIClient
27
-	ImageAPIClient
28
-	NetworkAPIClient
29
-	PluginAPIClient
30
-	SystemAPIClient
31
-	VolumeAPIClient
32
-	ClientVersion() string
33
-	DaemonHost() string
34
-	HTTPClient() *http.Client
35
-	ServerVersion(ctx context.Context) (types.Version, error)
36
-	NegotiateAPIVersion(ctx context.Context)
37
-	NegotiateAPIVersionPing(types.Ping)
38
-	HijackDialer
39
-	Dialer() func(context.Context) (net.Conn, error)
40
-	Close() error
41
-	SwarmManagementAPIClient
42
-}
43
-
44
-// SwarmManagementAPIClient defines all methods for managing Swarm-specific
45
-// objects.
46
-type SwarmManagementAPIClient interface {
47
-	SwarmAPIClient
48
-	NodeAPIClient
49
-	ServiceAPIClient
50
-	SecretAPIClient
51
-	ConfigAPIClient
52
-}
53
-
54
-// HijackDialer defines methods for a hijack dialer.
55
-type HijackDialer interface {
56
-	DialHijack(ctx context.Context, url, proto string, meta map[string][]string) (net.Conn, error)
57
-}
58
-
59
-// ContainerAPIClient defines API client methods for the containers
60
-type ContainerAPIClient interface {
61
-	ContainerAttach(ctx context.Context, container string, options container.AttachOptions) (types.HijackedResponse, error)
62
-	ContainerCommit(ctx context.Context, container string, options container.CommitOptions) (types.IDResponse, error)
63
-	ContainerCreate(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, platform *ocispec.Platform, containerName string) (container.CreateResponse, error)
64
-	ContainerDiff(ctx context.Context, container string) ([]container.FilesystemChange, error)
65
-	ContainerExecAttach(ctx context.Context, execID string, options container.ExecAttachOptions) (types.HijackedResponse, error)
66
-	ContainerExecCreate(ctx context.Context, container string, options container.ExecOptions) (types.IDResponse, error)
67
-	ContainerExecInspect(ctx context.Context, execID string) (container.ExecInspect, error)
68
-	ContainerExecResize(ctx context.Context, execID string, options container.ResizeOptions) error
69
-	ContainerExecStart(ctx context.Context, execID string, options container.ExecStartOptions) error
70
-	ContainerExport(ctx context.Context, container string) (io.ReadCloser, error)
71
-	ContainerInspect(ctx context.Context, container string) (container.InspectResponse, error)
72
-	ContainerInspectWithRaw(ctx context.Context, container string, getSize bool) (container.InspectResponse, []byte, error)
73
-	ContainerKill(ctx context.Context, container, signal string) error
74
-	ContainerList(ctx context.Context, options container.ListOptions) ([]container.Summary, error)
75
-	ContainerLogs(ctx context.Context, container string, options container.LogsOptions) (io.ReadCloser, error)
76
-	ContainerPause(ctx context.Context, container string) error
77
-	ContainerRemove(ctx context.Context, container string, options container.RemoveOptions) error
78
-	ContainerRename(ctx context.Context, container, newContainerName string) error
79
-	ContainerResize(ctx context.Context, container string, options container.ResizeOptions) error
80
-	ContainerRestart(ctx context.Context, container string, options container.StopOptions) error
81
-	ContainerStatPath(ctx context.Context, container, path string) (container.PathStat, error)
82
-	ContainerStats(ctx context.Context, container string, stream bool) (container.StatsResponseReader, error)
83
-	ContainerStatsOneShot(ctx context.Context, container string) (container.StatsResponseReader, error)
84
-	ContainerStart(ctx context.Context, container string, options container.StartOptions) error
85
-	ContainerStop(ctx context.Context, container string, options container.StopOptions) error
86
-	ContainerTop(ctx context.Context, container string, arguments []string) (container.ContainerTopOKBody, error)
87
-	ContainerUnpause(ctx context.Context, container string) error
88
-	ContainerUpdate(ctx context.Context, container string, updateConfig container.UpdateConfig) (container.ContainerUpdateOKBody, error)
89
-	ContainerWait(ctx context.Context, container string, condition container.WaitCondition) (<-chan container.WaitResponse, <-chan error)
90
-	CopyFromContainer(ctx context.Context, container, srcPath string) (io.ReadCloser, container.PathStat, error)
91
-	CopyToContainer(ctx context.Context, container, path string, content io.Reader, options container.CopyToContainerOptions) error
92
-	ContainersPrune(ctx context.Context, pruneFilters filters.Args) (container.PruneReport, error)
93
-}
94
-
95
-// DistributionAPIClient defines API client methods for the registry
96
-type DistributionAPIClient interface {
97
-	DistributionInspect(ctx context.Context, image, encodedRegistryAuth string) (registry.DistributionInspect, error)
98
-}
99
-
100
-// ImageAPIClient defines API client methods for the images
101
-type ImageAPIClient interface {
102
-	ImageBuild(ctx context.Context, context io.Reader, options types.ImageBuildOptions) (types.ImageBuildResponse, error)
103
-	BuildCachePrune(ctx context.Context, opts types.BuildCachePruneOptions) (*types.BuildCachePruneReport, error)
104
-	BuildCancel(ctx context.Context, id string) error
105
-	ImageCreate(ctx context.Context, parentReference string, options image.CreateOptions) (io.ReadCloser, error)
106
-	ImageHistory(ctx context.Context, image string, opts image.HistoryOptions) ([]image.HistoryResponseItem, error)
107
-	ImageImport(ctx context.Context, source image.ImportSource, ref string, options image.ImportOptions) (io.ReadCloser, error)
108
-	ImageInspectWithRaw(ctx context.Context, image string) (image.InspectResponse, []byte, error)
109
-	ImageList(ctx context.Context, options image.ListOptions) ([]image.Summary, error)
110
-	ImageLoad(ctx context.Context, input io.Reader, opts image.LoadOptions) (image.LoadResponse, error)
111
-	ImagePull(ctx context.Context, ref string, options image.PullOptions) (io.ReadCloser, error)
112
-	ImagePush(ctx context.Context, ref string, options image.PushOptions) (io.ReadCloser, error)
113
-	ImageRemove(ctx context.Context, image string, options image.RemoveOptions) ([]image.DeleteResponse, error)
114
-	ImageSave(ctx context.Context, images []string, opts image.SaveOptions) (io.ReadCloser, error)
115
-	ImageSearch(ctx context.Context, term string, options registry.SearchOptions) ([]registry.SearchResult, error)
116
-	ImageTag(ctx context.Context, image, ref string) error
117
-	ImagesPrune(ctx context.Context, pruneFilter filters.Args) (image.PruneReport, error)
118
-}
119
-
120
-// NetworkAPIClient defines API client methods for the networks
121
-type NetworkAPIClient interface {
122
-	NetworkConnect(ctx context.Context, network, container string, config *network.EndpointSettings) error
123
-	NetworkCreate(ctx context.Context, name string, options network.CreateOptions) (network.CreateResponse, error)
124
-	NetworkDisconnect(ctx context.Context, network, container string, force bool) error
125
-	NetworkInspect(ctx context.Context, network string, options network.InspectOptions) (network.Inspect, error)
126
-	NetworkInspectWithRaw(ctx context.Context, network string, options network.InspectOptions) (network.Inspect, []byte, error)
127
-	NetworkList(ctx context.Context, options network.ListOptions) ([]network.Summary, error)
128
-	NetworkRemove(ctx context.Context, network string) error
129
-	NetworksPrune(ctx context.Context, pruneFilter filters.Args) (network.PruneReport, error)
130
-}
131
-
132
-// NodeAPIClient defines API client methods for the nodes
133
-type NodeAPIClient interface {
134
-	NodeInspectWithRaw(ctx context.Context, nodeID string) (swarm.Node, []byte, error)
135
-	NodeList(ctx context.Context, options types.NodeListOptions) ([]swarm.Node, error)
136
-	NodeRemove(ctx context.Context, nodeID string, options types.NodeRemoveOptions) error
137
-	NodeUpdate(ctx context.Context, nodeID string, version swarm.Version, node swarm.NodeSpec) error
138
-}
139
-
140
-// PluginAPIClient defines API client methods for the plugins
141
-type PluginAPIClient interface {
142
-	PluginList(ctx context.Context, filter filters.Args) (types.PluginsListResponse, error)
143
-	PluginRemove(ctx context.Context, name string, options types.PluginRemoveOptions) error
144
-	PluginEnable(ctx context.Context, name string, options types.PluginEnableOptions) error
145
-	PluginDisable(ctx context.Context, name string, options types.PluginDisableOptions) error
146
-	PluginInstall(ctx context.Context, name string, options types.PluginInstallOptions) (io.ReadCloser, error)
147
-	PluginUpgrade(ctx context.Context, name string, options types.PluginInstallOptions) (io.ReadCloser, error)
148
-	PluginPush(ctx context.Context, name string, registryAuth string) (io.ReadCloser, error)
149
-	PluginSet(ctx context.Context, name string, args []string) error
150
-	PluginInspectWithRaw(ctx context.Context, name string) (*types.Plugin, []byte, error)
151
-	PluginCreate(ctx context.Context, createContext io.Reader, options types.PluginCreateOptions) error
152
-}
153
-
154
-// ServiceAPIClient defines API client methods for the services
155
-type ServiceAPIClient interface {
156
-	ServiceCreate(ctx context.Context, service swarm.ServiceSpec, options types.ServiceCreateOptions) (swarm.ServiceCreateResponse, error)
157
-	ServiceInspectWithRaw(ctx context.Context, serviceID string, options types.ServiceInspectOptions) (swarm.Service, []byte, error)
158
-	ServiceList(ctx context.Context, options types.ServiceListOptions) ([]swarm.Service, error)
159
-	ServiceRemove(ctx context.Context, serviceID string) error
160
-	ServiceUpdate(ctx context.Context, serviceID string, version swarm.Version, service swarm.ServiceSpec, options types.ServiceUpdateOptions) (swarm.ServiceUpdateResponse, error)
161
-	ServiceLogs(ctx context.Context, serviceID string, options container.LogsOptions) (io.ReadCloser, error)
162
-	TaskLogs(ctx context.Context, taskID string, options container.LogsOptions) (io.ReadCloser, error)
163
-	TaskInspectWithRaw(ctx context.Context, taskID string) (swarm.Task, []byte, error)
164
-	TaskList(ctx context.Context, options types.TaskListOptions) ([]swarm.Task, error)
165
-}
166
-
167
-// SwarmAPIClient defines API client methods for the swarm
168
-type SwarmAPIClient interface {
169
-	SwarmInit(ctx context.Context, req swarm.InitRequest) (string, error)
170
-	SwarmJoin(ctx context.Context, req swarm.JoinRequest) error
171
-	SwarmGetUnlockKey(ctx context.Context) (types.SwarmUnlockKeyResponse, error)
172
-	SwarmUnlock(ctx context.Context, req swarm.UnlockRequest) error
173
-	SwarmLeave(ctx context.Context, force bool) error
174
-	SwarmInspect(ctx context.Context) (swarm.Swarm, error)
175
-	SwarmUpdate(ctx context.Context, version swarm.Version, swarm swarm.Spec, flags swarm.UpdateFlags) error
176
-}
177
-
178
-// SystemAPIClient defines API client methods for the system
179
-type SystemAPIClient interface {
180
-	Events(ctx context.Context, options events.ListOptions) (<-chan events.Message, <-chan error)
181
-	Info(ctx context.Context) (system.Info, error)
182
-	RegistryLogin(ctx context.Context, auth registry.AuthConfig) (registry.AuthenticateOKBody, error)
183
-	DiskUsage(ctx context.Context, options types.DiskUsageOptions) (types.DiskUsage, error)
184
-	Ping(ctx context.Context) (types.Ping, error)
185
-}
186
-
187
-// VolumeAPIClient defines API client methods for the volumes
188
-type VolumeAPIClient interface {
189
-	VolumeCreate(ctx context.Context, options volume.CreateOptions) (volume.Volume, error)
190
-	VolumeInspect(ctx context.Context, volumeID string) (volume.Volume, error)
191
-	VolumeInspectWithRaw(ctx context.Context, volumeID string) (volume.Volume, []byte, error)
192
-	VolumeList(ctx context.Context, options volume.ListOptions) (volume.ListResponse, error)
193
-	VolumeRemove(ctx context.Context, volumeID string, force bool) error
194
-	VolumesPrune(ctx context.Context, pruneFilter filters.Args) (volume.PruneReport, error)
195
-	VolumeUpdate(ctx context.Context, volumeID string, version swarm.Version, options volume.UpdateOptions) error
196
-}
197
-
198
-// SecretAPIClient defines API client methods for secrets
199
-type SecretAPIClient interface {
200
-	SecretList(ctx context.Context, options types.SecretListOptions) ([]swarm.Secret, error)
201
-	SecretCreate(ctx context.Context, secret swarm.SecretSpec) (types.SecretCreateResponse, error)
202
-	SecretRemove(ctx context.Context, id string) error
203
-	SecretInspectWithRaw(ctx context.Context, name string) (swarm.Secret, []byte, error)
204
-	SecretUpdate(ctx context.Context, id string, version swarm.Version, secret swarm.SecretSpec) error
205
-}
206
-
207
-// ConfigAPIClient defines API client methods for configs
208
-type ConfigAPIClient interface {
209
-	ConfigList(ctx context.Context, options types.ConfigListOptions) ([]swarm.Config, error)
210
-	ConfigCreate(ctx context.Context, config swarm.ConfigSpec) (types.ConfigCreateResponse, error)
211
-	ConfigRemove(ctx context.Context, id string) error
212
-	ConfigInspectWithRaw(ctx context.Context, name string) (swarm.Config, []byte, error)
213
-	ConfigUpdate(ctx context.Context, id string, version swarm.Version, config swarm.ConfigSpec) error
214
-}
215 1
deleted file mode 100644
... ...
@@ -1,18 +0,0 @@
1
-package client // import "github.com/docker/docker/client"
2
-
3
-import (
4
-	"context"
5
-
6
-	"github.com/docker/docker/api/types/checkpoint"
7
-)
8
-
9
-type apiClientExperimental interface {
10
-	CheckpointAPIClient
11
-}
12
-
13
-// CheckpointAPIClient defines API client methods for the checkpoints
14
-type CheckpointAPIClient interface {
15
-	CheckpointCreate(ctx context.Context, container string, options checkpoint.CreateOptions) error
16
-	CheckpointDelete(ctx context.Context, container string, options checkpoint.DeleteOptions) error
17
-	CheckpointList(ctx context.Context, container string, options checkpoint.ListOptions) ([]checkpoint.Summary, error)
18
-}
19 1
deleted file mode 100644
... ...
@@ -1,10 +0,0 @@
1
-package client // import "github.com/docker/docker/client"
2
-
3
-// APIClient is an interface that clients that talk with a docker server must implement.
4
-type APIClient interface {
5
-	CommonAPIClient
6
-	apiClientExperimental
7
-}
8
-
9
-// Ensure that Client always implements APIClient.
10
-var _ APIClient = &Client{}