cursor

package
v0.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 22, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package cursor provides HMAC-signed opaque pagination cursors. Cursors encode a SKIP offset and are tamper-evident via HMAC-SHA256.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Sign

func Sign(skip int64, secret []byte) string

Sign encodes skip as an 8-byte big-endian value, appends a 32-byte HMAC-SHA256 over it, and returns the whole thing as a URL-safe base64 string.

func Verify

func Verify(encoded string, secret []byte) (int64, error)

Verify decodes and validates a cursor produced by Sign. Returns (0, nil) for an empty cursor (first page). Returns an error if the cursor is malformed or the HMAC is invalid.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL