fixes #76, fixes #78, fixes #82, fixes #83

This commit is contained in:
Adnan Hajdarevic 2016-06-27 22:13:00 +02:00
parent 3bcf6d5e2b
commit 30baec91df
2 changed files with 59 additions and 69 deletions

View file

@ -412,23 +412,6 @@ func (h *Hooks) Match(id string) *Hook {
return nil
}
// MatchAll iterates through Hooks and returns all of the hooks that match the
// given ID, if no hook matches the given ID, nil is returned
func (h *Hooks) MatchAll(id string) []*Hook {
var matchedHooks []*Hook
for i := range *h {
if (*h)[i].ID == id {
matchedHooks = append(matchedHooks, &(*h)[i])
}
}
if len(matchedHooks) > 0 {
return matchedHooks
}
return nil
}
// Rules is a structure that contains one of the valid rule types
type Rules struct {
And *AndRule `json:"and,omitempty"`