query

package
v0.0.0-...-78d125d Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package query provides support for query paging.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Result

type Result[T any] struct {
	Items       []T `json:"items"`
	Total       int `json:"total"`
	Page        int `json:"page"`
	RowsPerPage int `json:"rowsPerPage"`
}

Result is the data model used when returning a query result.

func NewResult

func NewResult[T any](items []T, total int, page page.Page) Result[T]

NewResult constructs a result value to return query results.

func (Result[T]) Encode

func (r Result[T]) Encode() ([]byte, string, error)

Encode implements the encoder interface.

Jump to

Keyboard shortcuts

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