Documentation ¶
Index ¶
- func CopyBackup(s *server.Server) (string, error)
- func DockerClient() *client.Client
- func ExportMCWorld(s *server.Server, dest string) error
- func GetServerOrExit(containerName string) *server.Server
- func NewServer(name string, port int, props []string, mcw mcworld.ZipOpener, useVolume bool) (*server.Server, error)
- func PrintServers(all bool) error
- func SetServerProperties(propFlags []string, s *server.Server) error
- func StartServer(name string, port int) (*server.Server, error)
- func TrimBackups(name string, keep int, skip bool) ([]string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyBackup ¶
CopyBackup copies the server world files to the server backup directory.
func DockerClient ¶
func ExportMCWorld ¶
ExportMCWorld copies the server's current world files to a zipped .mcworld file at the given destination which must be a directory.
func GetServerOrExit ¶
GetServerOrExit is a convenience function for attempting to find an existing docker container with the given name. If not found, a helpful error message is printed and the program exits without error.
func NewServer ¶
func NewServer(name string, port int, props []string, mcw mcworld.ZipOpener, useVolume bool) (*server.Server, error)
NewServer spawns a new craft server. Only the name is required. Full path to a .mcworld file, port and a slice of "property=newvalue" strings may also be provided.
func PrintServers ¶
PrintServers prints a list of servers. If all is true then stopped servers will be printed. Running servers show the port players should connect on and stopped servers show the date and time at which they were stopped.
func SetServerProperties ¶
SetServerProperties takes a slice of key=value strings and applies them to the server.properties configuration file. If a key is missing, an error will be returned and no changes will be made.
func StartServer ¶
StartServer sorts all available backup files by date and starts a server from the latest backup.
Types ¶
This section is empty.