Example #1
0
func (n *NEMetadataMatcher) Match(v interface{}) bool {
	if !common.CrossTypeEqual(v, n.value) {
		return true
	}

	return false
}
Example #2
0
func (w *WithinMetadataMatcher) Match(v interface{}) bool {
	for _, el := range w.List {
		if common.CrossTypeEqual(v, el) {
			return true
		}
	}

	return false
}
Example #3
0
func (e *graphElement) MatchMetadata(f Metadata) bool {
	for k, v := range f {
		switch v.(type) {
		case MetadataMatcher:
			nv, ok := e.metadata[k]
			matcher := v.(MetadataMatcher)
			if !ok || !matcher.Match(nv) {
				return false
			}
		default:
			nv, ok := e.metadata[k]
			if !ok || !common.CrossTypeEqual(nv, v) {
				return false
			}
		}
	}

	return true
}