Skip to content

How to use cursor pagination with this package?  #181

@jake-newsom

Description

@jake-newsom

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions