-
Notifications
You must be signed in to change notification settings - Fork 68
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
Go: Implement Time Command #2963
base: main
Are you sure you want to change the base?
Go: Implement Time Command #2963
Conversation
Signed-off-by: Niharika Bhavaraju <[email protected]>
Signed-off-by: Niharika Bhavaraju <[email protected]>
Signed-off-by: Niharika Bhavaraju <[email protected]>
@Yury-Fridlyand I have added Time for cluster (2x) can you please review. |
if err := checkResponseType(res, C.Map, true); err == nil { | ||
|
||
// Multi-node response | ||
mapData, err := handleRawStringArrayMapResponse(res) | ||
if err != nil { | ||
return ClusterValue[[]string]{ | ||
value: Result[[]string]{isNil: true}, | ||
}, err | ||
} | ||
var times []string | ||
for _, nodeTimes := range mapData { | ||
times = append(times, nodeTimes...) | ||
} | ||
return CreateClusterMultiValue(times), nil | ||
} | ||
|
||
// Single node response | ||
data, err := handleRawStringArrayResponse(res) | ||
if err != nil { | ||
return ClusterValue[[]string]{ | ||
value: Result[[]string]{isNil: true}, | ||
}, err | ||
} | ||
return CreateClusterSingleValue(data), nil |
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.
Shouldn't be that code be in response handlers?
return ClusterValue[[]string]{ | ||
value: Result[[]string]{isNil: true}, | ||
}, err |
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.
Please use CreateEmptyClusterValue()
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.
// | ||
// [valkey.io]: https://valkey.io/commands/#server | ||
type ServerManagementClusterCommands interface { | ||
Time(route route) (ClusterValue[[]string], error) |
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.
This should be TimeWithRoute
or TimeWithOptions
, I prefer TimeWithOptions
, see discussion in #2979 (review)
Go: Implement Time Command