ordering

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package ordering provides primitives for implementing AIP ordering.

See: https://google.aip.dev/132#ordering (Standard methods: List > Ordering).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Field

type Field struct {
	// Path is the path of the field, including subfields.
	Path string
	// Desc indicates if the ordering of the field is descending.
	Desc bool
}

Field represents a single ordering field.

func (Field) SubFields

func (f Field) SubFields() []string

SubFields returns the individual subfields of the field path, including the top-level subfield.

Subfields are specified with a . character, such as foo.bar or address.street.

type OrderBy

type OrderBy struct {
	// Fields are the fields to order by.
	Fields []Field
}

OrderBy represents an ordering directive.

func Unmarshal

func Unmarshal(s string) (OrderBy, error)

Unmarshal request parses the ordering field for a Request.

Jump to

Keyboard shortcuts

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