exec2

package
v0.0.0-...-51f9457 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package exec2 is like os/exec but supports timeout in Wait and process containment for unix using process group.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cmd

type Cmd struct {
	*exec.Cmd
	// contains filtered or unexported fields
}

Cmd is like exec.Cmd, but supports terminate and process containment.

func CommandContext

func CommandContext(ctx context.Context, name string, arg ...string) *Cmd

CommandContext is like exec.CommandContext, but it uses process group by default and supports timeout in Wait function.

func (*Cmd) Kill

func (c *Cmd) Kill() error

Kill kills process.

func (*Cmd) Start

func (c *Cmd) Start() error

Start starts command with appropriate setup.

func (*Cmd) Terminate

func (c *Cmd) Terminate() error

Terminate sends SIGTERM on unix or CTRL+BREAK on windows.

func (*Cmd) Wait

func (c *Cmd) Wait() error

Wait waits to process to finish.

Jump to

Keyboard shortcuts

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