docker

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 28, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package docker is a generated GoMock package.

Index

Constants

View Source
const DOCKER_VERSION = "1.32"

Variables

This section is empty.

Functions

This section is empty.

Types

type Docker

type Docker struct {
	DockerClient *client.Client
	Registry     *Registry
}

Docker.

func NewDockerService

func NewDockerService(opt *options.DockerOption) (*Docker, error)

NewDockerService new docker service instance.

func (*Docker) ContainerAttach

func (d *Docker) ContainerAttach(
	ctx context.Context,
	container string,
	options types.ContainerAttachOptions,
) (types.HijackedResponse, error)

func (*Docker) ContainerCreate

func (d *Docker) ContainerCreate(
	ctx context.Context,
	config *containertypes.Config,
	hostConfig *containertypes.HostConfig,
	networkingConfig *networktypes.NetworkingConfig,
	platform *specs.Platform,
	containerName string,
) (containertypes.ContainerCreateCreatedBody, error)

func (*Docker) ContainerKill

func (d *Docker) ContainerKill(ctx context.Context, container, signal string) error

func (*Docker) ContainerRemove

func (d *Docker) ContainerRemove(ctx context.Context, container string, options types.ContainerRemoveOptions) error

func (*Docker) ContainerStart

func (d *Docker) ContainerStart(ctx context.Context, container string, options types.ContainerStartOptions) error

func (*Docker) ContainerStop

func (d *Docker) ContainerStop(ctx context.Context, container string, timeout *time.Duration) error

func (*Docker) ContainerWait

func (d *Docker) ContainerWait(
	ctx context.Context,
	container string,
	condition containertypes.WaitCondition,
) (<-chan containertypes.ContainerWaitOKBody, <-chan error)

func (*Docker) CopyFromContainer

func (d *Docker) CopyFromContainer(
	ctx context.Context,
	container, srcPath string,
) (io.ReadCloser, types.ContainerPathStat, error)

func (*Docker) CopyToContainer

func (d *Docker) CopyToContainer(
	ctx context.Context,
	container, path string,
	content io.Reader,
	options types.CopyToContainerOptions,
) error

func (*Docker) GetProjectName

func (d *Docker) GetProjectName() string

func (*Docker) GetServerAddress

func (d *Docker) GetServerAddress() string

func (*Docker) ImageBuild

func (d *Docker) ImageBuild(
	ctx context.Context,
	context io.Reader,
	options types.ImageBuildOptions,
) (types.ImageBuildResponse, error)

func (*Docker) ImageInspectWithRaw

func (d *Docker) ImageInspectWithRaw(ctx context.Context, image string) (types.ImageInspect, []byte, error)

func (*Docker) ImagePull

func (d *Docker) ImagePull(ctx context.Context, ref string, options types.ImagePullOptions) (io.ReadCloser, error)

func (*Docker) ImagePush

func (d *Docker) ImagePush(ctx context.Context, ref string, options types.ImagePushOptions) (io.ReadCloser, error)

func (*Docker) ImageTag

func (d *Docker) ImageTag(ctx context.Context, image, ref string) error

func (*Docker) RegistryAuth

func (d *Docker) RegistryAuth() (string, error)

RegistryAuth registry Authentication encoded by base64.

type DockerService

type DockerService interface {
	RegistryAuth() (string, error)
	GetServerAddress() string
	GetProjectName() string

	ContainerAttach(
		ctx context.Context,
		container string,
		options types.ContainerAttachOptions,
	) (types.HijackedResponse, error)
	ContainerCreate(
		ctx context.Context,
		config *containertypes.Config,
		hostConfig *containertypes.HostConfig,
		networkingConfig *networktypes.NetworkingConfig,
		platform *specs.Platform,
		containerName string,
	) (containertypes.ContainerCreateCreatedBody, error)
	ContainerKill(ctx context.Context, container, signal string) error
	ContainerRemove(ctx context.Context, container string, options types.ContainerRemoveOptions) error
	ContainerStart(ctx context.Context, container string, options types.ContainerStartOptions) error
	ContainerStop(ctx context.Context, container string, timeout *time.Duration) error
	ContainerWait(
		ctx context.Context,
		container string,
		condition containertypes.WaitCondition,
	) (<-chan containertypes.ContainerWaitOKBody, <-chan error)
	CopyFromContainer(ctx context.Context, container, srcPath string) (io.ReadCloser, types.ContainerPathStat, error)
	CopyToContainer(
		ctx context.Context,
		container, path string,
		content io.Reader,
		options types.CopyToContainerOptions,
	) error

	ImageBuild(
		ctx context.Context,
		context io.Reader,
		options types.ImageBuildOptions,
	) (types.ImageBuildResponse, error)
	ImageInspectWithRaw(ctx context.Context, image string) (types.ImageInspect, []byte, error)
	ImagePull(ctx context.Context, ref string, options types.ImagePullOptions) (io.ReadCloser, error)
	ImagePush(ctx context.Context, ref string, options types.ImagePushOptions) (io.ReadCloser, error)
	ImageTag(ctx context.Context, image, ref string) error
}

