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

Function New

pkg/configs/api/api.go:62–71  ·  view source on GitHub ↗

New creates a new API

(database db.DB, cfg Config)

Source from the content-addressed store, hash-verified

60
61// New creates a new API
62func New(database db.DB, cfg Config) *API {
63 a := &API{
64 db: database,
65 cfg: cfg,
66 }
67 r := mux.NewRouter()
68 a.RegisterRoutes(r)
69 a.Handler = r
70 return a
71}
72
73func (a *API) admin(w http.ResponseWriter, r *http.Request) {
74 w.Header().Add("Content-Type", "text/html")

Callers 3

initAPIMethod · 0.92
setupFunction · 0.70
setupWithEmailEnabledFunction · 0.70

Calls 1

RegisterRoutesMethod · 0.95

Tested by 2

setupFunction · 0.56
setupWithEmailEnabledFunction · 0.56