exec

package
v0.279.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 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

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 (*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.

Jump to

Keyboard shortcuts

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