command

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExitTypeNormal  = "normal"
	ExitTypeTimeout = "timeout"
	ExitTypeStop    = "stop"
)

command exit types

Variables

This section is empty.

Functions

func StopAll

func StopAll()

StopAll terminates all the running commands

Types

type Command

type Command struct {
	Name         string
	Command      string
	Args         []string
	Env          []string
	Timeout      time.Duration
	StatusUpdate time.Duration
	StatusFn     func(cmd.Status)
	ExitFn       func(string, cmd.Status)
	// contains filtered or unexported fields
}

Command deails

func (*Command) IsRunning

func (c *Command) IsRunning() bool

IsRunning returns the current status of the command

func (*Command) Start

func (c *Command) Start() error

Start triggers the command

func (*Command) StartAndWait

func (c *Command) StartAndWait() error

StartAndWait triggers the command and waits till it completes

func (*Command) Stop

func (c *Command) Stop() error

Stop terminates the command

Jump to

Keyboard shortcuts

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