Documentation ¶
Index ¶
- type ContainerSetup
- type ContainerWaiter
- type ImageSetup
- type ImageWaiter
- type Setup
- func (s *Setup) CheckHasContainer(name string) bool
- func (s *Setup) ExecCmdContainer(containerID, userID string, stdIn io.Reader, stdOut, stdErr io.Writer, ...) error
- func (s *Setup) Execute() error
- func (s *Setup) WaitForContainer(name string, logOut io.Writer) (string, error)
- func (s *Setup) WaitForImage(ref string, logger io.Writer) error
- type SetupJob
- type UserSetup
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContainerSetup ¶
type ContainerSetup struct {
// contains filtered or unexported fields
}
ContainerSetup sets up a container.
func NewContainerSetup ¶
func NewContainerSetup(config *config.ConfigContainer, waiter ImageWaiter) *ContainerSetup
NewContainerSetup creates a new ContainerSetup.
func (*ContainerSetup) Execute ¶
func (cs *ContainerSetup) Execute() (execError error)
Execute starts the container setup.
func (*ContainerSetup) Wait ¶
func (i *ContainerSetup) Wait(log io.Writer) error
Wait waits for Execute() to finish.
func (*ContainerSetup) WaitWithId ¶
func (i *ContainerSetup) WaitWithId(outw io.Writer) (string, error)
WaitWithId waits for Execute() to finish and returns the container ID.
type ContainerWaiter ¶
type ContainerWaiter interface { CheckHasContainer(name string) bool WaitForContainer(name string, logOut io.Writer) (string, error) ExecCmdContainer(containerID, userID string, stdIn io.Reader, stdOut, stdErr io.Writer, cmd string, args ...string) error }
ContainerWaiter waits for a container to be ready.
type ImageSetup ¶
type ImageSetup struct {
// contains filtered or unexported fields
}
ImageSetup is responsible for setting up an image.
func NewImageSetup ¶
func NewImageSetup(conf *config.ConfigImage, workDir string) *ImageSetup
NewImageSetup builds a new ImageSetup.
workDir can be empty to use /tmp
func (*ImageSetup) Execute ¶
func (i *ImageSetup) Execute() (exError error)
Execute executes the setup.
type ImageWaiter ¶
ImageWaiter can wait for an image to complete.
type Setup ¶
type Setup struct {
// contains filtered or unexported fields
}
Setup is an instance of a setup process.
func (*Setup) CheckHasContainer ¶
CheckHasContainer checks if there is a container with the specified name.
func (*Setup) ExecCmdContainer ¶ added in v1.7.1
func (s *Setup) ExecCmdContainer(containerID, userID string, stdIn io.Reader, stdOut, stdErr io.Writer, cmd string, args ...string) error
ExecCmdContainer executes a command in a container.
func (*Setup) WaitForContainer ¶
WaitForContainer waits for a container to be ready.
type SetupJob ¶
type SetupJob interface { // Execute is a goroutine to execute the job Execute() error // Wait waits for the job to exit. Wait(log io.Writer) error }
SetupJob is a setup job that we can wait on.
type UserSetup ¶
type UserSetup struct {
// contains filtered or unexported fields
}
UserSetup sets up a container.
func NewUserSetup ¶
func NewUserSetup(config *config.ConfigUser, waiter ContainerWaiter, createUsers bool) *UserSetup
NewUserSetup creates a new UserSetup.