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