Documentation
¶
Index ¶
- func Empty() *empty
- func EmptyFromRaw(raw []byte) (*empty, error)
- func Keyset[I comparable, V any](offset int, 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 int, pageSize int, sqlIdName common.FieldName, ...) (*keyset[I, any], error)
- func KeysetWithId[I comparable, V id[I]](offset int, 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 int, 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 ¶ added in v0.6.0
func Keyset ¶ added in v0.6.0
func Keyset[I comparable, V any](offset int, pageSize int, sqlIdName common.FieldName, idGetter func(V) I) (*keyset[I, V], error)
Keyset creates a keyset pagination
func KeysetFromRaw ¶ added in v0.6.0
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 ¶ added in v0.6.0
func KeysetWithField[I comparable](offset int, 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 ¶ added in v0.6.0
func KeysetWithId[I comparable, V id[I]](offset int, 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 ¶ added in v0.6.0
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 ¶ added in v0.6.0
func OffsetFromRaw ¶ added in v0.6.0
Types ¶
type PropertyName ¶ added in v0.6.0
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 ¶ added in v0.6.0
func (p PropertyName[V]) ExtractField(v any) V
ExtractField extracts the field from the given value