mirror of
https://github.com/FlipsideCrypto/flip-rpc-client-go.git
synced 2026-02-06 10:56:45 +00:00
make nullable fields pointers
This commit is contained in:
parent
0e75c23b13
commit
54b759a134
@ -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{
|
||||
|
||||
@ -2,16 +2,16 @@ 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"`
|
||||
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"`
|
||||
}
|
||||
|
||||
4
go.mod
4
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
|
||||
)
|
||||
|
||||
4
go.sum
4
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=
|
||||
|
||||
@ -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"`
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user