Documentation ¶
Index ¶
- Constants
- func Slice[T any](slice []T, p *Pagination) []T
- type Connection
- func EmptyConnection[T any]() *Connection[T]
- func NewConnection[T any, I Integer](nodes []T, page *Pagination, total I) *Connection[T]
- func NewConnectionWithoutPagination[T any](nodes []T) *Connection[T]
- func NewConvertConnection[T any, F any, I Integer](nodes []T, page *Pagination, total I, fn func(from T) F) *Connection[F]
- func NewConvertConnectionWithError[T any, F any, I Integer](nodes []T, page *Pagination, total I, fn func(from T) (F, error)) (*Connection[F], error)
- type Cursor
- type Edge
- type Integer
- type PageInfo
- type Pagination
Constants ¶
View Source
const DefaultPageSize = 20
Variables ¶
This section is empty.
Functions ¶
func Slice ¶
func Slice[T any](slice []T, p *Pagination) []T
Types ¶
type Connection ¶
type Connection[T any] struct { Edges []Edge[T] `json:"edges"` PageInfo PageInfo `json:"pageInfo"` }
func EmptyConnection ¶
func EmptyConnection[T any]() *Connection[T]
func NewConnection ¶
func NewConnection[T any, I Integer](nodes []T, page *Pagination, total I) *Connection[T]
func NewConnectionWithoutPagination ¶
func NewConnectionWithoutPagination[T any](nodes []T) *Connection[T]
func NewConvertConnection ¶
func NewConvertConnection[T any, F any, I Integer](nodes []T, page *Pagination, total I, fn func(from T) F) *Connection[F]
func NewConvertConnectionWithError ¶
func NewConvertConnectionWithError[T any, F any, I Integer](nodes []T, page *Pagination, total I, fn func(from T) (F, error)) (*Connection[F], error)
func (*Connection[T]) Nodes ¶
func (c *Connection[T]) Nodes() []T
type Cursor ¶
type Cursor struct { Offset int `json:"offset"` // contains filtered or unexported fields }
func (Cursor) MarshalGQLContext ¶
type PageInfo ¶
type Pagination ¶
type Pagination struct {
// contains filtered or unexported fields
}
func (*Pagination) Limit ¶
func (p *Pagination) Limit() int32
func (*Pagination) Offset ¶
func (p *Pagination) Offset() int32
Click to show internal directories.
Click to hide internal directories.