mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-02 01:30:30 +00:00
- Add interfaces to allow for alternative implementations for Collector, ControlRouter and PipeRouter. - Pass contexts on http handlers to these interfaces. Although not used by the current (local, in-memory) implementations, the idea is this will be used to pass headers to implementations which support multitenancy (by, for instance, putting an authenticating reverse proxy in form of the app, and then inspecting the headers of the request for a used id).
15 lines
275 B
Go
15 lines
275 B
Go
package app
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"golang.org/x/net/context"
|
|
)
|
|
|
|
// Raw report handler
|
|
func makeRawReportHandler(rep Reporter) CtxHandlerFunc {
|
|
return func(ctx context.Context, w http.ResponseWriter, r *http.Request) {
|
|
respondWith(w, http.StatusOK, rep.Report(ctx))
|
|
}
|
|
}
|