type MockDockerService

type MockDockerService struct {
	// contains filtered or unexported fields
}

MockDockerService is a mock of DockerService interface.

func NewMockDockerService

func NewMockDockerService(ctrl *gomock.Controller) *MockDockerService

NewMockDockerService creates a new mock instance.

func (*MockDockerService) ContainerAttach

ContainerAttach mocks base method.

func (*MockDockerService) ContainerCreate

ContainerCreate mocks base method.

func (*MockDockerService) ContainerKill

func (m *MockDockerService) ContainerKill(arg0 context.Context, arg1, arg2 string) error

ContainerKill mocks base method.

func (*MockDockerService) ContainerRemove

func (m *MockDockerService) ContainerRemove(arg0 context.Context, arg1 string, arg2 types.ContainerRemoveOptions) error

ContainerRemove mocks base method.

func (*MockDockerService) ContainerStart

func (m *MockDockerService) ContainerStart(arg0 context.Context, arg1 string, arg2 types.ContainerStartOptions) error

ContainerStart mocks base method.

func (*MockDockerService) ContainerStop

func (m *MockDockerService) ContainerStop(arg0 context.Context, arg1 string, arg2 *time.Duration) error

ContainerStop mocks base method.

func (*MockDockerService) ContainerWait

func (m *MockDockerService) ContainerWait(arg0 context.Context, arg1 string, arg2 container.WaitCondition) (<-chan container.ContainerWaitOKBody, <-chan error)

ContainerWait mocks base method.

func (*MockDockerService) CopyFromContainer

func (m *MockDockerService) CopyFromContainer(arg0 context.Context, arg1, arg2 string) (io.ReadCloser, types.ContainerPathStat, error)

CopyFromContainer mocks base method.

func (*MockDockerService) CopyToContainer

func (m *MockDockerService) CopyToContainer(arg0 context.Context, arg1, arg2 string, arg3 io.Reader, arg4 types.CopyToContainerOptions) error

CopyToContainer mocks base method.

func (*MockDockerService) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockDockerService) GetProjectName

func (m *MockDockerService) GetProjectName() string

GetProjectName mocks base method.

func (*MockDockerService) GetServerAddress

func (m *MockDockerService) GetServerAddress() string

GetServerAddress mocks base method.

func (*MockDockerService) ImageBuild

ImageBuild mocks base method.

func (*MockDockerService) ImageInspectWithRaw

func (m *MockDockerService) ImageInspectWithRaw(arg0 context.Context, arg1 string) (types.ImageInspect, []byte, error)

ImageInspectWithRaw mocks base method.

func (*MockDockerService) ImagePull

func (m *MockDockerService) ImagePull(arg0 context.Context, arg1 string, arg2 types.ImagePullOptions) (io.ReadCloser, error)

ImagePull mocks base method.

func (*MockDockerService) ImagePush

func (m *MockDockerService) ImagePush(arg0 context.Context, arg1 string, arg2 types.ImagePushOptions) (io.ReadCloser, error)

ImagePush mocks base method.

func (*MockDockerService) ImageTag

func (m *MockDockerService) ImageTag(arg0 context.Context, arg1, arg2 string) error

ImageTag mocks base method.

func (*MockDockerService) RegistryAuth

func (m *MockDockerService) RegistryAuth() (string, error)

RegistryAuth mocks base method.

type MockDockerServiceMockRecorder

type MockDockerServiceMockRecorder struct {
	// contains filtered or unexported fields
}

MockDockerServiceMockRecorder is the mock recorder for MockDockerService.

func (*MockDockerServiceMockRecorder) ContainerAttach

