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.
type OrderBy ¶
type OrderBy struct { // Fields are the fields to order by. Fields []Field }
OrderBy represents an ordering directive.
func ParseOrderBy ¶
ParseOrderBy request parses the ordering field for a Request.
func (*OrderBy) UnmarshalString ¶
UnmarshalString sets o from the provided ordering string. .
func (OrderBy) ValidateForMessage ¶ added in v0.13.0
ValidateForMessage validates that the ordering paths are syntactically valid and refer to known fields in the specified message type.
func (OrderBy) ValidateForPaths ¶ added in v0.12.0
ValidateForPaths validates that the ordering paths are syntactically valid and refer to one of the provided paths.
type Request ¶
type Request interface { // GetOrderBy returns the ordering of the request. GetOrderBy() string }
Request is an interface for requests that support ordering.
See: https://google.aip.dev/132#ordering (Standard methods: List > Ordering).