ormlist

package
v1.0.0-alpha.5 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package ormlist defines options for listing items from ORM indexes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CursorT

type CursorT []byte

CursorT defines a cursor type.

type Option

type Option = listinternal.Option

Option represents a list option.

func Cursor

func Cursor(cursor CursorT) Option

Cursor specifies a cursor after which to restart iteration. Cursor values are returned by iterators and in pagination results.

func End

func End(values ...interface{}) Option

End defines the values to use to end range iteration. It cannot be combined with Prefix.

Values must correspond in type to the index's fields and the number of values provided cannot exceed the number of fields in the index, although fewer values can be provided.

Range iteration can only be done for start and end values which are well-ordered, meaning that any unordered components must be equal. Ex. the bytes type is considered unordered, so a range iterator is created over an index with a bytes field, both start and end must have the same value for bytes.

func Prefix

func Prefix(values ...interface{}) Option

Prefix defines values to use for prefix iteration. It cannot be used together with Start or End.

Values must correspond in type to the index's fields and the number of values provided cannot exceed the number of fields in the index, although fewer values can be provided.

func Reverse

func Reverse() Option

Reverse reverses the direction of iteration. If Reverse is provided twice, iteration will happen in the forward direction.

func Start

func Start(values ...interface{}) Option

Start defines the values to use to start range iteration. It cannot be combined with Prefix.

Values must correspond in type to the index's fields and the number of values provided cannot exceed the number of fields in the index, although fewer values can be provided.

Range iteration can only be done for start and end values which are well-ordered, meaning that any unordered components must be equal. Ex. the bytes type is considered unordered, so a range iterator is created over an index with a bytes field, both start and end must have the same value for bytes.

Jump to

Keyboard shortcuts

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