sort

package
v1.0.0-beta.36 Latest Latest
Warning

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

Go to latest
Published: May 8, 2023 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Expr

type Expr []Sort

func (Expr) Built

func (o Expr) Built() (driver.SortOrder, error)

Built serializes the sort order.

type Order

type Order = Expr

func Ascending

func Ascending(fieldName string) Order

Ascending builds an increasing order for given field name.

func Descending

func Descending(fieldName string) Order

Descending builds a decreasing order for given field name.

func NewSortOrder

func NewSortOrder(sort ...Order) Order

NewSortOrder creates an array of multiple fields that will be used to sort results.

func (Order) Ascending

func (o Order) Ascending(fieldName string) Order

Ascending builds an increasing order for given field name.

func (Order) Descending

func (o Order) Descending(fieldName string) Order

Descending builds a decreasing order for given field name.

type Sort

type Sort interface {
	ToSortOrder() map[string]string
	FieldName() string
}

Jump to

Keyboard shortcuts

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