Skip to content

Commit

Permalink
Do not export mgr handler functions
Browse files Browse the repository at this point in the history
  • Loading branch information
gammazero committed Oct 31, 2024
1 parent 3642b8c commit bb39fc0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func addLogHandlers(mux *http.ServeMux) {
})
}

func GCHandler(gnd *Node) func(w http.ResponseWriter, r *http.Request) {
func gcHandler(gnd *Node) func(w http.ResponseWriter, r *http.Request) {
return func(w http.ResponseWriter, r *http.Request) {
defer r.Body.Close()

Expand All @@ -94,7 +94,7 @@ func GCHandler(gnd *Node) func(w http.ResponseWriter, r *http.Request) {
}
}

func PurgePeerHandler(p2pHost host.Host) func(w http.ResponseWriter, r *http.Request) {
func purgePeerHandler(p2pHost host.Host) func(w http.ResponseWriter, r *http.Request) {
return func(w http.ResponseWriter, r *http.Request) {
defer r.Body.Close()

Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -589,8 +589,8 @@ share the same seed as long as the indexes are different.
otel.SetTextMapPropagator(autoprop.NewTextMapPropagator())

apiMux := makeMetricsAndDebuggingHandler()
apiMux.HandleFunc("/mgr/gc", GCHandler(gnd))
apiMux.HandleFunc("/mgr/purge", PurgePeerHandler(gnd.host))
apiMux.HandleFunc("/mgr/gc", gcHandler(gnd))
apiMux.HandleFunc("/mgr/purge", purgePeerHandler(gnd.host))
apiMux.HandleFunc("/mgr/peers", showPeersHandler(gnd.host))
addLogHandlers(apiMux)

Expand Down

0 comments on commit bb39fc0

Please sign in to comment.