command

package
v2.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2025 License: Apache-2.0 Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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