sort

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Criteria

type Criteria struct {
	Properties []Order
}

Criteria represents the sorting criteria for a list of resources

func New

func New(parts ...string) (*Criteria, error)

New parses the properties, represented as comma delimited fields, into a Criteria struct The first part is the properties, the second part is the delimiter used between properties. If none is provided, a semi-colon (;) is used. Each property is assumed to be of the form: propertyName,desc;propertyName2;asc example: createdAt,desc;name,asc

type Order

type Order struct {
	Property  string
	Direction string
}

Order represents a sorting order such as created_at, desc

Jump to

Keyboard shortcuts

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