sort

package
v1.0.0-beta.122 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ASC  = "$asc"
	DESC = "$desc"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Ordering

type Ordering = []SortField

func UnmarshalSort

func UnmarshalSort(input jsoniter.RawMessage) (*Ordering, error)

UnmarshalSort expects a json array input. Examples:

[{"field_1": "$asc"}, {"field_2": "$desc"}]
[]

type SortField

type SortField struct {
	// Required; Name of field to enable sorting for
	Name string
	// Required; True if ascending order is requested, False for descending
	Ascending bool
	// Optional; True if missing/empty/null values to be presented at the top of sort order,
	// else they are sorted to the end by default
	MissingValuesFirst bool
}

Jump to

Keyboard shortcuts

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