-
Notifications
You must be signed in to change notification settings - Fork 110
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
RSDK-9175: DataSync API Go SDK #4562
base: main
Are you sure you want to change the base?
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.
Looking good, but there are some comments on readability
opts ...grpc.CallOption) (datapb.DataSyncService_StreamingDataCaptureUploadClient, error) | ||
} | ||
|
||
// DataCaptureUpload uploads the contents and metadata for tabular data. |
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.
In the inject
folder, the comments of these fake functions tend to have the same/similar pattern:
i.e. // GetCurrentMonthUsage calls the injected GetCurrentMonthUsageFunc or the real version.
I'd follow the same thing here.
// BinaryOptions represents optional parameters for the BinaryDataCaptureUpload method. | ||
type BinaryOptions struct { | ||
Type DataType | ||
FileName string | ||
MethodParameters map[string]interface{} | ||
Tags []string | ||
DataRequestTimes [2]time.Time | ||
} |
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.
I'm not sure what the standard is in Go, but should these optional parameter structs sit all the way at the top with the shadow types? Personally, it makes it hard for me to read the code so I actually prefer it being right above the function(s) that's using it if there's only one or two. Maybe someone else disagrees?
partID string, | ||
data []byte, | ||
opts *FileUploadOptions, | ||
) (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.
I see that this is an upload function, but what is it actually returning? It's not clear what this string value is supposed to represent.
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.
Ah, I see now from the private function you're calling it's the file ID, but it should be made clear in the comment.
partID string, | ||
filePath string, | ||
opts *FileUploadOptions, | ||
) (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.
See above comment about what the return is.
This PR adds the DataSync API wrappers to the Go SDK