esp

package
v0.0.0-...-20ca37a Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: GPL-3.0 Imports: 7 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	IdCursorType    = (*IdCursor)(nil)
	ScoreCursorType = (*ScoreCursor)(nil)
)

Functions

This section is empty.

Types

type EsCursor

type EsCursor interface {
	MakeSortOptions(backward bool) ([]types.SortCombinations, []types.FieldValue, error)
}

type EsPaginator

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

func NewEsPaginator

func NewEsPaginator(store pagination.Store, opts *pagination.PaginationOptions) *EsPaginator

func (*EsPaginator) MakeSortOptions

func (p *EsPaginator) MakeSortOptions(ctx context.Context) ([]types.SortCombinations, []types.FieldValue, error)

MakeSortOptions 生成ID分页查询选项

func (*EsPaginator) StoreCursor

func (p *EsPaginator) StoreCursor(ctx context.Context, first, last any) error

func (*EsPaginator) StoreStringCursor

func (p *EsPaginator) StoreStringCursor(ctx context.Context, first, last any) error

type IdCursor

type IdCursor struct {
	ID string `json:"_id"`
}

func (*IdCursor) MakeSortOptions

func (s *IdCursor) MakeSortOptions(backward bool) ([]types.SortCombinations, []types.FieldValue, error)

type ScoreCursor

type ScoreCursor struct {
	Score_ float64 `json:"_score"`
	ID     string  `json:"_id"`
}

func (*ScoreCursor) MakeSortOptions

func (s *ScoreCursor) MakeSortOptions(backward bool) ([]types.SortCombinations, []types.FieldValue, error)

Jump to

Keyboard shortcuts

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