craft

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2021 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyBackup

func CopyBackup(s *server.Server) (string, error)

CopyBackup copies the server world files to the server backup directory.

func DockerClient

func DockerClient() *client.Client

func ExportMCWorld

func ExportMCWorld(s *server.Server, dest string) error

ExportMCWorld copies the server's current world files to a zipped .mcworld file at the given destination which must be a directory.

func GetServerOrExit

func GetServerOrExit(containerName string) *server.Server

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

func PrintServers(all bool) error

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

func SetServerProperties(propFlags []string, s *server.Server) error

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

func StartServer(name string, port int) (*server.Server, error)

StartServer sorts all available backup files by date and starts a server from the latest backup.

func TrimBackups

func TrimBackups(name string, keep int, skip bool) ([]string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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