command

package
v0.0.0-...-71876dc Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_RUM_TIMEOUT = 3600
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Cmd           string
	Timeout       time.Duration
	TerminateChan chan int
	Setpgid       bool
	// contains filtered or unexported fields
}

func NewCmd

func NewCmd(c *Command) (*Command, error)

func (*Command) Run

func (c *Command) Run() error

func (*Command) Stderr

func (c *Command) Stderr() string

func (*Command) Stdout

func (c *Command) Stdout() string

type Task

type Task struct {
	Commands []string
	// contains filtered or unexported fields
}

func NewTask

func NewTask(cmds []string, timeout int) *Task

func (*Task) GetError

func (t *Task) GetError() error

func (*Task) Result

func (t *Task) Result() []*TaskResult

func (*Task) Run

func (t *Task) Run()

func (*Task) Terminate

func (t *Task) Terminate()

type TaskResult

type TaskResult struct {
	Cmd     string `json:"cmd"`
	Stdout  string `json:"stdout"`
	Stderr  string `json:"stderr"`
	Success bool   `json:"success"`
}

Jump to

Keyboard shortcuts

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