diff --git a/client_test.go b/client_test.go index 5c99fac..7b96f46 100644 --- a/client_test.go +++ b/client_test.go @@ -15,7 +15,7 @@ func makeCondition() segment.Condition { Value: 100000000, } c := segment.Condition{ - Gte: gte, + Gte: >e, } return c } @@ -44,7 +44,7 @@ func makeQuery(condition segment.Condition) dynamicquery.Query { Value: "large_balance_holder", } filter := dynamicquery.Filter{ - InSegment: inSegment, + InSegment: &inSegment, } query := dynamicquery.Query{ diff --git a/dynamicquery/filter.go b/dynamicquery/filter.go index 3602f52..1146180 100644 --- a/dynamicquery/filter.go +++ b/dynamicquery/filter.go @@ -2,18 +2,18 @@ package dynamicquery // Filter -- type Filter struct { - 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"` + 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 diff --git a/go.mod b/go.mod index 74358b1..95d70bb 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,6 @@ module github.com/FlipsideCrypto/flip-rpc-client-go go 1.12 require ( - github.com/mitchellh/mapstructure v1.3.1 - github.com/pkg/errors v0.8.1 + github.com/mitchellh/mapstructure v1.3.3 + github.com/pkg/errors v0.9.1 ) diff --git a/go.sum b/go.sum index 9e0ae29..08e231b 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,8 @@ github.com/mitchellh/mapstructure v1.3.1 h1:cCBH2gTD2K0OtLlv/Y5H01VQCqmlDxz30kS5Y5bqfLA= github.com/mitchellh/mapstructure v1.3.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.3.3 h1:SzB1nHZ2Xi+17FP0zVQBHIZqvwRN9408fJO8h+eeNA8= +github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= diff --git a/segment/condition.go b/segment/condition.go index d236333..14c03e3 100644 --- a/segment/condition.go +++ b/segment/condition.go @@ -26,12 +26,12 @@ type Gt struct { // Condition is set of logic type Condition struct { - PartitionID string `json:"partition_id,omitempty"` - Value float64 `json:"value,omitempty"` + 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"` + Gt *Gt `json:"gt,omitempty"` + Gte *Gte `json:"gte,omitempty"` + Lt *Lt `json:"lt,omitempty"` + Lte *Lte `json:"lte,omitempty"` }