-
Notifications
You must be signed in to change notification settings - Fork 812
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 ListDomain API #879
Implement ListDomain API #879
Conversation
return nil, wh.error(errRequestNotSet, scope) | ||
} | ||
|
||
pageSize := 100 |
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.
care to make this configurable? in the service.go file
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 would suggest not to use config file for this number unless you really need it.
- User can always pass in a pageSize in the API. That would be the most use cases.
- It is not necessary that we have to use different default page size in different environment(staging/sjc/dca/autobots/public repo/etc)
- Having config will add more code and more configs, which would introduce lots of unnecessary code/config(staging/sjc/dca/autobots/public repo/etc).
- If having it in config, we still need to verify if the config value is set or not. If not, do you want to exit the process? Or use a another default value from code? Both look unnecessary.
I am trying to understand why you want this. If this hardcoding number bothers you, I think we can use a constant number defined on the top of the file or somewhere else.
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.
if you take a look at the service.go file or at least the top of the file you are changing, you can see a lot of const, which makes it easy to manage.
defining a arbitrary number everywhere in the code is not a good practice.
@@ -802,8 +802,18 @@ struct RegisterDomainRequest { | |||
80: optional map<string,string> data | |||
} | |||
|
|||
struct ListDomainRequest { | |||
10: optional i32 pageSize | |||
20: optional string nextPageToken |
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.
Can you binary blob for nextPageToken.
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.
Done
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.
Can you also include an integration test for list domain?
No description provided.