Opaque cursor

A token the server returns for "the next page" that the client stores and sends back without interpreting it. Here it is base64url of "millis:id". Encoding is not signing: a client can still decode and change it, so it must never carry anything secret.

Minimal example

go
next := cursor.Encode(cursor.Key{ID: last.ID})
key, err := cursor.Decode(r.URL.Query().Get("cursor"))

Learn this concept

Lesson 2.9 · Keyset (cursor) pagination

Used in exercises

Exercise 2.10 · GET /v1/restaurants with a cursor Exercise 2.19 · Restaurant list integration suite Exercise 2.22 · GET /v1/restaurants: signed cursors Exercise 2.26 · GET /v1/restaurants: sort by distance
Prerequisite conceptsKeyset pagination