Alias container and network packages to stop name clashes
Yong Tang authored on 2018/01/20 02:53:06... | ... |
@@ -6,11 +6,11 @@ import ( |
6 | 6 |
"time" |
7 | 7 |
|
8 | 8 |
"github.com/docker/docker/api/types" |
9 |
- "github.com/docker/docker/api/types/container" |
|
9 |
+ containertypes "github.com/docker/docker/api/types/container" |
|
10 | 10 |
"github.com/docker/docker/api/types/events" |
11 | 11 |
"github.com/docker/docker/api/types/filters" |
12 | 12 |
"github.com/docker/docker/api/types/image" |
13 |
- "github.com/docker/docker/api/types/network" |
|
13 |
+ networktypes "github.com/docker/docker/api/types/network" |
|
14 | 14 |
"github.com/docker/docker/api/types/registry" |
15 | 15 |
"github.com/docker/docker/api/types/swarm" |
16 | 16 |
volumetypes "github.com/docker/docker/api/types/volume" |
... | ... |
@@ -43,8 +43,8 @@ type CommonAPIClient interface { |
43 | 43 |
type ContainerAPIClient interface { |
44 | 44 |
ContainerAttach(ctx context.Context, container string, options types.ContainerAttachOptions) (types.HijackedResponse, error) |
45 | 45 |
ContainerCommit(ctx context.Context, container string, options types.ContainerCommitOptions) (types.IDResponse, error) |
46 |
- ContainerCreate(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, containerName string) (container.ContainerCreateCreatedBody, error) |
|
47 |
- ContainerDiff(ctx context.Context, container string) ([]container.ContainerChangeResponseItem, error) |
|
46 |
+ ContainerCreate(ctx context.Context, config *containertypes.Config, hostConfig *containertypes.HostConfig, networkingConfig *networktypes.NetworkingConfig, containerName string) (containertypes.ContainerCreateCreatedBody, error) |
|
47 |
+ ContainerDiff(ctx context.Context, container string) ([]containertypes.ContainerChangeResponseItem, error) |
|
48 | 48 |
ContainerExecAttach(ctx context.Context, execID string, config types.ExecStartCheck) (types.HijackedResponse, error) |
49 | 49 |
ContainerExecCreate(ctx context.Context, container string, config types.ExecConfig) (types.IDResponse, error) |
50 | 50 |
ContainerExecInspect(ctx context.Context, execID string) (types.ContainerExecInspect, error) |
... | ... |
@@ -65,10 +65,10 @@ type ContainerAPIClient interface { |
65 | 65 |
ContainerStats(ctx context.Context, container string, stream bool) (types.ContainerStats, error) |
66 | 66 |
ContainerStart(ctx context.Context, container string, options types.ContainerStartOptions) error |
67 | 67 |
ContainerStop(ctx context.Context, container string, timeout *time.Duration) error |
68 |
- ContainerTop(ctx context.Context, container string, arguments []string) (container.ContainerTopOKBody, error) |
|
68 |
+ ContainerTop(ctx context.Context, container string, arguments []string) (containertypes.ContainerTopOKBody, error) |
|
69 | 69 |
ContainerUnpause(ctx context.Context, container string) error |
70 |
- ContainerUpdate(ctx context.Context, container string, updateConfig container.UpdateConfig) (container.ContainerUpdateOKBody, error) |
|
71 |
- ContainerWait(ctx context.Context, container string, condition container.WaitCondition) (<-chan container.ContainerWaitOKBody, <-chan error) |
|
70 |
+ ContainerUpdate(ctx context.Context, container string, updateConfig containertypes.UpdateConfig) (containertypes.ContainerUpdateOKBody, error) |
|
71 |
+ ContainerWait(ctx context.Context, container string, condition containertypes.WaitCondition) (<-chan containertypes.ContainerWaitOKBody, <-chan error) |
|
72 | 72 |
CopyFromContainer(ctx context.Context, container, srcPath string) (io.ReadCloser, types.ContainerPathStat, error) |
73 | 73 |
CopyToContainer(ctx context.Context, container, path string, content io.Reader, options types.CopyToContainerOptions) error |
74 | 74 |
ContainersPrune(ctx context.Context, pruneFilters filters.Args) (types.ContainersPruneReport, error) |
... | ... |
@@ -100,13 +100,13 @@ type ImageAPIClient interface { |
100 | 100 |
|
101 | 101 |
// NetworkAPIClient defines API client methods for the networks |
102 | 102 |
type NetworkAPIClient interface { |
103 |
- NetworkConnect(ctx context.Context, networkID, container string, config *network.EndpointSettings) error |
|
103 |
+ NetworkConnect(ctx context.Context, network, container string, config *networktypes.EndpointSettings) error |
|
104 | 104 |
NetworkCreate(ctx context.Context, name string, options types.NetworkCreate) (types.NetworkCreateResponse, error) |
105 |
- NetworkDisconnect(ctx context.Context, networkID, container string, force bool) error |
|
106 |
- NetworkInspect(ctx context.Context, networkID string, options types.NetworkInspectOptions) (types.NetworkResource, error) |
|
107 |
- NetworkInspectWithRaw(ctx context.Context, networkID string, options types.NetworkInspectOptions) (types.NetworkResource, []byte, error) |
|
105 |
+ NetworkDisconnect(ctx context.Context, network, container string, force bool) error |
|
106 |
+ NetworkInspect(ctx context.Context, network string, options types.NetworkInspectOptions) (types.NetworkResource, error) |
|
107 |
+ NetworkInspectWithRaw(ctx context.Context, network string, options types.NetworkInspectOptions) (types.NetworkResource, []byte, error) |
|
108 | 108 |
NetworkList(ctx context.Context, options types.NetworkListOptions) ([]types.NetworkResource, error) |
109 |
- NetworkRemove(ctx context.Context, networkID string) error |
|
109 |
+ NetworkRemove(ctx context.Context, network string) error |
|
110 | 110 |
NetworksPrune(ctx context.Context, pruneFilter filters.Args) (types.NetworksPruneReport, error) |
111 | 111 |
} |
112 | 112 |
|