cntrmgr

package
v0.0.0-...-49e170d Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerManager

type ContainerManager interface {
	CreateContainer() (*cntr.Container, error)
	DestroyContainer(externalID string) error
}

ContainerManager contains simple methods that need to be implemented for every container manager, specifically to create a container, and to destroy a specified container

type DummyContainerManager

type DummyContainerManager struct{}

DummyContainerManager simply forwards all container requests to a standard IP address and port. This container needs to be already running; it does not create or destroy any containers as part of the lifecycle. It is primarily used for testing.

func (DummyContainerManager) CreateContainer

func (cm DummyContainerManager) CreateContainer() (*cntr.Container, error)

CreateContainer simply returns the configuration of an (assumed) already-running container. It is required to satisfy the ContainerManager interface.

func (DummyContainerManager) DestroyContainer

func (cm DummyContainerManager) DestroyContainer(externalID string) error

DestroyContainer does nothing! It is required to satisfy the ContainerManager interface.

type ECS

type ECS struct {
	Logger     logrus.Logger
	Conf       Settings
	ECSService *ecs.ECS
}

ECS is the receiver struct for the container manager, specifically containing references to the logging components, settings etc needed

func (*ECS) CreateContainer

func (cm *ECS) CreateContainer() (*cntr.Container, error)

CreateContainer simply creates an ECS containers as per the provided configuration settings

func (*ECS) DestroyContainer

func (cm *ECS) DestroyContainer(externalID string) error

DestroyContainer simply destroys the ECS container identified by the provided ID

func (*ECS) InitialiseECSService

func (cm *ECS) InitialiseECSService() error

InitialiseECSService creates a new AWS config object as per the provided configuration with regards to region and credentials

type Settings

type Settings struct {
	Profile                      string
	Region                       string
	Cluster                      string
	TaskDefinition               string
	LaunchType                   string
	AssignPublicIP               string
	Subnets                      []string
	SecurityGroups               []string
	MaximumContainerStartTimeSec int
}

Settings represents the various configuration parameters for a ECS container manager and are typically read from an external configuration file

Jump to

Keyboard shortcuts

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