setup

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

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.

func (*ImageSetup) Wait

func (i *ImageSetup) Wait(logger io.Writer) error

Wait waits for Execute() to finish.

type ImageWaiter

type ImageWaiter interface {
	WaitForImage(ref string, logOutput io.Writer) error
}

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 NewSetup

func NewSetup(conf *config.Config, workDir string, createUsers bool) *Setup

NewSetup builds a new Setup instance.

func (*Setup) CheckHasContainer

func (s *Setup) CheckHasContainer(name string) bool

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) Execute

func (s *Setup) Execute() error

Execute runs the setup process.

func (*Setup) WaitForContainer

func (s *Setup) WaitForContainer(name string, logOut io.Writer) (string, error)

WaitForContainer waits for a container to be ready.

func (*Setup) WaitForImage

func (s *Setup) WaitForImage(ref string, logger io.Writer) error

WaitForImage waits for a image ref 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.

func (*UserSetup) Execute

func (cs *UserSetup) Execute() (execError error)

Execute starts the user setup.

func (*UserSetup) Wait

func (i *UserSetup) Wait(io.Writer) error

Wait waits for Execute() to finish.

Jump to

Keyboard shortcuts

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