management

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ParkourMaps = []string{
	"parkour-spiral",
	"parkour-spiral-3",
	"parkour-volcano",
	"parkour-pyramid",
	"parkour-paradise",
}

ParkourMaps is the default list of parkour map world folder names.

Functions

func Backup

func Backup(ctx context.Context, serverDir string, maxBackups int, screen *ScreenManager, output *ui.UI) error

Backup creates a compressed backup of world directories with rotation.

func RotateParkour

func RotateParkour(ctx context.Context, serverDir string, screen *ScreenManager, output *ui.UI) error

RotateParkour advances the featured parkour map, broadcasts, and teleports.

func RotateToMap added in v0.2.0

func RotateToMap(ctx context.Context, mapName string, screen *ScreenManager, output *ui.UI) error

RotateToMap broadcasts and teleports all players to the named map.

func Sleep

func Sleep(ctx context.Context, seconds int) error

Sleep pauses for the given number of seconds, respecting context cancellation.

Types

type ProcessStats

type ProcessStats struct {
	PID    int
	Memory string
	CPU    string
}

ProcessStats holds resource usage info for the server process.

func GetProcessStats

func GetProcessStats(ctx context.Context, runner platform.CommandRunner) (ProcessStats, error)

GetProcessStats finds the server.jar process and returns its stats.

type ScreenManager

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

ScreenManager wraps GNU screen session operations.

func NewScreenManager

func NewScreenManager(runner platform.CommandRunner, session string) *ScreenManager

NewScreenManager creates a ScreenManager for the named session.

func (*ScreenManager) IsRunning

func (s *ScreenManager) IsRunning(ctx context.Context) bool

IsRunning checks if the named screen session exists.

func (*ScreenManager) SendCommand

func (s *ScreenManager) SendCommand(ctx context.Context, cmd string) error

SendCommand sends a command string to the screen session.

func (*ScreenManager) Session

func (s *ScreenManager) Session() string

Session returns the session name.

func (*ScreenManager) Start

func (s *ScreenManager) Start(ctx context.Context, command string, args ...string) error

Start launches a command in a new detached screen session.

Jump to

Keyboard shortcuts

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