exec

package
v0.1.0-alpha013 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecOptions

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

ExecOptions is a struct that provides a default implementation for the Options method of the Executable interface.

func (ExecOptions) Options

func (ce ExecOptions) Options() []ProcessOption

type ProcessOption

type ProcessOption interface {
	Apply(opts *ProcessOptions)
}

ProcessOption defines a common interface to modify the reader processor These options can be passed to the Exec function in a variadic way to customize the returned Reader instance

func Multiplexed

func Multiplexed() ProcessOption

Multiplexed returns a ProcessOption that configures the command execution to combine stdout and stderr into a single stream without Docker's multiplexing headers.

func WithEnv

func WithEnv(env []string) ProcessOption

WithEnv sets the environment variables for the exec command

func WithTTY

func WithTTY(tty bool) ProcessOption

WithTTY sets the TTY for the exec command

func WithUser

func WithUser(user string) ProcessOption

WithUser sets the user for the exec command

func WithWorkingDir

func WithWorkingDir(workingDir string) ProcessOption

WithWorkingDir sets the working directory for the exec command

type ProcessOptionFunc

type ProcessOptionFunc func(opts *ProcessOptions)

ProcessOptionFunc is a function that implements the ProcessOption interface

func (ProcessOptionFunc) Apply

func (fn ProcessOptionFunc) Apply(opts *ProcessOptions)

Apply applies the ProcessOption to the ProcessOptions

type ProcessOptions

type ProcessOptions struct {
	ExecConfig client.ExecCreateOptions
	Reader     io.Reader
}

ProcessOptions defines options applicable to the reader processor

func NewProcessOptions

func NewProcessOptions(cmd []string) *ProcessOptions

NewProcessOptions returns a new ProcessOptions instance with the given command and default options: - detach: false - attach stdout: true - attach stderr: true

type RawCommand

type RawCommand struct {
	ExecOptions
	// contains filtered or unexported fields
}

RawCommand is a type that implements Executable and represents a command to be sent to a container

func NewRawCommand

func NewRawCommand(cmds []string, opts ...ProcessOption) RawCommand

func (RawCommand) AsCommand

func (r RawCommand) AsCommand() []string

AsCommand returns the command as a slice of strings

Jump to

Keyboard shortcuts

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