feat(apiserver): refactor the hooking mechanism for standalone apiserver (#93001)

It now uses a full build handler chain that can be passed from up top to `SetupConfig`.

Co-authored-by: Charandas Batra <charandas.batra@grafana.com>
This commit is contained in:
Jean-Philippe Quéméner
2024-09-06 14:12:12 -07:00
committed by GitHub
co-authored by Charandas Batra
parent a1a18922e5
commit 368c4e53f1
7 changed files with 643 additions and 44 deletions
@@ -13,7 +13,7 @@ type requestHandler struct {
router *mux.Router
}
func getAPIHandler(delegateHandler http.Handler, restConfig *restclient.Config, builders []APIGroupBuilder) (http.Handler, error) {
func GetCustomRoutesHandler(delegateHandler http.Handler, restConfig *restclient.Config, builders []APIGroupBuilder) (http.Handler, error) {
useful := false // only true if any routes exist anywhere
router := mux.NewRouter()