Merge pull request #6 from FlipsideCrypto/omit_empty_fields

omit empty fields in json tags for filter and condition
This commit is contained in:
Don Cote 2020-08-10 16:34:39 -04:00 committed by GitHub
commit e9d12e9ab4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 20 deletions

View File

@ -2,18 +2,18 @@ package dynamicquery
// Filter --
type Filter struct {
In In `json:"in"`
NotIn NotIn `json:"not_in"`
InSegment InSegment `json:"in_segment"`
NotInSegment NotInSegment `json:"not_in_segment"`
Gte Gte `json:"gte"`
Lte Lte `json:"lte"`
Gt Gt `json:"gt"`
Eq Eq `json:"eq"`
NotEq NotEq `json:"not_eq"`
Lt Lt `json:"lt"`
And []*Filter `json:"and"`
Or []*Filter `json:"or"`
In In `json:"in,omitempty"`
NotIn NotIn `json:"not_in,omitempty"`
InSegment InSegment `json:"in_segment,omitempty"`
NotInSegment NotInSegment `json:"not_in_segment,omitempty"`
Gte Gte `json:"gte,omitempty"`
Lte Lte `json:"lte,omitempty"`
Gt Gt `json:"gt,omitempty"`
Eq Eq `json:"eq,omitempty"`
NotEq NotEq `json:"not_eq,omitempty"`
Lt Lt `json:"lt,omitempty"`
And []*Filter `json:"and,omitempty"`
Or []*Filter `json:"or,omitempty"`
}
// Eq equal to filter

View File

@ -26,12 +26,12 @@ type Gt struct {
// Condition is set of logic
type Condition struct {
PartitionID string `json:"partition_id"`
Value float64 `json:"value"`
Or []*Condition `json:"or"`
And []*Condition `json:"and"`
Gt Gt `json:"gt"`
Gte Gte `json:"gte"`
Lt Lt `json:"lt"`
Lte Lte `json:"lte"`
PartitionID string `json:"partition_id,omitempty"`
Value float64 `json:"value,omitempty"`
Or []*Condition `json:"or,omitempty"`
And []*Condition `json:"and,omitempty"`
Gt Gt `json:"gt,omitempty"`
Gte Gte `json:"gte,omitempty"`
Lt Lt `json:"lt,omitempty"`
Lte Lte `json:"lte,omitempty"`
}