starter

package
v4.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exec

func Exec(name string, config *config.Common, ops ...CommandOp) error

Exec executes the starter binary in place of the caller if there is no error. This function never returns on success.

func Run

func Run(name string, config *config.Common, ops ...CommandOp) error

Run executes the starter binary and returns once starter finished its execution.

Types

type Command

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

Command a starter command to execute.

type CommandOp

type CommandOp func(*Command)

CommandOp represents a function type passed to Exec/Run allowing to customize the starter command execution.

func CleanupHost

func CleanupHost(spawn bool) CommandOp

CleanupHost sets CLEANUP_HOST environment variable which telsl starter to spawn the unprivileged host cleanup process.

func LoadOverlayModule

func LoadOverlayModule(load bool) CommandOp

LoadOverlayModule sets LOAD_OVERLAY_MODULE environment variable which tell starter to load overlay kernel module.

func UseSuid

func UseSuid(suid bool) CommandOp

UseSuid sets if the starter command uses either the setuid binary or the unprivileged binary. The unprivileged binary is used by default if this operation is not passed to Run/Exec.

func WithStderr

func WithStderr(stderr io.Writer) CommandOp

WithStderr allows to pass a custom error stream to starter command. Error stream is ignored for Exec as it uses the caller stream.

func WithStdin

func WithStdin(stdin io.Reader) CommandOp

WithStdin allows to pass a custom input stream to starter command. Input stream is ignored for Exec as it uses the caller stream.

func WithStdout

func WithStdout(stdout io.Writer) CommandOp

WithStdout allows to pass a custom output stream to starter command. Output stream is ignored for Exec as it uses the caller stream.

Jump to

Keyboard shortcuts

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