Skip to content
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

Civo: Some paginated functions don't "paginate" #19

Open
patrickdappollonio opened this issue Sep 24, 2024 · 0 comments
Open

Civo: Some paginated functions don't "paginate" #19

patrickdappollonio opened this issue Sep 24, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@patrickdappollonio
Copy link
Member

It seems that some API endpoints that expect pagination don't take it in as pagination.

For example, /v2/objectstores expects a page and perPage params. However the SDK does not support passing it, the ListObjectStores() receives no arguments, essentially grabbing page 1 only.

https://github.com/civo/civogo/blob/v0.3.79/objectstore.go#L58-L71

Compare that function to ListObjectStoreCredentials that does take a page and perPage:

https://github.com/civo/civogo/blob/v0.3.79/objectstore_credential.go#L46-L64

I naively thought they were using some sort of magic when setting the Page value of the returned output (since it was a pointer) but realized that couldn't have worked if it would've got a copy of the pointer instead.

It's possible to use civogo's SendXXXRequest() functions and craft our own URLs:

https://pkg.go.dev/github.com/civo/civogo#Client.SendGetRequest
https://pkg.go.dev/github.com/civo/civogo#Client.SendPostRequest

@patrickdappollonio patrickdappollonio added the bug Something isn't working label Sep 24, 2024
@patrickdappollonio patrickdappollonio self-assigned this Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant