Renamed VirtualServer to LogicalServer. Filled out some comments.

This commit is contained in:
Gary Talent 2016-02-27 16:45:20 -06:00
parent 89a9b98b35
commit ffafcb08a5
4 changed files with 10 additions and 5 deletions

View File

@ -3,10 +3,10 @@
"Services": {
"Minecraft": {
"Port": 25565,
"VirtualDroplet": "minecraft"
"LogicalDroplet": "minecraft"
}
},
"VirtualDroplets": {
"LogicalServers": {
"minecraft": {
"Size": "4gb",
"Region": "nyc3"

View File

@ -57,7 +57,7 @@ func (me *DropletHandler) Spinup(name string) (string, error) {
if err != nil {
return "", err
}
vd := me.settings.VirtualServers[name]
vd := me.settings.LogicalServers[name]
createRequest := &godo.DropletCreateRequest{
Name: DROPLET_NS + name,
Region: vd.Region,

View File

@ -47,12 +47,17 @@ func NewServerManager(name string, server ServerHandler, settings Settings) *Ser
Serves channel requests.
*/
func (me *ServerManager) Serve() {
// TODO: see if server is currently up, and setup port forwarding if so
// event loop
for running := true; running; {
select {
case action := <-me.in:
running = me.serveAction(action)
}
}
// notify done
me.done <- 42
}

View File

@ -15,7 +15,7 @@ import (
type Settings struct {
ApiToken string
Services map[string]Service
VirtualServers map[string]VirtualServer
LogicalServers map[string]LogicalServer
}
type Service struct {
@ -23,7 +23,7 @@ type Service struct {
LogicalServer string
}
type VirtualServer struct {
type LogicalServer struct {
Size string
Region string
}