1234567891011121314151617181920212223242526272829 |
- package util
- var msgHandler map[string](chan interface{})
- func GetMsgHandler(msgPipe string) chan interface{} {
- hdr, has := msgHandler[msgPipe]
- if !has {
- hdr = make(chan interface{})
- msgHandler[msgPipe] = hdr
- }
- return hdr
- }
- func PostMessage(msgPipe string, msg interface{}) {
- hdr, has := msgHandler[msgPipe]
- if !has {
- hdr = make(chan interface{})
- msgHandler[msgPipe] = hdr
- }
- hdr <- msg
- }
- func init() {
- msgHandler = make(map[string]chan interface{})
- }
- func DebugLevel() int {
- return 1
- }
|