externalcmd

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: May 5, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package externalcmd allows to launch external commands.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cmd

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

Cmd is an external command.

func NewCmd

func NewCmd(
	pool *Pool,
	cmdstr string,
	restart bool,
	env Environment,
	onExit OnExitFunc,
) *Cmd

NewCmd allocates a Cmd.

func (*Cmd) Close

func (e *Cmd) Close()

Close closes the command. It doesn't wait for the command to exit.

type Environment

type Environment map[string]string

Environment is a Cmd environment.

type OnExitFunc added in v1.1.0

type OnExitFunc func(error)

OnExitFunc is the prototype of onExit.

type Pool

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

Pool is a pool of external commands.

func NewPool

func NewPool() *Pool

NewPool allocates a Pool.

func (*Pool) Close

func (p *Pool) Close()

Close waits for all external commands to exit.

Jump to

Keyboard shortcuts

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