pagination

package
v0.0.0-...-c2974c5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 12, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseOrderField

type BaseOrderField struct {
	FieldName string
	FieldAsc  bool
}

func (*BaseOrderField) Asc

func (b *BaseOrderField) Asc() bool

func (*BaseOrderField) Name

func (b *BaseOrderField) Name() string

func (*BaseOrderField) Reverse

func (b *BaseOrderField) Reverse() *BaseOrderField

type Cursor

type Cursor struct {
	Fields []CursorField
}

func CursorB64Decode

func CursorB64Decode(encoded string) *Cursor

func (*Cursor) AddField

func (c *Cursor) AddField(name string, value string)

func (*Cursor) B64Encode

func (c *Cursor) B64Encode() string

type CursorField

type CursorField struct {
	Name  string
	Value string
}

type Filter

type Filter struct {
	Fields []FilterField
}

func (*Filter) AddFilterField

func (f *Filter) AddFilterField(name string, operator FilterOperator, value string)

type FilterField

type FilterField struct {
	Name     string
	Operator FilterOperator
	Value    string
}

type FilterOperator

type FilterOperator string
const (
	FilterOperatorEq       FilterOperator = "eq"
	FilterOperatorNeq      FilterOperator = "neq"
	FilterOperatorGt       FilterOperator = "gt"
	FilterOperatorGte      FilterOperator = "gte"
	FilterOperatorLt       FilterOperator = "lt"
	FilterOperatorLte      FilterOperator = "lte"
	FilterOperatorContains FilterOperator = "contains"
)

type Order

type Order struct {
	Fields []OrderField
}

func (*Order) AddField

func (o *Order) AddField(field OrderField)

func (*Order) DecodeCursor

func (o *Order) DecodeCursor(encoded string) *Cursor

func (*Order) EncodeCursor

func (o *Order) EncodeCursor(i interface{}) string

func (*Order) Reverse

func (o *Order) Reverse() *Order

type OrderField

type OrderField interface {
	Name() string
	Asc() bool
	Reverse() OrderField
	GetValue(object interface{}) string
}

type Paginator

type Paginator struct {
	Order  *Order
	Filter *Filter
}

func (*Paginator) ContributeCursorStringToFilter

func (p *Paginator) ContributeCursorStringToFilter(cursorString *string, isAfter bool) error

func (*Paginator) ContributeCursorToFilter

func (p *Paginator) ContributeCursorToFilter(cursor *Cursor, isAfter bool)

func (*Paginator) DecodeCursor

func (p *Paginator) DecodeCursor(encoded string) *Cursor

func (*Paginator) EncodeCursor

func (p *Paginator) EncodeCursor(i interface{}) string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL