You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 28, 2019. It is now read-only.
Currently the route logic can be enhanced in service.go to make it easier to onboard new routes. It would be good to remove the handler wrappers and place them in a configuration struct ie.
func (s *service) fetchNamespaces(w http.ResponseWriter, r *http.Request) error { data, err := s.handleRoute(fetchNamespaces, r, s.metrics.fetchNamespaces) if err != nil { return err } return s.sendResponse(w, http.StatusOK, data) }
In addition to making it easier to onboard routes, this will reduce a lot of duplicated code in the repo and make things more readable and less error prone in general.
The text was updated successfully, but these errors were encountered:
Currently the route logic can be enhanced in service.go to make it easier to onboard new routes. It would be good to remove the handler wrappers and place them in a configuration struct ie.
func (s *service) fetchNamespaces(w http.ResponseWriter, r *http.Request) error { data, err := s.handleRoute(fetchNamespaces, r, s.metrics.fetchNamespaces) if err != nil { return err } return s.sendResponse(w, http.StatusOK, data) }
In addition to making it easier to onboard routes, this will reduce a lot of duplicated code in the repo and make things more readable and less error prone in general.
The text was updated successfully, but these errors were encountered: