localexec

package
v0.0.0-...-66ba595 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProcessServer

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

ProcessServer implements rex.Service in the Linux environment

func NewServer

func NewServer(dataDir string) *ProcessServer

NewServer creates a ProcessServer which is a concrete implementation of rex.Server.

func (*ProcessServer) Exec

func (ps *ProcessServer) Exec(ctx context.Context,
	path string, args ...string) (uuid.UUID, error)

Exec creates a process from the supplied path and args

func (*ProcessServer) GetProcessInfo

func (ps *ProcessServer) GetProcessInfo(ctx context.Context, processID uuid.UUID) (rex.ProcessInfo, error)

GetProcessInfo returns the process info corresponding to the givne processID

func (*ProcessServer) Kill

func (ps *ProcessServer) Kill(ctx context.Context, processID uuid.UUID, signal int) error

Kill sends a signal to the given process

func (*ProcessServer) ListProcessInfo

func (ps *ProcessServer) ListProcessInfo(ctx context.Context) ([]rex.ProcessInfo, error)

ListProcessInfo returs a list of all processes that have ever been successfully Exec'd into the system, sorted by their creation time (newest first).

func (*ProcessServer) Read

func (ps *ProcessServer) Read(ctx context.Context, processID uuid.UUID, target rex.OutputStream) ([]byte, error)

Read reads either the stdout or the stderr of the given process

Jump to

Keyboard shortcuts

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