procutils

package
v0.3.11-8 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2024 License: Apache-2.0 Imports: 19 Imported by: 67

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Timeout = 3 * time.Second
)

Functions

func GetProcCmdline

func GetProcCmdline(pid uint) ([]string, error)

func RemoteReadDir

func RemoteReadDir(dirname string) ([]os.FileInfo, error)

func RemoteStat

func RemoteStat(filename string) (os.FileInfo, error)

func SetRemoteExecutor

func SetRemoteExecutor()

func WaitZombieLoop

func WaitZombieLoop(ctx context.Context)

Types

type Cmd

type Cmd interface {
	StdinPipe() (io.WriteCloser, error)
	StdoutPipe() (io.ReadCloser, error)
	StderrPipe() (io.ReadCloser, error)
	CombinedOutput() ([]byte, error)
	Start() error
	Wait() error
	Run() error
	Kill() error
}

type Command

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

func NewCommand

func NewCommand(name string, args ...string) *Command

func NewCommandContext

func NewCommandContext(ctx context.Context, name string, args ...string) *Command

func NewRemoteCommandAsFarAsPossible

func NewRemoteCommandAsFarAsPossible(name string, args ...string) *Command

exec remote command as far as possible

func NewRemoteCommandContextAsFarAsPossible

func NewRemoteCommandContextAsFarAsPossible(ctx context.Context, name string, args ...string) *Command

func (*Command) GetExitStatus

func (c *Command) GetExitStatus(err error) (int, bool)

func (*Command) Kill

func (c *Command) Kill() error

func (*Command) Output

func (c *Command) Output() ([]byte, error)

func (*Command) Run

func (c *Command) Run() error

func (*Command) Start

func (c *Command) Start() error

func (*Command) StderrPipe

func (c *Command) StderrPipe() (io.ReadCloser, error)

func (*Command) StdinPipe

func (c *Command) StdinPipe() (io.WriteCloser, error)

func (*Command) StdoutPipe

func (c *Command) StdoutPipe() (io.ReadCloser, error)

func (*Command) String

func (c *Command) String() string

func (*Command) Wait

func (c *Command) Wait() error

type Executor

type Executor interface {
	CommandContext(ctx context.Context, name string, args ...string) Cmd
	Command(name string, args ...string) Cmd

	GetExitStatus(err error) (int, bool)
}

Jump to

Keyboard shortcuts

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