response

package
v1.0.0-beta.226 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CursorMeta

type CursorMeta struct {
	Page CursorMetaPage `json:"page"`
}

CursorMeta Pagination metadata.

type CursorMetaPage

type CursorMetaPage struct {
	// First cursor
	First *string `json:"first,omitempty"`

	// Last cursor
	Last *string `json:"last,omitempty"`

	// Next URI to the next page
	Next nullable.Nullable[string] `json:"next"`

	// Previous URI to the previous page
	Previous nullable.Nullable[string] `json:"previous"`

	// Size of the requested page
	Size int `json:"size"`
}

CursorMetaPage defines model for CursorMetaPage.

type CursorPaginationResponse

type CursorPaginationResponse[T any] struct {
	// The data returned
	Data []T `json:"data"`

	Meta CursorMeta `json:"meta"`
}

CursorPaginationResponse represents the response structure for cursor-based pagination

func NewCursorPaginationResponse

func NewCursorPaginationResponse[T pagination.Item](items []T, pageSize int) CursorPaginationResponse[T]

NewCursorPaginationResponse creates a new pagination response from an ordered list of items. T must implement the Item interface for cursor generation.

type PageMeta

type PageMeta struct {
	Page PageMetaPage `json:"page"`
}

type PageMetaPage

type PageMetaPage struct {
	Size   int  `json:"size"`
	Number int  `json:"number"`
	Total  *int `json:"total,omitempty"`
}

type PagePaginationResponse

type PagePaginationResponse[T any] struct {
	Data []T      `json:"data"`
	Meta PageMeta `json:"meta"`
}

func NewPagePaginationResponse

func NewPagePaginationResponse[T any](items []T, page PageMetaPage) PagePaginationResponse[T]

Jump to

Keyboard shortcuts

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