-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement MarshalJSON for query results #114
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
@@ -16,18 +18,40 @@ const ( | |||
StringType | |||
) | |||
|
|||
var ( | |||
nullBytes = []byte("null") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to define this somewhere in a shared location?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm a bit overkill given this is only used in two places in two separate packages.
query/result_group.go
Outdated
@@ -5,15 +5,28 @@ import ( | |||
"github.com/xichen2020/eventdb/x/compare" | |||
) | |||
|
|||
type nullResultGruop struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo
query/result_group.go
Outdated
Values calculation.ResultArray `json:"values"` | ||
} | ||
|
||
type nullResultGruopsJSON struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
@@ -0,0 +1,114 @@ | |||
package query |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
file name typo
query/time_bucket_result.go
Outdated
} | ||
|
||
type timeBucketJSON struct { | ||
StartAt int64 `json:"startAt"` // In nanoseconds |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
startAtNanos?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure.
cc @notbdu @black-adder
This PR implements
MarshalJSON
for the various types of query results.Fixes #112