Add custom event handling

This commit is contained in:
gizak
2015-10-13 12:45:03 -04:00
parent 86950762b0
commit 2e6591a15e
5 changed files with 34 additions and 0 deletions

View File

@@ -315,3 +315,13 @@ func NewTimerCh(du time.Duration) chan Event {
var DefualtHandler = func(e Event) {
}
var usrEvtCh = make(chan Event)
func SendCustomEvt(path string, data interface{}) {
e := Event{}
e.Path = path
e.Data = data
e.Time = time.Now().Unix()
usrEvtCh <- e
}