Gitility.Page (Gitility v0.4.0)

Copy Markdown View Source

One page of a potentially large result.

Every collection that can grow returns a page rather than an unbounded list. truncated says whether a limit stopped the page short of the full result; next_cursor (when non-nil) continues from exactly where this page stopped.

Cursors are opaque, URL-safe binaries carrying a versioned, checksummed continuation state — the snapshot commit, the operation and its normalized options, and the traversal position. They contain no secrets and need no server-side session, but they are validated strictly on the way back in: a cursor replayed against a different snapshot, operation, or option set returns {:error, %Gitility.Error{code: :invalid_cursor}}.

Summary

Types

An opaque, URL-safe continuation token.

t()

A structured warning attached to a successful result. Truncated pages use %{code: :truncated, message: "page truncated by <limit>"}.

Types

cursor()

@type cursor() :: binary()

An opaque, URL-safe continuation token.

t()

@type t() :: t(term())

t(item)

@type t(item) :: %Gitility.Page{
  items: [item],
  next_cursor: cursor() | nil,
  stats: Gitility.Stats.t(),
  truncated: boolean(),
  warnings: [warning()]
}

warning()

@type warning() :: %{
  code: :truncated | :binary_skipped | :oversize_skipped | :malformed_ref,
  message: String.t()
}

A structured warning attached to a successful result. Truncated pages use %{code: :truncated, message: "page truncated by <limit>"}.