Documentation ¶
Overview ¶
Package common implements methods and variables that do not fit into any other package and are mostly independent of this repository.
Index ¶
Constants ¶
View Source
const ( // ServerV112 is the download link for a pre-made 1.12 Minecraft Server. ServerV112 = "http://" + provider + "/mcserver-backend/dl/1.12.zip" // ServerV18 is the download link for a pre-made 1.8 Minecraft Server. ServerV18 = "http://" + provider + "/mcserver-backend/dl/1.8.zip" // ServerV172 is the download link for a pre-made 1.7.2 Minecraft Server. ServerV172 = "http://" + provider + "/mcserver-backend/dl/1.7.2.zip" // ServerV121 is the download link for a pre-made 1.2.1 Minecraft Server. ServerV121 = "http://" + provider + "/mcserver-backend/dl/1.2.1.zip" )
View Source
const ServerIDSize = 8
ServerIDSize is the length of server IDs.
Variables ¶
View Source
var ( // DataDir is the root directory for all server data. DataDir = "data" // ServersRoot is the root directory where all of the servers are stored. ServersRoot = path.Join(DataDir, "servers") // APIServerRoot is the default root route for the API server. APIServerRoot = "/api" )
Functions ¶
func CreateDirIfDoesNotExist ¶
CreateDirIfDoesNotExist creates a directory if it does not already exist.
func DownloadServer ¶
DownloadServer downloads and installs a pre-made server of the specified version.
func NewServerPath ¶
NewServerPath returns the path to a server given its name.
Types ¶
Click to show internal directories.
Click to hide internal directories.