Documentation ¶
Overview ¶
Package resource contains code common to all resources (orgs, workspaces, runs, etc)
Index ¶
Constants ¶
View Source
const ( DefaultPageNumber = 1 DefaultPageSize = 20 MaxPageSize = 100 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Page ¶
type Page[T any] struct { Items []T *Pagination }
Page is a segment of a result set.
func NewPage ¶
NewPage constructs a page from a list of resources. If the list argument represents the full result set then count should be nil; if count is non-nil then the list is deemed to be a segment of a result set and count is the size of the full result set. This latter case is useful, say, if a database has already produced a segment of a full result set, e.g. using LIMIT and OFFSET.
type PageOptions ¶
type PageOptions struct { // The page number to request. The results vary based on the PageSize. PageNumber int `schema:"page[number],omitempty"` // The number of elements returned in a single page. PageSize int `schema:"page[size],omitempty"` }
PageOptions are used to request a specific page.
Click to show internal directories.
Click to hide internal directories.