Add boolean function condition support (#7027)

This commit is contained in:
Harshavardhana
2018-12-28 12:18:58 -08:00
committed by GitHub
parent 1898961ce3
commit 2a0e4b6f58
16 changed files with 364 additions and 295 deletions

View File

@@ -34,23 +34,27 @@ const (
ipAddress = "IpAddress"
notIPAddress = "NotIpAddress"
null = "Null"
boolean = "Bool"
)
var supportedConditions = []name{
stringEquals,
stringNotEquals,
stringEqualsIgnoreCase,
stringNotEqualsIgnoreCase,
binaryEquals,
stringLike,
stringNotLike,
ipAddress,
notIPAddress,
null,
boolean,
// Add new conditions here.
}
// IsValid - checks if name is valid or not.
func (n name) IsValid() bool {
for _, supn := range []name{
stringEquals,
stringNotEquals,
stringEqualsIgnoreCase,
stringNotEqualsIgnoreCase,
binaryEquals,
stringLike,
stringNotLike,
ipAddress,
notIPAddress,
null,
// Add new conditions here.
} {
for _, supn := range supportedConditions {
if n == supn {
return true
}