Пример #1
0
// MatchesAll returns true if the TagSet satisfies the entire matcher
func (m *Matcher) MatchesAll(t *event.TagSet) (matches bool) {
	matches = true
	m.ForEach(func(k string, v *regexp.Regexp) {
		if !v.MatchString(t.Get(k)) {
			matches = false
		}
	})
	return

}
Пример #2
0
// MatchesOne returns true if the matcher matches at least one item in the TagSet
func (m Matcher) MatchesOne(t *event.TagSet) (matches bool) {
	m.ForEach(func(k string, v *regexp.Regexp) {
		if v.MatchString(t.Get(k)) {
			matches = true
			return
		}
	})

	return
}