run

package
v0.0.0-...-c6d80bb Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNonZeroExit        = fmt.Errorf("nonZero Exit: The code finished with exit code != 0")
	ErrOutputLimit        = fmt.Errorf("output Limit: Produced output is more that expected")
	ErrMemoryLimit        = fmt.Errorf("memory Limit: The code is using too much memory")
	ErrTimedOut           = fmt.Errorf("timed Out: the code did'nt complete execution in time")
	ErrNoOutput           = fmt.Errorf("no Output: The Code doesn't have any output")
	ErrMalformedCommand   = fmt.Errorf("malformed Command: The provided command is malformed")
	ErrNotValidExecutable = fmt.Errorf("specified program is not a valid executable")
)

Functions

func CheckAndErrorRequirements

func CheckAndErrorRequirements(names []string)

prompt user that the program is not installed

func DefaultRun

func DefaultRun(command string) (string, string, error)

func JustOut

func JustOut(command string) (string, error)

func JustRun

func JustRun(command string) error

func Run

func Run(commandStr string, outLimit int, memLimit uint64, timeout time.Duration) (string, string, error)

Run a command with given limits for outbut (bytes), memory limiy (bytes) and duration duration is handling with golang's context so it's almost reliable but output limit and memory limit are handmaiden cross platform solutions known bugs: memory limit monitor routine sometimes experience starvation so it doen'st kill the program on-time

func WhichNotInstalled

func WhichNotInstalled(names []string) string

check that which program in provided list is not installed if all of them are installed, return an empty string

Types

This section is empty.

Jump to

Keyboard shortcuts

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