Ocean/ICCC/Registrar.go
Thorsten Sommer f33f7b5c29 Refactoring, Bugfix & Updates
+ Refactored all imports
+ Fixed a bug for the logging regarding removing \n \t \r
+ Updated to current MGO release
+ Changed the name of ICCC
2014-10-19 19:19:11 +02:00

18 lines
561 B
Go

package ICCC
import (
"fmt"
"github.com/SommerEngineering/Ocean/Log"
LM "github.com/SommerEngineering/Ocean/Log/Meta"
)
func Registrar(channel, command string, callback func(data map[string][]string)) {
listenersLock.Lock()
defer listenersLock.Unlock()
register2Database(channel, command)
listeners[fmt.Sprintf(`%s::%s`, channel, command)] = callback
Log.LogShort(senderName, LM.CategorySYSTEM, LM.LevelINFO, LM.MessageNameCONFIGURATION, `The registrar has registered a new ICCC command.`, `channel=`+channel, `command=`+command)
}