executor

package
v0.0.1-beta4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrStepsEmpty = errors.New("executor: the steps empty")
)

Functions

This section is empty.

Types

type BashExecutor

type BashExecutor struct {
	Cmd string
	// contains filtered or unexported fields
}

func NewBashExecutor

func NewBashExecutor(cmd string) *BashExecutor

func (*BashExecutor) BindLog

func (b *BashExecutor) BindLog(logFile string) *BashExecutor

func (*BashExecutor) Exec

func (b *BashExecutor) Exec() *BashExecutor

func (*BashExecutor) OutRelease

func (b *BashExecutor) OutRelease() (v string, ok bool, err error)

func (*BashExecutor) Pid

func (b *BashExecutor) Pid() int

func (*BashExecutor) Release

func (b *BashExecutor) Release() (ok bool, err error)

func (*BashExecutor) Run

func (b *BashExecutor) Run() *BashExecutor

func (*BashExecutor) SetPid

func (b *BashExecutor) SetPid() *BashExecutor

func (*BashExecutor) Terminate

func (b *BashExecutor) Terminate() (err error)

type Executor

type Executor struct {
	// contains filtered or unexported fields
}

func NewExecutor

func NewExecutor(async bool) *Executor

func NewExecutorSteps

func NewExecutorSteps(async bool, stepCmd ...string) *Executor

func (*Executor) Add

func (etr *Executor) Add(step *Step)

func (*Executor) Chan

func (etr *Executor) Chan(outC, errC chan<- string)

func (*Executor) Clear

func (etr *Executor) Clear()

func (*Executor) Create

func (etr *Executor) Create(cmd string, args ...string)

func (*Executor) CreateFromFullCmd

func (etr *Executor) CreateFromFullCmd(cmd string)

func (*Executor) Exec

func (etr *Executor) Exec() (ok bool, err error)

func (*Executor) Kill

func (etr *Executor) Kill()

func (*Executor) NextId

func (etr *Executor) NextId() int

type Step

type Step struct {
	Started    bool          // The step started?
	Exited     bool          // The step exited?
	ExitCode   int           // The step exit code
	Success    bool          // The step executed and not return an error?
	State      string        // The step state
	Pid        int           // The step process id
	UserTime   time.Duration // The step user time
	SystemTime time.Duration // The step system time
	// contains filtered or unexported fields
}

func NewStep

func NewStep(id int, name string, args ...string) *Step

func (*Step) CmdArgs

func (s *Step) CmdArgs() []string

func (*Step) CmdName

func (s *Step) CmdName() string

func (*Step) Id

func (s *Step) Id() int

func (*Step) Kill

func (s *Step) Kill() (err error)

func (*Step) Start

func (s *Step) Start(outC, errC chan<- string) (ok bool, err error)

Jump to

Keyboard shortcuts

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