Documentation
¶
Index ¶
- Variables
- func Backup(ctx context.Context, serverDir string, maxBackups int, screen *ScreenManager, ...) error
- func RotateParkour(ctx context.Context, serverDir string, screen *ScreenManager, output *ui.UI) error
- func RotateToMap(ctx context.Context, mapName string, screen *ScreenManager, output *ui.UI) error
- func Sleep(ctx context.Context, seconds int) error
- type ProcessStats
- type ScreenManager
Constants ¶
This section is empty.
Variables ¶
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
RotateToMap broadcasts and teleports all players to the named map.
Types ¶
type ProcessStats ¶
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.