-
Notifications
You must be signed in to change notification settings - Fork 14
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
client: generic list #59
Conversation
zones.go
Outdated
} | ||
|
||
if count >= zones.Count { | ||
break |
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.
Risky! Between pagination call the count can increase or decrease. You're best bet is to stop paginating when the page result is empty.
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.
don't trust Count
and paginate until a failure occurs?
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 the result size is smaller than the page size we abort.
Signed-off-by: Yoan Blanc <yoan.blanc@exoscale.ch>
Signed-off-by: Yoan Blanc <yoan.blanc@exoscale.ch>
Signed-off-by: Yoan Blanc <yoan.blanc@exoscale.ch>
Signed-off-by: Yoan Blanc <yoan.blanc@exoscale.ch>
Signed-off-by: Yoan Blanc <yoan.blanc@exoscale.ch>
Signed-off-by: Yoan Blanc <yoan.blanc@exoscale.ch>
Signed-off-by: Yoan Blanc <yoan.blanc@exoscale.ch>
In a nutshell
other calls:
ListWithContext(ctx, vm) ([]interface{}, error)
AsyncList(vm) (<-chan interface{}, <-chan error)
AsyncListWithContext(ctx, vm) (<-chan interface{}, <-chan error)
TODO:
ListNics
GetRootVolumeForVirtualMachine