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

How to use cursor pagination with this package? #181

Open
jake-newsom opened this issue Feb 3, 2023 · 0 comments
Open

How to use cursor pagination with this package? #181

jake-newsom opened this issue Feb 3, 2023 · 0 comments
Labels
question Further information is requested

Comments

@jake-newsom
Copy link

I don't know if I'm missing something or what but it seems like a major pain to do make requests to get invoices.

There's no way to use an offset other than using the cursor method, however the parameters struct doesn't include any cursor parameter and what gets returned from the request's .Next() property is a full string, but I also don't see any method to make a request by providing the endpoint directly?

I tried doing something like

client, err := client()
if err != nil {
	return []recurly.Invoice{}, "", nil
}

var response map[string]interface{}
var emptyBody interface{}
var emptyParams recurly.QueryParams
var emptyReqOptions recurly.OptionsApplier
client.Call(nil, "GET", cursorPath, emptyBody, emptyParams, emptyReqOptions, &response)

but that results in a runtime error: invalid memory address or nil pointer dereference

My only option right now is to build an API request completely from scratch which requires me to now add a new env variable for our recurly subdomain and add the headers completely from scratch. Feels like overkill and like I'm doing something wrong?

@jake-newsom jake-newsom added the question Further information is requested label Feb 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant