Documentation
¶
Index ¶
- type AbstractContainer
- func (cont *AbstractContainer) GetContainer(ctx context.Context) (*api.GetContainerResponse, error)
- func (cont *AbstractContainer) GetContainerType() ContainerType
- func (cont *AbstractContainer) GetLogsLocation() (string, error)
- func (cont *AbstractContainer) InitializeBase(ctx context.Context) error
- func (cont *AbstractContainer) ProcessContainer(ctx context.Context, template *api.Template) (string, error)
- func (cont *AbstractContainer) StopContainer(ctx context.Context) error
- type AbstractContainerType
- type ContainerInterface
- type ContainerState
- type ContainerType
- type TemplatedContainer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AbstractContainer ¶
type AbstractContainer struct { ContainerInterface StartCmd []string Name string TempDirLoc string ConcreteContainer ContainerInterface StartContainerResp *api.StartContainerResponse GetContainerResp *api.GetContainerResponse // contains filtered or unexported fields }
AbstractContainer represents abstract container.
func NewAbstractContainer ¶
func NewAbstractContainer( namePrefix string, containerImage string, ctr managers.ContainerManager) AbstractContainer
func (*AbstractContainer) GetContainer ¶
func (cont *AbstractContainer) GetContainer(ctx context.Context) (*api.GetContainerResponse, error)
GetContainer gets the container info.
func (*AbstractContainer) GetContainerType ¶
func (cont *AbstractContainer) GetContainerType() ContainerType
func (*AbstractContainer) GetLogsLocation ¶
func (cont *AbstractContainer) GetLogsLocation() (string, error)
func (*AbstractContainer) InitializeBase ¶
func (cont *AbstractContainer) InitializeBase(ctx context.Context) error
InitializeBase does initial work that is common to all containers.
func (*AbstractContainer) ProcessContainer ¶
func (cont *AbstractContainer) ProcessContainer( ctx context.Context, template *api.Template) (string, error)
ProcessContainer processes(initialize, start, get, retrieve server address) the container.
func (*AbstractContainer) StopContainer ¶
func (cont *AbstractContainer) StopContainer(ctx context.Context) error
StopContainer stop the container.
type AbstractContainerType ¶
type AbstractContainerType struct {
ContainerInterface
}
AbstractContainer satisfies the container requirement that is common to all.
type ContainerInterface ¶
type ContainerInterface interface { // GetContainerType returns the container type. GetContainerType() ContainerType // Initialize initializes the container. Initialize(context.Context, *api.Template) error // StartContainer starts the container. StartContainer(context.Context) (*api.StartContainerResponse, error) // GetContainer gets the container related info. GetContainer(context.Context) (*api.GetContainerResponse, error) // ProcessContainer processes the container. // Ideally, this aggregates initialize, start and get together. ProcessContainer(context.Context, *api.Template) (string, error) // StopContainer stops the container. StopContainer(context.Context) error // GetLogsLocation returns the container activity logs location. GetLogsLocation() (string, error) }
ContainerInterface defines the contract a container will have to satisfy.
func NewContainer ¶
func NewContainer( namePrefix string, containerImage string, ctr managers.ContainerManager) ContainerInterface
type ContainerState ¶
type ContainerState string
Container state types
const ( ContainerStateNotInitialized ContainerState = "NotInitialized" ContainerStateInitialized ContainerState = "Initialized" ContainerStateStarted ContainerState = "Started" ContainerStateStopped ContainerState = "Stopped" )
type TemplatedContainer ¶
type TemplatedContainer struct { AbstractContainer StartTemplatedContainerReq *api.StartTemplatedContainerRequest }
func NewGenericContainer ¶
func NewGenericContainer( namePrefix string, containerImage string, ctr managers.ContainerManager) *TemplatedContainer
func (*TemplatedContainer) Initialize ¶
Initialize initializes the container.
func (*TemplatedContainer) StartContainer ¶
func (cont *TemplatedContainer) StartContainer(ctx context.Context) (*api.StartContainerResponse, error)
StartContainer starts the container.
Click to show internal directories.
Click to hide internal directories.