Exemple #1
0
func (b *BetweenMetadataMatcher) Match(v interface{}) bool {
	result, err := common.CrossTypeCompare(v, b.from)
	result2, err2 := common.CrossTypeCompare(v, b.to)

	if err == nil && err2 == nil && result >= 0 && result2 == -1 {
		return true
	}

	return false
}
Exemple #2
0
func (i *OutsideMetadataMatcher) Match(v interface{}) bool {
	result, err := common.CrossTypeCompare(v, i.from)
	result2, err2 := common.CrossTypeCompare(v, i.to)

	if err == nil && err2 == nil && result == -1 && result2 == 1 {
		return true
	}

	return false
}
Exemple #3
0
func (gte *GTEMetadataMatcher) Match(v interface{}) bool {
	if result, err := common.CrossTypeCompare(v, gte.value); err == nil && result >= 0 {
		return true
	}

	return false
}
Exemple #4
0
func (lt *LTMetadataMatcher) Match(v interface{}) bool {
	if result, err := common.CrossTypeCompare(v, lt.value); err == nil && result == -1 {
		return true
	}

	return false
}