mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 17:11:49 +00:00
They're not specific to repo-updater internals and can live anywhere. This moves them away from it, in an attempt to make the service leaner.
31 lines
804 B
Go
31 lines
804 B
Go
package shared
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/sourcegraph/sourcegraph/internal/debugserver"
|
|
)
|
|
|
|
func createDebugServerEndpoints(ready chan struct{}, debugserverEndpoints *LazyDebugserverEndpoint) []debugserver.Endpoint {
|
|
return []debugserver.Endpoint{
|
|
{
|
|
Name: "Repo Updater State",
|
|
Path: "/repo-updater-state",
|
|
Handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
// wait until we're healthy to respond
|
|
<-ready
|
|
// repoUpdaterStateEndpoint is guaranteed to be assigned now
|
|
debugserverEndpoints.repoUpdaterStateEndpoint(w, r)
|
|
}),
|
|
},
|
|
{
|
|
Name: "Manual Repo Purge",
|
|
Path: "/manual-purge",
|
|
Handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
<-ready
|
|
debugserverEndpoints.manualPurgeEndpoint(w, r)
|
|
}),
|
|
},
|
|
}
|
|
}
|