cmd

package
v2.11.1 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Arg

type Arg string

Arg appends a single argument to the list of arguments

This option can be specified multiple times to provide multiple arguments. Please keep in mind that the order is maintained.

func (Arg) ApplyExecCmd

func (a Arg) ApplyExecCmd(c *exec.Cmd)

type Arguments

type Arguments []string

Arguments appends multiple arguments to the list of arguments

func Args

func Args(s ...string) Arguments

func (Arguments) ApplyExecCmd

func (as Arguments) ApplyExecCmd(c *exec.Cmd)

type Cmd added in v2.7.0

type Cmd exec.Cmd

Use the existing exec.Cmd

func Command added in v2.7.0

func Command(c *exec.Cmd) *Cmd

func (*Cmd) ApplyCmd added in v2.7.0

func (c *Cmd) ApplyCmd(d *g.Cmd)

type CombinedWriter

type CombinedWriter struct {
	io.Writer
}

CombinedWriter allows passing an io.Writer to which all outputs of the standard and error output of the sub-process are written.

func Combined

func Combined(wr io.Writer) CombinedWriter

func (CombinedWriter) ApplyCmd

func (s CombinedWriter) ApplyCmd(c *g.Cmd)

type Context

type Context struct {
	context.Context
}

Context will start the process with the provided context See exec.CommandContext()

func (Context) ApplyCmd

func (c Context) ApplyCmd(d *g.Cmd)

type Dir

type Dir string

Dir sets the working directory.

func (Dir) ApplyExecCmd

func (d Dir) ApplyExecCmd(c *exec.Cmd)

type DisableASLR

type DisableASLR bool

DisableASLR will start the sub-process with Address Space Layout Randomization disabled

See: https://en.wikipedia.org/wiki/Address_space_layout_randomization

func (DisableASLR) ApplyCmd

func (da DisableASLR) ApplyCmd(d *g.Cmd)

type Env

type Env string

Env appends additional environment variables.

func EnvVar

func EnvVar(k, v string) Env

EnvVar appends a key-value paired environment variable.

func (Env) ApplyExecCmd

func (e Env) ApplyExecCmd(c *exec.Cmd)

type Envs

type Envs []string

Envs appends additional environment variables.

func (Envs) ApplyExecCmd

func (e Envs) ApplyExecCmd(c *exec.Cmd)

type ExtraFile

type ExtraFile os.File

ExtraFile appends an additional file to the list of file descriptors which are passed on to the sub-process.

func (*ExtraFile) ApplyExecCmd

func (e *ExtraFile) ApplyExecCmd(c *exec.Cmd)

type PreserveEnv added in v2.6.0

type PreserveEnv string

A name of an environment variable which should be preserved from the parent process. If not provided PATH will be preserved by default. See gont.DefaultPreserveEnvVars

func (PreserveEnv) ApplyCmd added in v2.6.0

func (e PreserveEnv) ApplyCmd(c *g.Cmd)

type Scope added in v2.10.0

type Scope string

Scope sets the name of the systemd scope / CGroup in which the command should be started.

func (Scope) ApplyCmd added in v2.10.0

func (s Scope) ApplyCmd(c *g.Cmd)

type StderrWriter

type StderrWriter struct {
	io.Writer
}

StderrWriter allows passing an io.Writer to which all outputs of the standard error output of the sub-process are written.

func Stderr

func Stderr(wr io.Writer) StderrWriter

func (StderrWriter) ApplyCmd

func (s StderrWriter) ApplyCmd(c *g.Cmd)

type StdinReader

type StdinReader struct {
	io.Reader
}

Stdin set the standard input reader

func Stdin

func Stdin(rd io.Reader) StdinReader

func (StdinReader) ApplyExecCmd

func (s StdinReader) ApplyExecCmd(c *exec.Cmd)

type StdoutWriter

type StdoutWriter struct {
	io.Writer
}

StdoutWriter allows passing an io.Writer to which all outputs of the standard output of the sub-process are written.

func Stdout

func Stdout(wr io.Writer) StdoutWriter

func (StdoutWriter) ApplyCmd

func (s StdoutWriter) ApplyCmd(c *g.Cmd)

type SysProcAttr

type SysProcAttr syscall.SysProcAttr

SysProcAttr allows to set system specific process attributes.

func (*SysProcAttr) ApplyExecCmd

func (s *SysProcAttr) ApplyExecCmd(c *exec.Cmd)

Jump to

Keyboard shortcuts

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