Closed desa closed 4 years ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically closed because it has not had recent activity. Please reopen if this issue is still important to you. Thank you for your contributions.
Reopening. I like this idea a lot, and it won't take significant effort to implement.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically closed because it has not had recent activity. Please reopen if this issue is still important to you. Thank you for your contributions.
Currently the
http.APIHandler
does route checking with conditionals that do prefix matching on the routehttps://github.com/influxdata/influxdb/blob/f56c42794b7bf6c51052b86d30a8daa8826fae9f/http/api_handler.go#L209-L222
This pattern forces http handlers to push all routes that start with a common prefix to be defined together like so https://github.com/influxdata/influxdb/blob/f56c42794b7bf6c51052b86d30a8daa8826fae9f/http/bucket_service.go#L61-L69 https://github.com/influxdata/influxdb/blob/f56c42794b7bf6c51052b86d30a8daa8826fae9f/http/bucket_service.go#L86-L122
Ideally we'd be able to separate out the endpoints that handle buckets directly with the endpoints that deal with labels/members/etc. This way we could separate out the concerns of each handler.
I propose that we require that http handlers expose the HTTP verbs and routes that they expose. This way we can do something like
This way all of the routes for the buckets will point to the bucket handler and all the bucket label routes will point to the bucket label handler.
Additionally, since we added a router to the api handler we'll no longer need to implement
ServeHTTP
.