mcserver-backend

command module
v0.0.0-...-98571d4 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2020 License: GPL-3.0 Imports: 3 Imported by: 0

README

mcserver-backend

GoDoc GoReportCard TravisCI

The backend for a Minecraft Server hosting platform.

Usage

An API server listens on port 8000 by default. use the ./main --api-port new-port to run the server on a different port. The server has the following routes:

createServer - create a new Minecraft server.

Attribute Value
Method POST
Endpoint /api/createServer/

Request:

{
  "version": "1.12",
  "name": "Awesome server name",
  "port": "25565",
  "ram": "1000"
}

changeProperty - change a value in the server.properties file of a server.

Attribute Value
Method POST
Endpoint /api/changeProperty/

Request:

{
  "hash": "5daa124f",
  "property": "ServerPort",
  "newValue": "25599"
}

getServer - get a server given a hash or server id

Attribute Value
Method GET
Endpoint /api/getServer/{hash}

getAllServers - get all servers in the database

Attribute Value
Method GET
Endpoint /api/getAllServers

system - execute a systemctl command (either start, stop, or status)

Attribute Value
Method GET
Endpoint /api/system/{method}/{hash}

{method} is the systemctl command and {hash} is the target server's hash or id.

deleteServer - delete a server

Attribute Value
Method GET
Endpoint /api/deleteServer/{hash}

{hash} is the target server's hash or id.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package api implements an http api server for the entire backend (this entire repo).
Package api implements an http api server for the entire backend (this entire repo).
Package commands implements various actions that can take place on or a by a types.Server.
Package commands implements various actions that can take place on or a by a types.Server.
Package common implements methods and variables that do not fit into any other package and are mostly independent of this repository.
Package common implements methods and variables that do not fit into any other package and are mostly independent of this repository.
Package types implements the core types to this backend such a the server database.
Package types implements the core types to this backend such a the server database.

Jump to

Keyboard shortcuts

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