utils

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

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

command exit types

Variables

This section is empty.

Functions

func PrintStatus

func PrintStatus(status cmd.Status)

Types

type Command

type Command struct {
	Name                 string
	Command              string
	Args                 []string
	Env                  []string
	Timeout              time.Duration
	StatusUpdateDuration 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 wait till it completes

func (*Command) Status

func (c *Command) Status() cmd.Status

Status returns the current status of the command

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