bumper

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2023 License: EPL-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bumper

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

Bumper is responsible for sending a signal to a process it tries to find using criteria given in the New function.

func New

func New(signal string, ds []Detection) Bumper

New constructs a new Bumper instance. The provided detections represent the desired process hierarchy. The first element is the process to detect, the second element is its parent process, etc.

func (*Bumper) Bump

func (b *Bumper) Bump() error

Bump tries to find the process matching the criteria of the Bumper and will send a configured signal to it.

type Detection

type Detection interface {
	// contains filtered or unexported methods
}

Detection abstracts a process detection. Use the DetectPid or DetectCommand factory methods to create individual instances.

func DetectCommand

func DetectCommand(command string) (Detection, error)

DetectCommand function returns a new detection instance from the given string. The string must be a valid regular expression otherwise error is returned.

func DetectPid

func DetectPid(pid int32) Detection

DetectPid returns a detection of a process with the provided PID.

Jump to

Keyboard shortcuts

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