exec

package
v0.408.2 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Capture

func Capture(ctx context.Context, dir, exe string, args ...string) ([]byte, error)

func LookPath

func LookPath(exe string) (string, error)

Types

type CircularBuffer

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

func NewCircularBuffer

func NewCircularBuffer(capacity int) *CircularBuffer

func (*CircularBuffer) Bytes

func (cb *CircularBuffer) Bytes() []byte

func (*CircularBuffer) Write

func (cb *CircularBuffer) Write(p string) error

Write accepts a string and stores it in the buffer. It expects entire lines and stores each line as a separate entry in the ring buffer.

func (*CircularBuffer) WriterAt

func (cb *CircularBuffer) WriterAt(ctx context.Context, level log.Level) *io.PipeWriter

type Cmd

type Cmd struct {
	*exec.Cmd
	// contains filtered or unexported fields
}

func Command

func Command(ctx context.Context, level log.Level, dir, exe string, args ...string) *Cmd

func CommandWithEnv added in v0.361.0

func CommandWithEnv(ctx context.Context, level log.Level, dir string, env []string, exe string, args ...string) *Cmd

func (*Cmd) Kill

func (c *Cmd) Kill(signal syscall.Signal) error

Kill sends a signal to the process group of the command.

func (*Cmd) RunBuffered

func (c *Cmd) RunBuffered(ctx context.Context) error

RunBuffered runs the command and captures the output. If the command fails, the output is logged.

func (*Cmd) RunStderrError added in v0.360.0

func (c *Cmd) RunStderrError(ctx context.Context) error

RunStderrError runs the command and captures the output. If the command fails, the stderr is returned as the error message.

Jump to

Keyboard shortcuts

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