Merge pull request #98 from MrWaggel/patch-1

Added a EvtStream member function ResetHandlers()
This commit is contained in:
Zack Guo 2016-10-23 22:17:13 -04:00 committed by GitHub
commit a7e3aeef4c
1 changed files with 7 additions and 0 deletions

View File

@ -221,6 +221,13 @@ func findMatch(mux map[string]func(Event), path string) string {
return pattern
}
// Remove all existing defined Handlers from the map
func (es *EvtStream) ResetHandlers() {
for Path, _ := range es.Handlers {
delete(es.Handlers, Path)
}
return
}
func (es *EvtStream) match(path string) string {
return findMatch(es.Handlers, path)