interactor

package
v0.0.0-...-c5eb249 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const DOCKER_INTERACTOR = "docker"
View Source
const SWARM_INTERACTOR = "swarm"

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerInfo

type ContainerInfo struct {
	Address     string
	ExposedPort string
}

type ContainerInteractor

type ContainerInteractor interface {
	ListContainers() ([]string, error)
	InspectContainer(id string) (ContainerInfo, error)
	CreateContainer() (string, error)
}

func CreateDockerContainerInteractor

func CreateDockerContainerInteractor(image ImageInfo, options DockerContainerInteractorOptions) (ContainerInteractor, error)

func CreateSwarmContainerInteractor

func CreateSwarmContainerInteractor(image ImageInfo, options SwarmContainerInteractorOptions) (ContainerInteractor, error)

type DockerContainerInteractorOptions

type DockerContainerInteractorOptions struct {
	DockerNetwork string
}

type DockerInteractor

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

func (*DockerInteractor) CreateContainer

func (interactor *DockerInteractor) CreateContainer() (string, error)

func (*DockerInteractor) InspectContainer

func (interactor *DockerInteractor) InspectContainer(id string) (ContainerInfo, error)

func (*DockerInteractor) ListContainers

func (interactor *DockerInteractor) ListContainers() ([]string, error)

type ImageInfo

type ImageInfo struct {
	ImageRegistryUsername string
	ImageRegisrtyPassword string

	ImageName        string
	ImageExposedPort nat.Port
	ImageControlPort nat.Port
}

type MockInteractor

type MockInteractor struct {
	mock.Mock
}

func (*MockInteractor) CreateContainer

func (mocked *MockInteractor) CreateContainer() (string, error)

func (*MockInteractor) InspectContainer

func (mocked *MockInteractor) InspectContainer(id string) (ContainerInfo, error)

func (*MockInteractor) ListContainers

func (mocked *MockInteractor) ListContainers() ([]string, error)

type SwarmContainerInteractorOptions

type SwarmContainerInteractorOptions struct {
	DockerNetwork          string
	ConvergeVerifyCooldown int
	ConvergeVerifyRetries  int
}

type SwarmInteractor

type SwarmInteractor struct {
	ConvergeVerifyCooldown int
	ConvergeVerifyRetries  int
	// contains filtered or unexported fields
}

func (*SwarmInteractor) CreateContainer

func (interactor *SwarmInteractor) CreateContainer() (string, error)

func (*SwarmInteractor) InspectContainer

func (interactor *SwarmInteractor) InspectContainer(id string) (ContainerInfo, error)

func (*SwarmInteractor) ListContainers

func (interactor *SwarmInteractor) ListContainers() ([]string, error)

Jump to

Keyboard shortcuts

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