Documentation ¶
Index ¶
- Variables
- func ArchiveServer(root *cmd.Root, c *cmd.Sub)
- func AttachToSession(root *cmd.Root, c *cmd.Sub)
- func Execute(root *cmd.Root, c *cmd.Sub)
- func InitServer(root *cmd.Root, c *cmd.Sub)
- func PrintDownloaderUsage(sub *cmd.Sub)
- func ServerStatus(root *cmd.Root, c *cmd.Sub)
- func StartServer(root *cmd.Root, c *cmd.Sub)
- func StopServer(root *cmd.Root, c *cmd.Sub)
- func UpdateServer(root *cmd.Root, c *cmd.Sub)
- type BackupFlags
- type DownloaderArgs
- type ExecArgs
- type GlobalFlags
- type StatusFlags
Constants ¶
This section is empty.
Variables ¶
var Attach = cmd.Sub{ Name: "attach", Alias: "a", Short: "Open the server console", Run: AttachToSession, }
Attach opens the server console.
var Backup = cmd.Sub{ Name: "backup", Alias: "b", Short: "Backup all server files into a tar archive with optional compression", Flags: &BackupFlags{}, Run: ArchiveServer, }
Backup archives the Minecraft server files.
var Exec = cmd.Sub{ Name: "exec", Alias: "e", Short: "Executes a command in the Minecraft server", Args: &ExecArgs{}, Run: Execute, }
Exec sends a command to the Minecraft server
var Init = cmd.Sub{ Name: "init", Alias: "i", Short: "Initialize the setup for a Minecraft server", Args: &DownloaderArgs{}, Run: InitServer, }
Init sets up everything required to start a Minecraft server
var Log *waterlog.WaterLog
Log is our logger via WaterLog. TODO: Make this not suck
var Start = cmd.Sub{ Name: "start", Alias: "s", Short: "Start the Minecraft server", Run: StartServer, }
Start attempts to start a Minecraft server.
var Status = cmd.Sub{ Name: "status", Alias: "n", Short: "View status info about a Minecraft server", Flags: &StatusFlags{}, Run: ServerStatus, }
Status prints information about a Minecraft server.
var Stop = cmd.Sub{ Name: "stop", Alias: "t", Short: "Stop the Minecraft server", Run: StopServer, }
Stop attempts to stop a Minecraft server.
var Update = cmd.Sub{ Name: "update", Alias: "u", Short: "Update the jar file for the Minecraft server", Args: &DownloaderArgs{}, Run: UpdateServer, }
Update downloads a server jar from the given URL.
Functions ¶
func ArchiveServer ¶
ArchiveServer adds all directories and files of the server into a tar archive with optional compression.
func AttachToSession ¶
AttachToSession attaches to the server console if the server is running.
func InitServer ¶
InitServer sets up the Minecraft server directory
func PrintDownloaderUsage ¶ added in v1.1.0
PrintDownloaderUsage prints the proper usage to the user.
func ServerStatus ¶ added in v1.3.0
ServerStatus handles the `Status` command and prints out various information about a Minecraft server.
func StartServer ¶
StartServer starts a Minecraft server.
Types ¶
type BackupFlags ¶ added in v1.2.0
type BackupFlags struct {
Level int `short:"l" long:"level" desc:"Set the compression format to use; 0: no compression; 1: gzip"`
}
BackupFlags holds the flags for the backup command.
type DownloaderArgs ¶ added in v1.1.0
type DownloaderArgs struct {
Args []string `zero:"true" desc:"URL to the server jar to download, or a provider and version, e.g. \"paper 1.16.4\""`
}
DownloaderArgs contains the command arguments for commands that download a server jar file.
func (DownloaderArgs) IsValid ¶ added in v1.1.0
func (a DownloaderArgs) IsValid() bool
IsValid checks if the correct number of args were passed. For downloading, args must contain either just one arg with a URL, or two args with the provider name and version.
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 {
Path string `short:"p" long:"path" arg:"true" desc:"Set the path of the Minecraft server"`
}
GlobalFlags holds the flags for the root command.
func (GlobalFlags) GetPathPrefix ¶ added in v1.1.0
func (f GlobalFlags) GetPathPrefix() (string, error)
GetPathPrefix gets the server path from the command line flags. If there isn't one, return the current working directory.
type StatusFlags ¶ added in v1.3.0
type StatusFlags struct { ShowAll bool `short:"a" desc:"Print all extra server info"` ShowGameplay bool `short:"g" desc:"Print gameplay properties"` ShowRcon bool `short:"r" desc:"Print Rcon configuration information"` ShowWorld bool `short:"w" desc:"Print main world informations"` }
StatusFlags holds the various flags that can be passed to the status command.