Renamed VirtualServer to LogicalServer. Filled out some comments.
This commit is contained in:
parent
89a9b98b35
commit
ffafcb08a5
@ -3,10 +3,10 @@
|
||||
"Services": {
|
||||
"Minecraft": {
|
||||
"Port": 25565,
|
||||
"VirtualDroplet": "minecraft"
|
||||
"LogicalDroplet": "minecraft"
|
||||
}
|
||||
},
|
||||
"VirtualDroplets": {
|
||||
"LogicalServers": {
|
||||
"minecraft": {
|
||||
"Size": "4gb",
|
||||
"Region": "nyc3"
|
||||
|
@ -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,
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user