2014-04-26 09:18:56 +00:00
|
|
|
package ICCC
|
|
|
|
|
2014-10-19 17:19:11 +00:00
|
|
|
import (
|
|
|
|
"container/list"
|
|
|
|
LM "github.com/SommerEngineering/Ocean/Log/Meta"
|
|
|
|
"gopkg.in/mgo.v2"
|
|
|
|
"sync"
|
|
|
|
)
|
2014-04-26 09:18:56 +00:00
|
|
|
|
|
|
|
const (
|
|
|
|
ChannelSYSTEM string = `System`
|
|
|
|
ChannelNUMGEN string = `System::NumGen`
|
|
|
|
ChannelSHUTDOWN string = `System::Shutdown`
|
|
|
|
ChannelSTARTUP string = `System::Startup`
|
|
|
|
ChannelICCC string = `System::ICCC`
|
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
|
|
senderName LM.Sender = `ICCC`
|
|
|
|
db *mgo.Database = nil
|
2014-06-04 19:41:18 +00:00
|
|
|
dbSession *mgo.Session = nil
|
2014-04-26 09:18:56 +00:00
|
|
|
collectionListener *mgo.Collection = nil
|
|
|
|
collectionHosts *mgo.Collection = nil
|
|
|
|
reservedSystemChannels []string = []string{ChannelSYSTEM, ChannelNUMGEN, ChannelSHUTDOWN, ChannelSTARTUP, ChannelICCC}
|
|
|
|
listeners map[string]func(data map[string][]string) = nil
|
|
|
|
listenersLock sync.RWMutex = sync.RWMutex{}
|
|
|
|
cacheListenerDatabase *list.List = nil
|
|
|
|
cacheListenerDatabaseLock sync.RWMutex = sync.RWMutex{}
|
2014-06-08 09:35:01 +00:00
|
|
|
startCacheTimerLock sync.Mutex = sync.Mutex{}
|
|
|
|
cacheTimerRunning bool = false
|
2014-04-26 09:18:56 +00:00
|
|
|
correctAddressWithPort string = ``
|
|
|
|
)
|