setup

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 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 creates one configured Docker container.

func NewContainerSetup

func NewContainerSetup(
	le *logrus.Entry,
	conf *config.ConfigContainer,
	waiter ImageWaiter,
) *ContainerSetup

NewContainerSetup constructs a container setup operation.

func (*ContainerSetup) Execute

func (c *ContainerSetup) Execute(ctx context.Context) (executeError error)

Execute creates or finds the container and publishes completion to waiters.

func (*ContainerSetup) Wait

func (c *ContainerSetup) Wait(ctx context.Context, logOut io.Writer) error

Wait waits for container setup completion or context cancellation.

func (*ContainerSetup) WaitWithID added in v1.15.0

func (c *ContainerSetup) WaitWithID(ctx context.Context, logOut io.Writer) (string, error)

WaitWithID waits for container setup and returns the container ID.

type ContainerWaiter

type ContainerWaiter interface {
	CheckHasContainer(string) bool
	WaitForContainer(context.Context, string, io.Writer) (string, error)
	ExecCmdContainer(
		context.Context,
		string,
		string,
		io.Reader,
		io.Writer,
		io.Writer,
		string,
		...string,
	) error
}

ContainerWaiter waits for container setup and executes container commands.

type ImageSetup

type ImageSetup struct {
	// contains filtered or unexported fields
}

ImageSetup pulls or builds one configured image.

func NewImageSetup

func NewImageSetup(le *logrus.Entry, conf *config.ConfigImage, workDir string) *ImageSetup

NewImageSetup constructs an image setup operation.

func (*ImageSetup) Execute

func (i *ImageSetup) Execute(ctx context.Context) (executeError error)

Execute sets up the image and publishes its completion to waiters.

func (*ImageSetup) Wait

func (i *ImageSetup) Wait(ctx context.Context, logOut io.Writer) error

Wait waits for image setup completion or context cancellation.

type ImageWaiter

type ImageWaiter interface {
	WaitForImage(context.Context, string, io.Writer) error
}

ImageWaiter waits for an image setup to complete.

type Setup

type Setup struct {
	// contains filtered or unexported fields
}

Setup coordinates image, container, and host-user setup.

func NewSetup

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

NewSetup constructs a setup coordinator.

func (*Setup) CheckHasContainer

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

CheckHasContainer reports whether a container is configured.

func (*Setup) ExecCmdContainer added in v1.7.1

func (s *Setup) ExecCmdContainer(
	ctx context.Context,
	containerID string,
	userID string,
	stdIn io.Reader,
	stdOut io.Writer,
	stdErr io.Writer,
	cmd string,
	args ...string,
) error

ExecCmdContainer executes a command in a configured Docker container.

func (*Setup) Execute

func (s *Setup) Execute(ctx context.Context) error

Execute runs all configured setup jobs and returns the first error.

func (*Setup) WaitForContainer

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

WaitForContainer waits for a configured container setup to complete.

func (*Setup) WaitForImage

func (s *Setup) WaitForImage(ctx context.Context, ref string, logOut io.Writer) error

WaitForImage waits for a configured image setup to complete.

type SetupJob

type SetupJob interface {
	Execute(context.Context) error
	Wait(context.Context, io.Writer) error
}

SetupJob is a setup operation that can be executed and awaited.

type UserSetup

type UserSetup struct {
	// contains filtered or unexported fields
}

UserSetup configures one host user to execute commands in a container.

func NewUserSetup

func NewUserSetup(
	le *logrus.Entry,
	conf *config.ConfigUser,
	waiter ContainerWaiter,
	createUsers bool,
) *UserSetup

NewUserSetup constructs a host-user setup operation.

func (*UserSetup) Execute

func (u *UserSetup) Execute(ctx context.Context) (executeError error)

Execute configures the host user and publishes completion to waiters.

func (*UserSetup) Wait

func (u *UserSetup) Wait(ctx context.Context, _ io.Writer) error

Wait waits for user setup completion or context cancellation.

Jump to

Keyboard shortcuts

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