code: func decodeFindOptions(ctx context.Context, r *http.Request) (*platform.FindOptions, error) {
  	opts := &platform.FindOptions{}
  	qp := r.URL.Query()
  
  	if offset := qp.Get("offset"); offset != "" {
  		o, err := strconv.Atoi(offset)
  		if err != nil {
  			return nil, err
  		}
  
  		opts.Offset = o
  	}
  
  	if limit := qp.Get("limit"); limit != "" {
  		l, err := strconv.Atoi(limit)
  		if err != nil {
  			return nil, err
  		}
  
  		if l < 1 || l > platform.MaxPageSize {
  			return nil, errors.InvalidDataf("limit must be between 1 and %d", platform.MaxPageSize)
  		}
  
  		opts.Limit = l
  	} else {
  		opts.Limit = platform.DefaultPageSize
  	}
  
  	if sortBy := qp.Get("sortBy"); sortBy != "" {
  		opts.SortBy = sortBy
  	}
  
  	if descending := qp.Get("descending"); descending != "" {
  		desc, err := strconv.ParseBool(descending)
  		if err != nil {
  			return nil, err
  		}
  
  		opts.Descending = desc
  	}
  
  	return opts, nil
  }
docs: // decodeFindOptions returns a FindOptions decoded from http request.