exec

package
v0.128.1 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2024 License: Apache-2.0 Imports: 13 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 added in v0.118.0

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

func NewCircularBuffer added in v0.118.0

func NewCircularBuffer(capacity int) *CircularBuffer

func (*CircularBuffer) Bytes added in v0.118.0

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

func (*CircularBuffer) Write added in v0.118.0

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 added in v0.118.0

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 (*Cmd) Kill

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

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

func (*Cmd) RunBuffered added in v0.118.0

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

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

Jump to

Keyboard shortcuts

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