Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultFilterColumnKey = "" DefaultFilterColumnValue = "" )
View Source
const (
// DefaultLimit is the default number of items per page.
DefaultLimit = 20
)
Variables ¶
This section is empty.
Functions ¶
func GetCursorFromRequest ¶
GetCursorFromRequest returns current cursor.
func GetLimitFromRequest ¶
GetLimitFromRequest returns current limit.
Types ¶
type CursorPaginator ¶
type CursorPaginator struct { Cursor interface{} `json:"-"` PreviousURI null.String `json:"-"` // contains filtered or unexported fields }
CursorPaginator is the paginator with cursor pagination system.
func NewCursorPaginator ¶
func NewCursorPaginator(store Store, request Request, options *Options) (*CursorPaginator, error)
NewCursorPaginator returns a new CursorPaginator instance.
func (*CursorPaginator) HasNext ¶
func (c *CursorPaginator) HasNext() bool
HasNext returns true if has next page.
func (*CursorPaginator) MakeNextToken ¶
func (p *CursorPaginator) MakeNextToken() null.String
MakeNextToken returns the next page Token.
func (*CursorPaginator) Next ¶
func (p *CursorPaginator) Next() (Paginator, error)
Next returns next items
func (*CursorPaginator) Page ¶
func (p *CursorPaginator) Page() error
Page searches and returns the items
type GOPGStore ¶
type GOPGStore struct {
// contains filtered or unexported fields
}
GORMStore is the store for GOPG ORM.
func NewGOPGStore ¶
NewGOPGStore returns a new go-pg store instance.
type Options ¶ added in v0.1.2
type Options struct { // FilterColumnKey is the name of column that is used for extra WHERE clause FilterColumnKey string // FilterColumnValue is the value of column that is used for extra WHERE clause FilterColumnValue string // Filter turn true to apply extra WHERE clause Filter bool }
Options are paginator options
Click to show internal directories.
Click to hide internal directories.