Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LimitPerRow ¶
func LimitPerRow(ctx context.Context, partitionBy string, limit int, first, last *int, orderBy ...sql.Querier) func(s *sql.Selector)
LimitPerRow returns a query modifier that limits the number of (edges) rows returned by the given partition and pagination. This helper function is used mainly by the paginated API to override the default Limit behavior for limit returned per node and not limit for all query.
func WithSimplePagination ¶
func WithSimplePagination(ctx context.Context, sp *SimplePagination) context.Context
WithSimplePagination returns a new context with the given SimplePagination.
Types ¶
type SimplePagination ¶
SimplePagination is a simple pagination implementation.
func NewSimplePagination ¶
func NewSimplePagination(p, c string) (sp *SimplePagination, err error)
NewSimplePagination creates a new SimplePagination from the given page and count. If both are empty, it returns nil.
func SimplePaginationFromContext ¶
func SimplePaginationFromContext(ctx context.Context) (*SimplePagination, bool)
SimplePaginationFromContext returns the SimplePagination from the given context.
Click to show internal directories.
Click to hide internal directories.