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 StartServer(root *cmd.Root, c *cmd.Sub)
- func StopServer(root *cmd.Root, c *cmd.Sub)
- func UpdateServer(root *cmd.Root, c *cmd.Sub)
- type DownloaderArgs
- type ExecArgs
- type GlobalFlags
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.gz archive", 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 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 Gzip'd tar archive.
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 StartServer ¶
StartServer starts a Minecraft server.
Types ¶
type DownloaderArgs ¶ added in v1.1.0
type DownloaderArgs struct {
Args []string `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.