Documentation
¶
Index ¶
- func Empty() *empty
- func EmptyFromRaw(raw []byte) (*empty, error)
- func Keyset[I comparable, V any](offset, pageSize int, sqlIdName common.FieldName, idGetter func(V) I) (*keyset[I, V], error)
- func KeysetFromRaw[I comparable](raw []byte, idFieldName PropertyName[I]) (*keyset[I, any], error)
- func KeysetWithField[I comparable](offset, pageSize int, sqlIdName common.FieldName, idFieldName PropertyName[I]) (*keyset[I, any], error)
- func KeysetWithId[I comparable, V id[I]](offset, pageSize int, sqlIdName common.FieldName) (*keyset[I, V], error)
- func NewDefaultInterpreter() *interpreter
- func NewPage[V any](results collections.Iterator[*V], pagination driver.Pagination) (*driver.PageIterator[*V], error)
- func None() *none
- func NoneFromRaw(raw []byte) (*none, error)
- func Offset(os, pageSize int) (*offset, error)
- func OffsetFromRaw(raw []byte) (*offset, error)
- type PropertyName
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Empty ¶
func Empty() *empty
Empty returns a pagination instance that will force a query an empty page
func EmptyFromRaw ¶
func Keyset ¶
func Keyset[I comparable, V any](offset, pageSize int, sqlIdName common.FieldName, idGetter func(V) I) (*keyset[I, V], error)
Keyset creates a keyset pagination
func KeysetFromRaw ¶
func KeysetFromRaw[I comparable](raw []byte, idFieldName PropertyName[I]) (*keyset[I, any], error)
KeysetFromRaw initializes a Keyset pagination struct from a buffer. It also needs to get the field name of the id in the struct returned by the database. This is used in a member function and is not serializable.
func KeysetWithField ¶
func KeysetWithField[I comparable](offset, pageSize int, sqlIdName common.FieldName, idFieldName PropertyName[I]) (*keyset[I, any], error)
KeysetWithField creates a keyset pagination where the id has field name idFieldName
func KeysetWithId ¶
func KeysetWithId[I comparable, V id[I]](offset, pageSize int, sqlIdName common.FieldName) (*keyset[I, V], error)
KeysetWithId creates a keyset pagination where the result object implements id[I]
func NewDefaultInterpreter ¶
func NewDefaultInterpreter() *interpreter
func NewPage ¶
func NewPage[V any](results collections.Iterator[*V], pagination driver.Pagination) (*driver.PageIterator[*V], error)
NewPage creates a new page where the id is a string
func None ¶
func None() *none
None returns a pagination instance that will force a query to return everything in one shot
func NoneFromRaw ¶
func OffsetFromRaw ¶
Types ¶
type PropertyName ¶
type PropertyName[V comparable] string
PropertyName is the name of the field in the struct that is returned from the database V is the type of the field
func (PropertyName[V]) ExtractField ¶
func (p PropertyName[V]) ExtractField(v any) V
ExtractField extracts the field from the given value