Documentation
¶
Overview ¶
Package containers defines all container types.
Index ¶
- Constants
- func GetContainerImageKeyFromContainerType(containerType interfaces.ContainerType) string
- func NewAndroidDutTemplatedContainer(containerImage string, ctr *crostoolrunner.CrosToolRunner) interfaces.ContainerInterface
- func NewCacheServerTemplatedContainer(containerImage string, ctr *crostoolrunner.CrosToolRunner) interfaces.ContainerInterface
- func NewContainer(contType interfaces.ContainerType, namePrefix string, network string, ...) interfaces.ContainerInterface
- func NewCrosDutTemplatedContainer(containerImage string, ctr *crostoolrunner.CrosToolRunner) interfaces.ContainerInterface
- func NewCrosProvisionTemplatedContainer(containerImage string, ctr *crostoolrunner.CrosToolRunner) interfaces.ContainerInterface
- func NewCrosPublishTemplatedContainer(contType interfaces.ContainerType, containerImage string, ...) interfaces.ContainerInterface
- func NewCrosTestFinderTemplatedContainer(containerImage string, ctr *crostoolrunner.CrosToolRunner) interfaces.ContainerInterface
- func NewCrosTestTemplatedContainer(containerImage string, ctr *crostoolrunner.CrosToolRunner) interfaces.ContainerInterface
- func NewCrosVMProvisionTemplatedContainer(containerImage string, ctr *crostoolrunner.CrosToolRunner) interfaces.ContainerInterface
- func NewGenericProvisionTemplatedContainer(namePrefix string, containerImage string, ctr *crostoolrunner.CrosToolRunner) interfaces.ContainerInterface
- func NewGenericTemplatedContainer(contType interfaces.ContainerType, containerImage string, namePrefix string, ...) interfaces.ContainerInterface
- func NewPostProcessTemplatedContainer(contType interfaces.ContainerType, containerImage string, ...) interfaces.ContainerInterface
- type AbstractContainer
- func (cont *AbstractContainer) GetContainer(ctx context.Context) (*api.GetContainerResponse, error)
- func (cont *AbstractContainer) GetContainerType() interfaces.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 ContainerState
- type NonTemplatedContainer
- type TemplatedContainer
Constants ¶
const ( // For testing purposes only UnsupportedContainerType interfaces.ContainerType = "UnsupportedContainer" AndroidDutTemplatedContainerType interfaces.ContainerType = "AndroidDutTemplatedContainer" AndroidProvisionTemplatedContainerType interfaces.ContainerType = "AndroidProvisionTemplatedContainer" CacheServerTemplatedContainerType interfaces.ContainerType = "CacheServerTemplatedContainer" CrosProvisionTemplatedContainerType interfaces.ContainerType = "CrosProvisionTemplatedContainer" CrosVMProvisionTemplatedContainerType interfaces.ContainerType = "CrosVMProvisionTemplatedContainer" CrosDutTemplatedContainerType interfaces.ContainerType = "CrosDutTemplatedContainer" CrosTestTemplatedContainerType interfaces.ContainerType = "CrosTestTemplatedContainer" CrosTestFinderTemplatedContainerType interfaces.ContainerType = "CrosTestFinderTemplatedContainer" CrosGcsPublishTemplatedContainerType interfaces.ContainerType = "CrosGcsPublishTemplatedContainer" CrosTkoPublishTemplatedContainerType interfaces.ContainerType = "CrosTkoPublishTemplatedContainer" CrosRdbPublishTemplatedContainerType interfaces.ContainerType = "CrosRdbPublishTemplatedContainer" CrosPublishTemplatedContainerType interfaces.ContainerType = "CrosPublishTemplatedContainer" GenericProvisionTemplatedContainerType interfaces.ContainerType = "GenericProvisionTemplatedContainer" PostProcessTemplatedContainerType interfaces.ContainerType = "PostProcessTemplatedContainer" )
All supported container types.
Variables ¶
This section is empty.
Functions ¶
func GetContainerImageKeyFromContainerType ¶
func GetContainerImageKeyFromContainerType(containerType interfaces.ContainerType) string
GetContainerImageKeyFromContainerType converts a ContainerType to its commonly known string representation.
func NewAndroidDutTemplatedContainer ¶
func NewAndroidDutTemplatedContainer( containerImage string, ctr *crostoolrunner.CrosToolRunner) interfaces.ContainerInterface
func NewCacheServerTemplatedContainer ¶
func NewCacheServerTemplatedContainer( containerImage string, ctr *crostoolrunner.CrosToolRunner) interfaces.ContainerInterface
func NewContainer ¶
func NewContainer( contType interfaces.ContainerType, namePrefix string, network string, containerImage string, ctr *crostoolrunner.CrosToolRunner, isTemplated bool) interfaces.ContainerInterface
func NewCrosDutTemplatedContainer ¶
func NewCrosDutTemplatedContainer( containerImage string, ctr *crostoolrunner.CrosToolRunner) interfaces.ContainerInterface
func NewCrosProvisionTemplatedContainer ¶
func NewCrosProvisionTemplatedContainer( containerImage string, ctr *crostoolrunner.CrosToolRunner) interfaces.ContainerInterface
func NewCrosPublishTemplatedContainer ¶
func NewCrosPublishTemplatedContainer( contType interfaces.ContainerType, containerImage string, ctr *crostoolrunner.CrosToolRunner) interfaces.ContainerInterface
func NewCrosTestFinderTemplatedContainer ¶
func NewCrosTestFinderTemplatedContainer( containerImage string, ctr *crostoolrunner.CrosToolRunner) interfaces.ContainerInterface
func NewCrosTestTemplatedContainer ¶
func NewCrosTestTemplatedContainer( containerImage string, ctr *crostoolrunner.CrosToolRunner) interfaces.ContainerInterface
func NewCrosVMProvisionTemplatedContainer ¶
func NewCrosVMProvisionTemplatedContainer( containerImage string, ctr *crostoolrunner.CrosToolRunner) interfaces.ContainerInterface
func NewGenericProvisionTemplatedContainer ¶
func NewGenericProvisionTemplatedContainer( namePrefix string, containerImage string, ctr *crostoolrunner.CrosToolRunner) interfaces.ContainerInterface
func NewGenericTemplatedContainer ¶
func NewGenericTemplatedContainer( contType interfaces.ContainerType, containerImage string, namePrefix string, ctr *crostoolrunner.CrosToolRunner) interfaces.ContainerInterface
func NewPostProcessTemplatedContainer ¶
func NewPostProcessTemplatedContainer( contType interfaces.ContainerType, containerImage string, ctr *crostoolrunner.CrosToolRunner) interfaces.ContainerInterface
NewPostProcessTemplatedContainer creates a new templated post-process container.
Types ¶
type AbstractContainer ¶
type AbstractContainer struct { interfaces.ContainerInterface Name string Network string TempDirLoc string ConcreteContainer interfaces.ContainerInterface StartContainerResp *api.StartContainerResponse GetContainerResp *api.GetContainerResponse // contains filtered or unexported fields }
AbstractContainer represents abstract container.
func NewAbstractContainer ¶
func NewAbstractContainer( contType interfaces.ContainerType, namePrefix string, network string, containerImage string, ctr *crostoolrunner.CrosToolRunner) 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() interfaces.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 ContainerState ¶
type ContainerState string
ContainerState types
const ( ContainerStateNotInitialized ContainerState = "NotInitialized" ContainerStateInitialized ContainerState = "Initialized" ContainerStateStarted ContainerState = "Started" ContainerStateStopped ContainerState = "Stopped" )
type NonTemplatedContainer ¶
type NonTemplatedContainer struct { AbstractContainer LogsDirToMount string Network string Volumes []string Expose []string EnvVars []string StartCmd []string TestResultsDir string StartContainerReq *api.StartContainerRequest }
NonTemplatedContainer represents the cft non-templated container.
func NewNonTemplatedContainer ¶
func NewNonTemplatedContainer( contType interfaces.ContainerType, namePrefix string, network string, containerImage string, ctr *crostoolrunner.CrosToolRunner) *NonTemplatedContainer
func (*NonTemplatedContainer) Initialize ¶
Initialize initializes the container.
func (*NonTemplatedContainer) StartContainer ¶
func (cont *NonTemplatedContainer) StartContainer(ctx context.Context) (*api.StartContainerResponse, error)
StartContainer starts the container.
type TemplatedContainer ¶
type TemplatedContainer struct { AbstractContainer StartTemplatedContainerReq *api.StartTemplatedContainerRequest }
TemplatedContainer represents the cft templated container.
func NewTemplatedContainer ¶
func NewTemplatedContainer(contType interfaces.ContainerType, namePrefix string, network string, containerImage string, ctr *crostoolrunner.CrosToolRunner) *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.