-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
18 changed files
with
179 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package jsonpath | ||
|
||
type syntaxBasicAnyValueTypeValidator struct { | ||
} | ||
|
||
func (c *syntaxBasicAnyValueTypeValidator) validate(values []interface{}) bool { | ||
var foundValue bool | ||
for index := range values { | ||
if values[index] != emptyEntity { | ||
foundValue = true | ||
} | ||
} | ||
return foundValue | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package jsonpath | ||
|
||
type syntaxBasicBoolTypeValidator struct { | ||
} | ||
|
||
func (c *syntaxBasicBoolTypeValidator) validate(values []interface{}) bool { | ||
var foundValue bool | ||
for index := range values { | ||
switch values[index].(type) { | ||
case bool: | ||
foundValue = true | ||
case struct{}: | ||
default: | ||
values[index] = emptyEntity | ||
} | ||
} | ||
return foundValue | ||
} |
6 changes: 3 additions & 3 deletions
6
syntax_basic_comparator_string.go → syntax_basic_type_validator_nil.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package jsonpath | ||
|
||
type syntaxBasicStringTypeValidator struct { | ||
} | ||
|
||
func (c *syntaxBasicStringTypeValidator) validate(values []interface{}) bool { | ||
var foundValue bool | ||
for index := range values { | ||
switch values[index].(type) { | ||
case string: | ||
foundValue = true | ||
case struct{}: | ||
default: | ||
values[index] = emptyEntity | ||
} | ||
} | ||
return foundValue | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package jsonpath | ||
|
||
type syntaxTypeValidator interface { | ||
validate(values []interface{}) bool | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package jsonpath | ||
|
||
type syntaxCompareDirectEQ struct { | ||
syntaxTypeValidator | ||
} | ||
|
||
func (c *syntaxCompareDirectEQ) comparator(left []interface{}, right interface{}) bool { | ||
var hasValue bool | ||
for leftIndex := range left { | ||
if left[leftIndex] == right { | ||
hasValue = true | ||
} else { | ||
left[leftIndex] = emptyEntity | ||
} | ||
} | ||
return hasValue | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.