func (mr *MockDockerServiceMockRecorder) ContainerAttach(arg0, arg1, arg2 interface{}) *gomock.Call

ContainerAttach indicates an expected call of ContainerAttach.

func (*MockDockerServiceMockRecorder) ContainerCreate

func (mr *MockDockerServiceMockRecorder) ContainerCreate(arg0, arg1, arg2, arg3, arg4, arg5 interface{}) *gomock.Call

ContainerCreate indicates an expected call of ContainerCreate.

func (*MockDockerServiceMockRecorder) ContainerKill

func (mr *MockDockerServiceMockRecorder) ContainerKill(arg0, arg1, arg2 interface{}) *gomock.Call

ContainerKill indicates an expected call of ContainerKill.

func (*MockDockerServiceMockRecorder) ContainerRemove

func (mr *MockDockerServiceMockRecorder) ContainerRemove(arg0, arg1, arg2 interface{}) *gomock.Call

ContainerRemove indicates an expected call of ContainerRemove.

func (*MockDockerServiceMockRecorder) ContainerStart

func (mr *MockDockerServiceMockRecorder) ContainerStart(arg0, arg1, arg2 interface{}) *gomock.Call

ContainerStart indicates an expected call of ContainerStart.

func (*MockDockerServiceMockRecorder) ContainerStop

func (mr *MockDockerServiceMockRecorder) ContainerStop(arg0, arg1, arg2 interface{}) *gomock.Call

ContainerStop indicates an expected call of ContainerStop.

func (*MockDockerServiceMockRecorder) ContainerWait

func (mr *MockDockerServiceMockRecorder) ContainerWait(arg0, arg1, arg2 interface{}) *gomock.Call

ContainerWait indicates an expected call of ContainerWait.

func (*MockDockerServiceMockRecorder) CopyFromContainer

func (mr *MockDockerServiceMockRecorder) CopyFromContainer(arg0, arg1, arg2 interface{}) *gomock.Call

CopyFromContainer indicates an expected call of CopyFromContainer.

func (*MockDockerServiceMockRecorder) CopyToContainer

func (mr *MockDockerServiceMockRecorder) CopyToContainer(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call

CopyToContainer indicates an expected call of CopyToContainer.

func (*MockDockerServiceMockRecorder) GetProjectName

func (mr *MockDockerServiceMockRecorder) GetProjectName() *gomock.Call

GetProjectName indicates an expected call of GetProjectName.

func (*MockDockerServiceMockRecorder) GetServerAddress

func (mr *MockDockerServiceMockRecorder) GetServerAddress() *gomock.Call

GetServerAddress indicates an expected call of GetServerAddress.

func (*MockDockerServiceMockRecorder) ImageBuild

func (mr *MockDockerServiceMockRecorder) ImageBuild(arg0, arg1, arg2 interface{}) *gomock.Call

ImageBuild indicates an expected call of ImageBuild.

func (*MockDockerServiceMockRecorder) ImageInspectWithRaw

func (mr *MockDockerServiceMockRecorder) ImageInspectWithRaw(arg0, arg1 interface{}) *gomock.Call

ImageInspectWithRaw indicates an expected call of ImageInspectWithRaw.

func (*MockDockerServiceMockRecorder) ImagePull

func (mr *MockDockerServiceMockRecorder) ImagePull(arg0, arg1, arg2 interface{}) *gomock.Call

ImagePull indicates an expected call of ImagePull.

func (*MockDockerServiceMockRecorder) ImagePush

func (mr *MockDockerServiceMockRecorder) ImagePush(arg0, arg1, arg2 interface{}) *gomock.Call

ImagePush indicates an expected call of ImagePush.

func (*MockDockerServiceMockRecorder) ImageTag

func (mr *MockDockerServiceMockRecorder) ImageTag(arg0, arg1, arg2 interface{}) *gomock.Call

ImageTag indicates an expected call of ImageTag.

func (*MockDockerServiceMockRecorder) RegistryAuth

func (mr *MockDockerServiceMockRecorder) RegistryAuth() *gomock.Call

RegistryAuth indicates an expected call of RegistryAuth.

type Registry

type Registry struct {
	Username      string `json:"username"`
	Password      string `json:"password"`
	Email         string `json:"email"`
	Serveraddress string `json:"serveraddress"`
	Project       string `json:"project"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL