code: func getAggregations(request *restful.Request) ([]core.AggregationType, error) {
  	aggregationsRaw := strings.Split(request.PathParameter("aggregations"), ",")
  	if len(aggregationsRaw) == 0 {
  		return nil, fmt.Errorf("No aggregations specified")
  	}
  
  	aggregations := make([]core.AggregationType, len(aggregationsRaw))
  
  	for ind, aggNameRaw := range aggregationsRaw {
  		aggName := core.AggregationType(aggNameRaw)
  		if _, ok := core.AllAggregations[aggName]; !ok {
  			return nil, fmt.Errorf("Unknown aggregation %q", aggName)
  		}
  		aggregations[ind] = aggName
  	}
  
  	return aggregations, nil
  }
docs: // getAggregations extracts and validates the list of requested aggregations