code: func QueryEvents(c context.Context, q *datastore.Query) ([]*api.Event, error) {
  	var ev []Event
  	if err := datastore.GetAll(c, q.Order("-When"), &ev); err != nil {
  		return nil, transient.Tag.Apply(err)
  	}
  	out := make([]*api.Event, len(ev))
  	for i, e := range ev {
  		out[i] = &api.Event{}
  		if err := proto.Unmarshal(e.Event, out[i]); err != nil {
  			return nil, errors.Annotate(err, "failed to unmarshal Event with ID %d", e.ID).Err()
  		}
  	}
  	return out, nil
  }
docs: // QueryEvents fetches and deserializes all events matching the query, sorting
  // them by timestamp (most recent first).
  //
  // Start the query with NewEventsQuery.