conteng

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2018 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerEngine

type ContainerEngine interface {
	CreateNetwork(ctx context.Context, name string) (NetworkId, string, error)
	BuildImage(ctx context.Context, imgName string, buildContext io.Reader) error
	GetImagePorts(ctx context.Context, imgName string) ([]uint16, error)
	RemoveImage(ctx context.Context, imgName string) error
	RunContainer(ctx context.Context, name, tag string,
		params RunContainerParams) (string, error)
	// Stop and remove
	RemoveContainer(ctx context.Context, id string) error
	RemoveNetwork(ctx context.Context, id string) error
	FetchImage(ctx context.Context, imgName string) error

	Terminate()
}

type ContainerFileMount

type ContainerFileMount struct {
	HostFile      string
	ContainerFile string
	Readonly      bool
}

type DockerEngine

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

func NewDockerEngine

func NewDockerEngine(params DockerEngineParams) (*DockerEngine, error)

func (*DockerEngine) BuildImage

func (de *DockerEngine) BuildImage(ctx context.Context, imgName string,
	buildContext io.Reader) error

func (*DockerEngine) CreateNetwork

func (de *DockerEngine) CreateNetwork(ctx context.Context,
	name string) (NetworkId, string, error)

func (*DockerEngine) FetchImage

func (de *DockerEngine) FetchImage(ctx context.Context, imgName string) error

func (*DockerEngine) GetImagePorts

func (de *DockerEngine) GetImagePorts(ctx context.Context,
	tag string) ([]uint16, error)

func (*DockerEngine) RemoveContainer

func (de *DockerEngine) RemoveContainer(ctx context.Context, id string) error

func (*DockerEngine) RemoveImage

func (de *DockerEngine) RemoveImage(ctx context.Context, imgName string) error

func (*DockerEngine) RemoveNetwork

func (de *DockerEngine) RemoveNetwork(ctx context.Context, id string) error

func (*DockerEngine) RunContainer

func (de *DockerEngine) RunContainer(ctx context.Context, name, tag string,
	params RunContainerParams) (string, error)

func (*DockerEngine) Terminate

func (de *DockerEngine) Terminate()

type DockerEngineParams

type DockerEngineParams struct {
}

type MockedEngine

type MockedEngine struct {
	mock.Mock
}

func (*MockedEngine) BuildImage

func (me *MockedEngine) BuildImage(ctx context.Context, imgName string,
	buildContext io.Reader) error

func (*MockedEngine) CreateNetwork

func (me *MockedEngine) CreateNetwork(ctx context.Context, name string) (NetworkId, string, error)

func (*MockedEngine) FetchImage

func (me *MockedEngine) FetchImage(ctx context.Context, imgName string) error

func (*MockedEngine) GetImagePorts

func (me *MockedEngine) GetImagePorts(ctx context.Context,
	imgName string) ([]uint16, error)

func (*MockedEngine) RemoveContainer

func (me *MockedEngine) RemoveContainer(ctx context.Context, id string) error

func (*MockedEngine) RemoveImage

func (me *MockedEngine) RemoveImage(ctx context.Context, imgName string) error

func (*MockedEngine) RemoveNetwork

func (me *MockedEngine) RemoveNetwork(ctx context.Context, id string) error

func (*MockedEngine) RunContainer

func (me *MockedEngine) RunContainer(ctx context.Context, name, tag string,
	params RunContainerParams) (string, error)

func (*MockedEngine) Terminate

func (me *MockedEngine) Terminate()

type NetworkId

type NetworkId = string

type RunContainerParams

type RunContainerParams struct {
	NetworkId  NetworkId
	IP         string
	Hosts      map[string]string // hostname -> IP
	Ports      map[uint16]uint16 // container port -> host port
	Environ    map[string]string
	Cmd        []string
	FileMounts []*ContainerFileMount
}

Jump to

Keyboard shortcuts

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