process

package
v0.0.0-...-67af0ea Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Red    = "\033[31m"
	Reset  = "\033[0m"
	Yellow = "\033[33m"
)

Variables

This section is empty.

Functions

func CheckObproxyProcess

func CheckObproxyProcess() (bool, error)

func CheckObproxydProcess

func CheckObproxydProcess() (bool, error)

func CheckObserverProcess

func CheckObserverProcess() (bool, error)

func CheckPortSocketInode

func CheckPortSocketInode(port string) (bool, error)

func CheckProcessExist

func CheckProcessExist(pid int32) (bool, error)

func ExecuteBinary

func ExecuteBinary(binaryPath string, inputs []string) (err error)

func Exit

func Exit(code int)

func ExitWithError

func ExitWithError(code int, err error)

func ExitWithFailure

func ExitWithFailure(code int, msg string)

func ExitWithMsg

func ExitWithMsg(code int, msg string)

func FindPIDByPort

func FindPIDByPort(port uint32) (int32, error)

func GetDaemonPid

func GetDaemonPid() (int32, error)

func GetObproxyPid

func GetObproxyPid() (string, error)

for obproxy

func GetObproxydPid

func GetObproxydPid() (string, error)

for obproxy

func GetObserverPid

func GetObserverPid() (string, error)

func GetObserverUid

func GetObserverUid() (uint32, error)

func GetObshellPid

func GetObshellPid() (int32, error)

func GetObshellPidStr

func GetObshellPidStr() (string, error)

func GetPid

func GetPid(path string) (int32, error)

func GetUidFromPid

func GetUidFromPid(pid int) (uint32, error)

func Gid

func Gid() uint32

func Uid

func Uid() uint32

func WritePid

func WritePid(path string, pid int) (err error)

writePid writes the pid to the specified path atomically. If the file already exists, an error is returned.

func WritePidForce

func WritePidForce(path string, pid int) (err error)

writePid writes the pid to the specified path atomically.

Types

type ProcState

type ProcState struct {
	Pid      int
	StartAt  time.Time
	EndAt    time.Time
	Exited   bool
	ExitCode int
}

type Process

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

func NewProcess

func NewProcess(conf ProcessConfig) *Process

func (*Process) GetState

func (p *Process) GetState() ProcState

GetState will return the current process state.

func (*Process) IsRunning

func (p *Process) IsRunning() bool

func (*Process) Kill

func (p *Process) Kill() error

Kill will send a KILL signal.

func (*Process) Start

func (p *Process) Start() (err error)

func (*Process) Stop

func (p *Process) Stop() error

func (*Process) SwitchToLogMode

func (p *Process) SwitchToLogMode()

type ProcessConfig

type ProcessConfig struct {
	Program     string
	Args        []string
	LogFilePath string
}

type ProcessInfo

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

func (*ProcessInfo) Exist

func (p *ProcessInfo) Exist() (bool, error)

func (*ProcessInfo) Pid

func (p *ProcessInfo) Pid() (string, error)

Jump to

Keyboard shortcuts

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