command

package
v0.0.71 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetExecutable added in v0.0.71

func GetExecutable() string

GetExecutable returns the path to the current executable.

Types

type ForkArgs

type ForkArgs struct {
	// required
	Log     logger.Logger
	Command string

	// optional
	Context             context.Context
	Args                []string
	Cwd                 string
	BaseDir             string // the base director to upload if different than dir
	Dir                 string // the directory to store logs in
	LogFilenameLabel    string
	SaveLogs            bool
	Env                 []string
	SkipBundleOnSuccess bool
	WriteToStd          bool
	ForwardInterrupt    bool
	LogFileSink         bool
	ProcessCallback     ProcessCallback
}

type ForkResult

type ForkResult struct {
	Duration       time.Duration
	LastErrorLines string
	ProcessState   *os.ProcessState
	LogFileBundle  string
}

func Fork

func Fork(args ForkArgs) (*ForkResult, error)

Fork will run a command on the current executable.

func (*ForkResult) String

func (r *ForkResult) String() string

type ProcessCallback added in v0.0.63

type ProcessCallback func(process *os.Process)

type Uploader

type Uploader func(ctx context.Context, log logger.Logger, file string) (string, error)

Jump to

Keyboard shortcuts

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