api/event.go
func eventList(w http.ResponseWriter, r *http.Request, t auth.Token) error {
	var filter *event.Filter
	err := ParseInput(r, &filter)
	if err != nil {
		return err
	}
	filter.LoadKindNames(r.Form)
	filter.PruneUserValues()
	filter.Permissions, err = t.Permissions()
	if err != nil {
		return err
	}
	events, err := event.List(filter)
	if err != nil {
		return err
	}
	if len(events) == 0 {
		w.WriteHeader(http.StatusNoContent)
		return nil
	}
	w.Header().Add("Content-Type", "application/json")
	return json.NewEncoder(w).Encode(events)
}
func eventList(w http.ResponseWriter, r *http.Request, t auth.Token) error {
	var filter *event.Filter
	err := ParseInput(r, &filter)
	if err != nil {
		return err
	}
	filter.LoadKindNames(r.Form)
	filter.PruneUserValues()
	filter.Permissions, err = t.Permissions()
	if err != nil {
		return err
	}
	events, err := event.List(filter)
	if err != nil {
		return err
	}
	if len(events) == 0 {
		w.WriteHeader(http.StatusNoContent)
		return nil
	}
	w.Header().Add("Content-Type", "application/json")
	return json.NewEncoder(w).Encode(events)
}
// title: event list
// path: /events
// method: GET
// produce: application/json
// responses:
//   200: OK
//   204: No content