pager

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2018 License: Apache-2.0, Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IndexPager

type IndexPager struct {
	*Pager
	// contains filtered or unexported fields
}

func FromIndexer

func FromIndexer(indexer PageableIndexer, indexName, indexKey string) *IndexPager

func (*IndexPager) Limit

func (p *IndexPager) Limit(params PagingParams) ([]interface{}, error)

type PageableIndexer

type PageableIndexer interface {
	ByIndex(indexName, indexKey string) ([]interface{}, error)
	IndexKeys(indexName, indexKey string) ([]string, error)
	GetByKey(key string) (item interface{}, exists bool, err error)
}

type PageableStore

type PageableStore interface {
	GetByKey(key string) (item interface{}, exists bool, err error)
	List() []interface{}
	ListKeys() []string
}

type Pager

type Pager struct {
	// contains filtered or unexported fields
}

func From

func From(store PageableStore) *Pager

func (*Pager) Limit

func (p *Pager) Limit(params PagingParams) ([]interface{}, error)

type PagingParams

type PagingParams struct {
	First  *int
	Offset *int
}

Directories

Path Synopsis
Code generated by mockery v1.0.0 Code generated by mockery v1.0.0
Code generated by mockery v1.0.0 Code generated by mockery v1.0.0

Jump to

Keyboard shortcuts

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