Skip to content
This repository has been archived by the owner on Feb 28, 2019. It is now read-only.

Refactor routes logic in service.go #55

Open
m-sandusky opened this issue Jan 12, 2018 · 0 comments
Open

Refactor routes logic in service.go #55

m-sandusky opened this issue Jan 12, 2018 · 0 comments
Assignees

Comments

@m-sandusky
Copy link
Contributor

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.

@m-sandusky m-sandusky self-assigned this Jan 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant