process

package
v0.6.15 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package process Provide some process handle util functions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exists

func Exists(pid int) bool

Exists check process running by given pid

func Kill added in v0.6.2

func Kill(pid int, signal syscall.Signal) error

Kill a process by pid

func KillByName added in v0.6.2

func KillByName(keywords string, sig syscall.Signal) error

KillByName kill process by name match

func PID added in v0.3.6

func PID() int

PID get current process ID

func PIDByName added in v0.6.2

func PIDByName(keywords string) int

PIDByName get PID by process name match

func ProcInfo added in v0.6.2

func ProcInfo(pid int) (*os.Process, error)

ProcInfo looks for a running process by its pid.

alias of os.FindProcess()

func Start added in v0.6.2

func Start(name string, argv []string, attr *os.ProcAttr) (*os.Process, error)

Start starts a new process with the program, arguments and attributes specified by name, argv and attr.

alias of os.StartProcess()

Types

type PidFile added in v0.5.6

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

PidFile struct

func NewPidFile added in v0.5.6

func NewPidFile(file string) *PidFile

NewPidFile instance

func (*PidFile) Exists added in v0.5.6

func (pf *PidFile) Exists() bool

Exists of th pid file

func (*PidFile) File added in v0.5.6

func (pf *PidFile) File() string

File path

func (*PidFile) PID added in v0.5.6

func (pf *PidFile) PID() int

PID value

func (*PidFile) Save added in v0.5.6

func (pf *PidFile) Save() error

Save PID value to file

func (*PidFile) SetPID added in v0.5.6

func (pf *PidFile) SetPID(val int) int

SetPID value

func (*PidFile) String added in v0.5.6

func (pf *PidFile) String() string

String PID value string

Jump to

Keyboard shortcuts

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