github.com/alloyci/alloy-runner@v1.0.1-0.20180222164613-925503ccafd6/helpers/docker/client.go (about) 1 package docker_helpers 2 3 import ( 4 "io" 5 6 "github.com/docker/docker/api/types" 7 "github.com/docker/docker/api/types/container" 8 "github.com/docker/docker/api/types/network" 9 "golang.org/x/net/context" 10 ) 11 12 type Client interface { 13 ImageInspectWithRaw(ctx context.Context, imageID string) (types.ImageInspect, []byte, error) 14 15 ImagePullBlocking(ctx context.Context, ref string, options types.ImagePullOptions) error 16 ImageImportBlocking(ctx context.Context, source types.ImageImportSource, ref string, options types.ImageImportOptions) error 17 18 ContainerCreate(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, containerName string) (container.ContainerCreateCreatedBody, error) 19 ContainerStart(ctx context.Context, containerID string, options types.ContainerStartOptions) error 20 ContainerWait(ctx context.Context, containerID string) (int64, error) 21 ContainerKill(ctx context.Context, containerID, signal string) error 22 ContainerInspect(ctx context.Context, containerID string) (types.ContainerJSON, error) 23 ContainerAttach(ctx context.Context, container string, options types.ContainerAttachOptions) (types.HijackedResponse, error) 24 ContainerRemove(ctx context.Context, containerID string, options types.ContainerRemoveOptions) error 25 ContainerLogs(ctx context.Context, container string, options types.ContainerLogsOptions) (io.ReadCloser, error) 26 27 NetworkDisconnect(ctx context.Context, networkID, containerID string, force bool) error 28 NetworkList(ctx context.Context, options types.NetworkListOptions) ([]types.NetworkResource, error) 29 30 Info(ctx context.Context) (types.Info, error) 31 32 Close() error 33 }