process

package
v0.0.0-...-b775d63 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ActiveServers = make(map[string]*ServerProcess)

ActiveServers keeps track of running server processes

Functions

func FindJavaPID

func FindJavaPID() (int, error)

FindJavaPID finds the PID of the Java process for a Minecraft server

func IsProcessRunning

func IsProcessRunning(pid int) bool

IsProcessRunning checks if a process with the given PID is running

func LoadActiveServers

func LoadActiveServers() error

LoadActiveServers loads the active servers from a file

func NewSysProcAttr

func NewSysProcAttr() *syscall.SysProcAttr

NewSysProcAttr returns a new SysProcAttr for Unix-like systems

func RefreshServerStatus

func RefreshServerStatus()

RefreshServerStatus updates the status of all active servers

func SaveActiveServers

func SaveActiveServers() error

SaveActiveServers saves the active servers to a file

Types

type ServerProcess

type ServerProcess struct {
	Name    string
	PID     int
	Running bool
}

ServerProcess represents a running Minecraft server process

type ServerProcessInfo

type ServerProcessInfo struct {
	Name    string `json:"name"`
	PID     int    `json:"pid"`
	Running bool   `json:"running"`
	Path    string `json:"path"`
}

ServerProcessInfo represents the serializable information about a running server process

Jump to

Keyboard shortcuts

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