cmd

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2019 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Attach = cmd.CMD{
	Name:  "attach",
	Alias: "a",
	Short: "Open the server console",
	Args:  &AttachArgs{},
	Run:   AttachToSession,
}

Attach opens the server console.

View Source
var Backup = cmd.CMD{
	Name:  "backup",
	Alias: "b",
	Short: "Backup all server files into a .tar.gz archive",
	Args:  &BackupArgs{},
	Run:   ArchiveServer,
}

Backup archives the Minecraft server files.

View Source
var Exec = cmd.CMD{
	Name:  "exec",
	Alias: "e",
	Short: "Executes a command in the Minecraft server",
	Args:  &ExecArgs{},
	Run:   Execute,
}

Exec sends a command to the Minecraft server

View Source
var Init = cmd.CMD{
	Name:  "init",
	Alias: "i",
	Short: "Initialize the setup for a Minecraft server",
	Args:  &InitArgs{},
	Run:   InitServer,
}

Init sets up everything required to start a Minecraft server

View Source
var Root *cmd.RootCMD

Root is the main command for the application

View Source
var Start = cmd.CMD{
	Name:  "start",
	Alias: "s",
	Short: "Start the Minecraft server",
	Args:  &StartArgs{},
	Run:   StartServer,
}

Start attempts to start a Minecraft server.

View Source
var Stop = cmd.CMD{
	Name:  "stop",
	Alias: "st",
	Short: "Stop the Minecraft server",
	Args:  &StopArgs{},
	Run:   StopServer,
}

Stop attempts to stop a Minecraft server.

View Source
var Update = cmd.CMD{
	Name:  "update",
	Alias: "u",
	Short: "Update the jar file for the Minecraft server",
	Args:  &UpdateArgs{},
	Run:   UpdateServer,
}

Update downloads a server jar from the given URL.

Functions

func ArchiveServer

func ArchiveServer(root *cmd.RootCMD, c *cmd.CMD)

ArchiveServer adds all directories and files of the server into a Gzip'd tar archive.

func AttachToSession

func AttachToSession(root *cmd.RootCMD, c *cmd.CMD)

AttachToSession attaches to the server console if the server is running.

func Execute

func Execute(root *cmd.RootCMD, c *cmd.CMD)

Execute will run a command on a running Minecraft server

func InitServer

func InitServer(root *cmd.RootCMD, c *cmd.CMD)

InitServer sets up the Minecraft server directory

func StartServer

func StartServer(root *cmd.RootCMD, c *cmd.CMD)

StartServer starts a Minecraft server.

func StopServer

func StopServer(root *cmd.RootCMD, c *cmd.CMD)

StopServer stops the Minecraft server

func UpdateServer

func UpdateServer(root *cmd.RootCMD, c *cmd.CMD)

UpdateServer downloads the specified server file.

Types

type AttachArgs

type AttachArgs struct{}

AttachArgs contains the command arguments for the stop command.

type BackupArgs

type BackupArgs struct{}

BackupArgs contains the command arguments for the backup command.

type ExecArgs

type ExecArgs struct {
	Command string `desc:"The full command to send to the server. Use quotes for multiple words."`
}

ExecArgs contains the command arguments for the execute command

type GlobalFlags

type GlobalFlags struct{}

GlobalFlags holds the flags for all commands.

type InitArgs

type InitArgs struct {
	URL string `desc:"Location of a server jar to download"`
}

InitArgs contains the command arguments for the init command

type StartArgs

type StartArgs struct{}

StartArgs contains the command arguments for the start command.

type StopArgs

type StopArgs struct{}

StopArgs contains the command arguments for the stop command.

type UpdateArgs

type UpdateArgs struct {
	Provider string `desc:"The server software we're trying to update"`
	Version  string `desc:"The Minecraft version to download"`
}

UpdateArgs contains the command arguments for the update command

Jump to

Keyboard shortcuts

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