process

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidProcess = errors.New("InvalidProcess")

Functions

func NewSignal added in v0.0.5

func NewSignal[T string | int](x T) (syscall.Signal, bool)

NewSignal returns the Signal for signal named x or numbered x.

Examples:

  • "INT" -> syscall.SIGINT
  • 2 -> syscall.SIGINT
  • "2" -> syscall.SIGINT

func SignalIntoInt added in v0.0.7

func SignalIntoInt(s os.Signal) (int, bool)

func SignalIntoString added in v0.0.7

func SignalIntoString(s os.Signal) string

Types

type Process

type Process struct {
	Stdin        io.Reader
	Stdout       io.Writer
	Stderr       io.Writer
	Args         []string
	CancelSignal os.Signal
	WaitDelay    time.Duration
	// contains filtered or unexported fields
}

Process is an external command executed under lock control.

func NewProcess

func NewProcess(locker *lease.Locker, name string, arg ...string) *Process

func (*Process) Run

func (p *Process) Run(ctx context.Context, opt ...lease.ConfigOption) error

Run starts the specified command and waits for it to complete with the lease lock.

Run supports the same options as lease.Locker.LockAndRun.

func (*Process) Validate

func (p *Process) Validate() error

Jump to

Keyboard shortcuts

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