...

Source file src/go.einride.tech/aip/ordering/request.go

Documentation: go.einride.tech/aip/ordering

     1  package ordering
     2  
     3  // Request is an interface for requests that support ordering.
     4  //
     5  // See: https://google.aip.dev/132#ordering (Standard methods: List > Ordering).
     6  type Request interface {
     7  	// GetOrderBy returns the ordering of the request.
     8  	GetOrderBy() string
     9  }
    10  
    11  // ParseOrderBy request parses the ordering field for a Request.
    12  func ParseOrderBy(r Request) (OrderBy, error) {
    13  	var orderBy OrderBy
    14  	if err := orderBy.UnmarshalString(r.GetOrderBy()); err != nil {
    15  		return OrderBy{}, err
    16  	}
    17  	return orderBy, nil
    18  }
    19  

View as plain text