Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Argument ¶
type Argument func(*arguments) error
type Connection ¶
type Connection[T any] struct { // contains filtered or unexported fields }
Connection is a generic connection type that is used to paginate results.
func New ¶
func New[T any](nodes []T, cursor func(T) string, args ...Argument) (Connection[T], error)
New creates a new Pages object. The pages object is used to paginate
func (*Connection[T]) Edges ¶
func (p *Connection[T]) Edges() []Edge[T]
Edges returns the edges for the connection.
func (*Connection[T]) PageInfo ¶
func (p *Connection[T]) PageInfo() PageInfo
PageInfo returns the page info for the connection.
type Edge ¶
type Edge[T any] struct { // contains filtered or unexported fields }
Edge is a generic type that is used to define the edges for a connection in at paginated result. The Edge interface is used to define the the cursor that is used to paginate the nodes and the node itself.
type PageInfo ¶ added in v1.0.4
type PageInfo struct {
// contains filtered or unexported fields
}
func (*PageInfo) HasNextPage ¶ added in v1.0.4
HasNextPage returns true if there is a next page.
func (*PageInfo) HasPreviousPage ¶ added in v1.0.4
HasPreviousPage returns true if there is a previous page.
func (*PageInfo) StartCursor ¶ added in v1.0.4
StartCursor returns the start cursor for the connection.
Click to show internal directories.
Click to hide internal directories.