MCPcopy Create free account
hub / github.com/0xUnixIO/pulse / Register

Method Register

internal/serverapi/api.go:140–153  ·  view source on GitHub ↗
(mux *http.ServeMux)

Source from the content-addressed store, hash-verified

138}
139
140func (a *API) Register(mux *http.ServeMux) {
141 mux.HandleFunc("/v1/nodes", a.handleNodes)
142 // 精确路由优先于 /v1/nodes/ 通配
143 mux.HandleFunc("GET /v1/nodes/metrics/stream", a.handleAllNodeMetricsStream)
144 mux.HandleFunc("GET /v1/nodes/traceroute/latest", a.handleAllTracerouteLatest)
145 mux.HandleFunc("GET /v1/nodes/latency", a.handleLatency)
146 mux.HandleFunc("/v1/nodes/", a.handleNodeRoutes)
147 mux.HandleFunc("GET /v1/audit/logs", a.handleAuditLogs)
148 mux.HandleFunc("GET /v1/audit/users", a.handleAuditUsers)
149 mux.HandleFunc("GET /v1/audit/count", a.handleAuditCount)
150 mux.HandleFunc("GET /v1/audit/analysis", a.handleAuditAnalysis)
151 mux.HandleFunc("/v1/audit/rules", a.handleAuditRules)
152 mux.HandleFunc("/v1/audit/rules/", a.handleAuditRuleByID)
153}
154
155func (a *API) handleNodes(w http.ResponseWriter, r *http.Request) {
156 switch r.Method {

Callers 6

RunFunction · 0.45
RegisterUsersAPIFunction · 0.45
setupTestMuxFunction · 0.45

Calls

no outgoing calls

Tested by 4

setupTestMuxFunction · 0.36