35 lines
624 B
Go
35 lines
624 B
Go
package main
|
|
|
|
import "sync"
|
|
import "time"
|
|
|
|
//import "github.com/rs/zerolog/log"
|
|
|
|
type InstanceBackend interface {
|
|
//FIXME
|
|
}
|
|
|
|
type InstanceManager struct {
|
|
sync.Mutex
|
|
instances map[InstanceHostname]*Instance
|
|
newInstanceNotifications chan InstanceHostname
|
|
}
|
|
|
|
func NewInstanceManager() *InstanceManager {
|
|
i := new(InstanceManager)
|
|
return i
|
|
}
|
|
|
|
func (self *InstanceManager) AddInstanceNotificationChannel(via chan InstanceHostname) {
|
|
self.Lock()
|
|
defer self.Unlock()
|
|
self.newInstanceNotifications = via
|
|
}
|
|
|
|
func (self *InstanceManager) Manage() {
|
|
for {
|
|
// FIXME(sneak)
|
|
time.Sleep(1 * time.Second)
|
|
}
|
|
}
|