MCPcopy Index your code
hub / github.com/cortexproject/cortex / RegisterAPI

Method RegisterAPI

pkg/api/api.go:268–275  ·  view source on GitHub ↗

RegisterAPI registers the standard endpoints associated with a running Cortex.

(httpPathPrefix string, actualCfg any, defaultCfg any)

Source from the content-addressed store, hash-verified

266
267// RegisterAPI registers the standard endpoints associated with a running Cortex.
268func (a *API) RegisterAPI(httpPathPrefix string, actualCfg any, defaultCfg any) {
269 a.indexPage.AddLink(SectionAdminEndpoints, "/config", "Current Config (including the default values)")
270 a.indexPage.AddLink(SectionAdminEndpoints, "/config?mode=diff", "Current Config (show only values that differ from the defaults)")
271
272 a.RegisterRoute("/config", a.cfg.configHandler(actualCfg, defaultCfg), false, "GET")
273 a.RegisterRoute("/", indexHandler(httpPathPrefix, a.indexPage), false, "GET")
274 a.RegisterRoute("/debug/fgprof", fgprof.Handler(), false, "GET")
275}
276
277// RegisterRuntimeConfig registers the endpoints associates with the runtime configuration
278func (a *API) RegisterRuntimeConfig(runtimeConfigHandler http.HandlerFunc) {

Callers 1

initAPIMethod · 0.80

Calls 4

RegisterRouteMethod · 0.95
indexHandlerFunction · 0.85
AddLinkMethod · 0.80
configHandlerMethod · 0.80

Tested by

no test coverage detected